Skip to content

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:

bash
npm install -g @aithorized/mcp-proxy
npm install -D @aithorized/mcp-proxy   # no global permissions needed

Installed 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 ​

bash
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:

VariableRequired
AITHORIZED_AGENT_KEYyesThe agent's API key.
AITHORIZED_AGENT_IDyesThe agent's id (agt_…).
AITHORIZED_TENANT_IDyesYour workspace id (ten_…).
AITHORIZED_POLICY_KEYyes in practiceThe pinned policy key, as the dashboard shows it. Without it every call needs a CRITICAL approval.
AITHORIZED_BASE_URLnoDefaults to https://api.aithorized.dev/v1.
AITHORIZED_ENVIRONMENTnoA tag such as prod, shown on the phone and usable in policies.
AITHORIZED_SESSION_IDnoGroups requests of one run (the kill switch can target a session).
AITHORIZED_TOOLS_JSONnoPer-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 ​

json
{
  "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:

yaml
rules:
  - id: orders-db
    match: { tool: "query" }
    effect: REQUIRE_APPROVAL
    riskLevel: HIGH

Per-tool options ​

AITHORIZED_TOOLS_JSON is a JSON object keyed by tool name:

json
{
  "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 (reason as 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:

OutcomeResult
ApprovedThe real tool's result.
Approved with editsA first text block naming what the human changed, then the real result (the tool ran with the edited arguments).
RejectedisError: true, with the reviewer's feedback.
Expired, killed, frozen, suspended, denied by policy, failed verificationisError: 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.

The policy engine, MCP proxy, SDK and hook are MIT-licensed.