MCP Server
MCP is provided by the standalone adapter relay-core-probe (npm package @relay-core/mcp). It runs an embedded proxy and exposes MCP tools to AI agents. It is not relay-core-cli run --mcp.
Prerequisites
npx @relay-core/cli ca generate
npx @relay-core/cli ca install # macOS helper; see ca status on other platforms Configure your MCP client
In Cursor, Claude Desktop, or any MCP client:
{
"mcpServers": {
"relay-core": {
"command": "npx",
"args": ["-y", "@relay-core/mcp"]
}
}
} @relay-core/mcp launches relay-core-probe with stdio transport by default and a local proxy on 127.0.0.1:8080. Point your browser or system proxy there.
probe CLI flags
The probe binary accepts a small set of flags and env vars:
| Flag | Env | Default | Description |
|---|---|---|---|
--port <P> | RELAY_PORT | 8080 | Embedded proxy listen port |
--ca-cert <PATH> | RELAY_CA_CERT | data dir | CA certificate for HTTPS interception |
--ca-key <PATH> | RELAY_CA_KEY | data dir | CA private key |
--transport <MODE> | RELAY_PROBE_TRANSPORT | stdio | stdio or sse |
--probe-port <P> | RELAY_PROBE_PORT | 3000 | SSE listen port (only when transport=sse) |
--probe-bind <ADDR> | RELAY_PROBE_BIND | 127.0.0.1 | SSE bind address |
Tools
Observe
Search and filter captured flows.
{
"filter": "method:GET host:*.example.com",
"limit": 10
} Get detailed flow information.
{
"flow_id": "fld_01HX5K9P3Q8Y2Z7"
} Get current proxy metrics.
Control
Create an interception breakpoint.
{
"filter": {
"method": "POST",
"host": "api.example.com"
},
"pause_at": "request"
} List the currently pending intercepts (HTTP and WebSocket).
Resume a paused flow.
{
"flow_id": "fld_01HX5K9P3Q8Y2Z7",
"action": "resume", // or "drop"
"modifications": {
"status_code": 418,
"response_body": "I'm a teapot"
}
} Rules
Create or update a rule.
{
"name": "Log API requests",
"filter": { "path": "/api/*" },
"action": { "type": "log" }
} Delete a rule.
{
"rule_id": "rul_01HX5K9P3Q8Y2Z7"
} Create a one-off MockResponse rule.
{
"url_pattern": "api.example.com/v1/health",
"status": 200,
"body": "{\"ok\":true}",
"content_type": "application/json"
} Scripting
Hot-load a Deno script into the running engine.
{
"script": "// deno-fmt-ignore\nexport default { onRequest(ctx) { /* ... */ } }"
} Analyze
Export flows as HAR format.
{
"filter": "host:example.com",
"format": "har"
} Replay a captured flow.
{
"flow_id": "fld_01HX5K9P3Q8Y2Z7",
"modifications": {
"headers": { "x-test": "value" }
}
} Policy
Get current interception policy, including the redaction block.
Replace the entire policy.
Apply a partial update — only the supplied keys are touched. Accepts the same { redaction?, upstream? } shape as the REST API.
{
"redaction": {
"enabled": true,
"redact_bodies": true
}
} Resources
MCP also exposes read-only resources:
flows://— Recent flowsrules://— Active rulesproxy://status— Proxy status and metricsaudit://recent— Recent audit eventsca://install— CA install guide with default paths
Use Cases
- AI-powered API testing and debugging
- Automated traffic analysis
- Dynamic rule generation based on traffic patterns
- Integration with CI/CD pipelines