Model Context Protocol (MCP) Integration
Trafexia features a built-in MCP (Model Context Protocol) Server that exposes captured mobile traffic, WebSocket frames, mock rules, and APK Static Analysis capabilities directly to external AI agents such as Claude Desktop, Cursor IDE, Antigravity IDE, Windsurf, and Continue.
Transport Protocols Supported
- Stdio Transport (Built-in Node Bridge — Recommended):
Connects directly to Trafexia's local JSON-RPC stdio runner at
bin/trafexia-mcp.js. Zero network overhead and runs offline. - SSE Transport (Port 8890 +
mcp-remote): Runs an Express HTTP + Server-Sent Events (SSE) server onhttp://127.0.0.1:8890/sse. External clients connect via the officialmcp-remotebridge package.
Automatic 1-Click IDE Configuration
Trafexia includes an Auto-Detect & Install feature inside the app:
- Open Trafexia Desktop -> Go to Settings -> Select MCP Server.
- Click Auto-Detect & Install to All IDEs.
- Trafexia will scan your machine for Claude Desktop, Cursor, Antigravity, Windsurf, and Continue configurations, automatically adding the
trafexiaMCP tool definitions.
Manual Configuration Snippets
1. Claude Desktop, Cursor, Antigravity & Windsurf (Stdio Direct)
Add the following block to your IDE's mcp.json or claude_desktop_config.json:
{
"mcpServers": {
"trafexia": {
"command": "node",
"args": [
"/absolute/path/to/trafexia/bin/trafexia-mcp.js"
]
}
}
}
2. SSE Remote Bridge (mcp-remote)
If connecting to an already running Trafexia instance over HTTP/SSE:
{
"mcpServers": {
"trafexia": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:8890/sse"
]
}
}
}
Available MCP Tools Exposed by Trafexia
| Tool Name | Parameters | Description |
| :--- | :--- | :--- |
| list_requests | limit (default: 50), search | Search captured HTTP/HTTPS requests by URL, host, or path. |
| get_request_details | id | Get full headers, query params, and body for a request ID. |
| get_traffic_summary | None | Get real-time traffic statistics (2xx, 4xx, 5xx counts, top hosts). |
| export_as_curl | id | Generate a ready-to-run cURL command string for a request. |
| search_sensitive_data | keyword | Search traffic for Authorization tokens, Bearer, JWTs, and API keys. |
| get_mock_rules | None | Get active mock response rules and breakpoint overrides. |
| get_websocket_messages | request_id | Get all WebSocket frame messages for a connection. |
| analyze_apk | file_path | Decompile and perform static analysis on an .apk / .xapk file. |
| analyze_apk_security_ai | file_path, locale | Run AI security evaluation and generate risk report (0-100 score). |
| chat_apk_ai | file_path, message, locale | Ask technical questions or generate Frida dynamic hooks for an APK. |