MCP Gateway
Run Veto as a managed or self-hosted MCP policy gateway.
Veto MCP Gateway lets you enforce Veto policies on MCP tools/call traffic while preserving normal MCP JSON-RPC behavior.
Architecture
Veto MCP Gateway has two launch paths:
- Managed gateway in
veto-server:- Configure upstreams in the dashboard.
- Call
POST /v1/mcp/:slug(and optionalGET /v1/mcp/:slugSSE stream). - Data path auth uses your Veto API key.
- Self-hosted gateway in CLI:
- Run
veto mcp serve. - Route MCP requests to configured upstreams from
veto/mcp.config.yaml. - Supports
mcp-sseandmcp-stdio.
- Run
Policy decisions map to JSON-RPC responses:
allow: upstream call is forwarded.deny: JSON-RPC error-32001.require_approval: JSON-RPC error-32002.
Self-hosted quickstart
Initialize config:
veto mcp initGenerated file:
listen:
host: 127.0.0.1
port: 8799
policy:
serverUrl: http://localhost:3001
apiKey: veto_replace_me
upstreams:
- name: default
transport: mcp-sse
url: http://localhost:3000/mcp
timeoutMs: 30000Run diagnostics:
veto mcp doctor
veto mcp doctor --jsonStart gateway:
veto mcp serve --config ./veto/mcp.config.yamlYou can also run without a config file for simple SSE setups:
veto mcp serve \
--upstream http://localhost:3000/mcp \
--api-key veto_xxx \
--policy-server http://localhost:3001Managed quickstart
- Open dashboard settings and go to MCP Gateway.
- Add an upstream slug and transport (
mcp-ssein managed mode). - Test connectivity from the UI.
- Send MCP JSON-RPC to:
curl -X POST https://api.runveto.com/v1/mcp/default \
-H 'X-Veto-API-Key: veto_xxx' \
-H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Managed vs self-hosted transport support
- Managed v1 supports:
mcp-sse. - Self-hosted supports:
mcp-sse,mcp-stdio.
If you need stdio for local process adapters, run self-hosted veto mcp serve.
Troubleshooting
SSE upstream timeouts
Symptoms:
Upstream timeoutNo response in SSE stream
Checks:
- Increase
timeoutMsfor the upstream. - Verify upstream endpoint accepts JSON-RPC
POSTpayloads. - Confirm upstream returns matching JSON-RPC
idin responses.
Policy server unreachable
Symptoms:
Policy server unreachable- doctor reports policy server probe failure.
Checks:
- Verify
policy.serverUrl. - Verify
policy.apiKeystarts withveto_and is valid. - Confirm
POST /v1/validateis reachable from gateway runtime.
Stdio differences
Symptoms:
- Managed upstream creation rejected for
mcp-stdio.
Cause:
- Managed v1 intentionally blocks stdio transports.
Resolution:
- Move that upstream to self-hosted
veto mcp serve.