MCP Integration
The Model Context Protocol (MCP) server allows AI assistants to interact with ClawNex tools directly during conversations.
Server Details
| Property | Value |
|---|---|
| Server name | clawnex |
| Protocol version | 2024-11-05 |
| Primary transport | stdio (JSON-RPC 2.0) |
| Optional transport | HTTP SSE |
| Default HTTP port | 5002 (configurable via MCP_PORT) |
Starting the Server
Stdio mode:
npx tsx ~/clawnex/src/mcp/server.tsHTTP SSE mode:
MCP_ENABLED=1 MCP_API_KEY=replace-with-a-long-random-key MCP_PORT=5002 npx tsx ~/clawnex/src/mcp/server.tsHTTP mode provides:
GET /sse— Server-Sent Events streamPOST /message— JSON-RPC message endpointGET /health— health check
HTTP SSE mode requires MCP_API_KEY. Keep the server bound to localhost unless you place it behind your own access controls.
RBAC and MCP
The MCP server is a local operator integration. Keep it bound to localhost unless you place it behind your own access controls. It calls local ClawNex endpoints and should be treated as trusted automation running on the host.
Available Tools
| Tool | Purpose |
|---|---|
shield_scan | Scan text through the prompt shield |
check_posture | Get current security posture and service health |
query_threats | Query active threats and alerts |
review_audit | Query recent audit events |
manage_access | Add or remove access-control list entries |
configure_provider | Configure model-provider settings |
generate_report | Generate a report from ClawNex telemetry |
run_shield_tests | Run the shield validation suite |
run_trust_audit | Run trust-audit checks |
manage_budget | Inspect or manage cost-budget controls |
Example: shield_scan
Input: text (required), direction (optional: inbound or outbound)
Verdict: BLOCK | Score: 85
Detections: prompt-injection-override, system-prompt-extractionExample: check_posture
Input: none
Threat Score: 23 | Posture Score: 82
Services: shield: healthy, proxy: healthy, database: healthyClient Configuration
Add the server to an MCP-capable client configuration:
{
"mcpServers": {
"clawnex": {
"command": "npx",
"args": ["tsx", "/path/to/clawnex/src/mcp/server.ts"]
}
}
}