MCP proxy
aithorized-mcp-proxy sits between your MCP client (Claude Desktop, Claude Code, Cursor, your own agent) and an MCP server that speaks stdio. It starts the server as a child process and re-exposes its tools unchanged. Every tools/call is checked against your policy first, and waits for a signed approval when a rule says so.
The server's own credentials (a database URL, an API token) stay in the proxy's environment for the child process. The model never sees them.
Install
Once published (private beta), globally or in the project:
npm install -g @aithorized/mcp-proxy
npm install -D @aithorized/mcp-proxy # no global permissions neededInstalled in the project, run it as npx --no-install aithorized-mcp-proxy …. If your MCP client starts servers outside the project folder (Claude Desktop does), use the absolute path to node_modules/.bin/aithorized-mcp-proxy as the command instead.
Run
aithorized-mcp-proxy --upstream <command> [args...]Everything after --upstream is the command that starts the real MCP server. The proxy reads its aithorized settings from the environment:
| Variable | Required | |
|---|---|---|
AITHORIZED_AGENT_KEY | yes | The agent's API key. |
AITHORIZED_AGENT_ID | yes | The agent's id (agt_…). |
AITHORIZED_TENANT_ID | yes | Your workspace id (ten_…). |
AITHORIZED_POLICY_KEY | yes in practice | The pinned policy key, as the dashboard shows it. Without it every call needs a CRITICAL approval. |
AITHORIZED_BASE_URL | no | Defaults to https://api.aithorized.dev/v1. |
AITHORIZED_ENVIRONMENT | no | A tag such as prod, shown on the phone and usable in policies. |
AITHORIZED_SESSION_ID | no | Groups requests of one run (the kill switch can target a session). |
AITHORIZED_TOOLS_JSON | no | Per-tool options, below. |
All of them come ready to paste from Agents → Connect an agent in the dashboard.
Example: a Postgres MCP server in Claude Desktop
{
"mcpServers": {
"orders-db": {
"command": "aithorized-mcp-proxy",
"args": ["--upstream", "npx", "-y", "@modelcontextprotocol/server-postgres", "postgres://readwrite@db/orders"],
"env": {
"AITHORIZED_AGENT_KEY": "ak_live_…",
"AITHORIZED_AGENT_ID": "agt_…",
"AITHORIZED_TENANT_ID": "ten_…",
"AITHORIZED_POLICY_KEY": "{\"keyId\":\"policy-v1\",\"publicKeyJwk\":{\"kty\":\"OKP\",\"crv\":\"Ed25519\",\"x\":\"…\"}}",
"AITHORIZED_ENVIRONMENT": "prod"
}
}
}
}The tool names your policy matches are the MCP server's own tool names (here, query). For example, to ask before every query in production:
rules:
- id: orders-db
match: { tool: "query" }
effect: REQUIRE_APPROVAL
riskLevel: HIGHPer-tool options
AITHORIZED_TOOLS_JSON is a JSON object keyed by tool name:
{
"create_refund": {
"editableFields": [{ "path": "/amount", "type": "integer", "min": 1, "max": 50000, "label": "Amount (cents)" }],
"environment": "prod"
}
}editableFields: fields the approver may change on the phone before approving, within the limits you set. The server and the proxy both check that nothing else changed.environment,reason: shown on the phone (reasonas untrusted text).
What the model sees
The proxy answers tools/call the MCP way, as a tool result, so the agent keeps running and can react:
| Outcome | Result |
|---|---|
| Approved | The real tool's result. |
| Approved with edits | A first text block naming what the human changed, then the real result (the tool ran with the edited arguments). |
| Rejected | isError: true, with the reviewer's feedback. |
| Expired, killed, frozen, suspended, denied by policy, failed verification | isError: true with a fixed message; the tool did not run. |
Each refusal also carries _meta.aithorized.status (REJECTED, EXPIRED, KILLED, CIRCUIT_BROKEN, SUSPENDED, DENIED, VERIFICATION_FAILED) and, when there was one, the requestId, for your logs.