MCP Gateway
http://127.0.0.1:11434/mcpthat aggregates every Model Context Protocol server you have enabled. Agents authenticate with Prism's own token and never see upstream credentials, and each agent can be restricted to its own set of servers through /mcp/<agent>.Last updated Reviewed against Prism v0.3.26
Why route MCP through Prism
| Problem without a gateway | What Prism does |
|---|---|
| Every agent needs every server configured separately | Configure a server once in Prism; every agent reaches it from one URL. |
| Each agent stores its own copy of API keys and OAuth tokens | Prism holds the credentials and brokers OAuth, so agents hold only Prism's token. |
| Adding a server means editing one config file per agent | One write in Prism, then re-sync agent access. |
| No visibility into which agent used which tool | Prism owns the connection and reports server health in /mcp/status. |
| Different agents support different transports | Prism speaks stdio, Streamable HTTP and the older HTTP+SSE upstream. |
Endpoints
| Endpoint | Reaches | Method |
|---|---|---|
| /mcp | Every enabled server in your config. | POST (Streamable HTTP), plus GET /mcp/status |
| /mcp/<agent> | Only the servers allowed for that agent id. | POST |
| /mcp/status | Health of every server, plus the agent bindings map. | GET |
| /mcp/control | Admin control channel: status, restart, probe. | POST |
# Every enabled server POST http://127.0.0.1:11434/mcp Authorization: Bearer prism Content-Type: application/json # One agent's allowlist only POST http://127.0.0.1:11434/mcp/claude-code Authorization: Bearer prism
The whole gateway sits behind the same token as the rest of the proxy, so Authorization: Bearer prism and x-api-key: prism both work. Agent ids are the same 14 ids Prism uses in the Agents tab, such as claude-code, codex or zed.
Supported methods
| JSON-RPC method | Prism's behaviour |
|---|---|
| initialize | Legacy handshake, kept so older clients connect. Echoes the client's protocol version, defaults to 2025-06-18. |
| server/discover | The stateless revision's discovery call. Returns the 2026-07-28 version, TTL and a private cache scope. |
| tools/list | Every tool from every reachable server, namespaced. Servers that fail are reported in the status instead of failing the call. |
| tools/call | Routes a namespaced tool call to its upstream server with that server's credentials. |
| ping | Returns an empty result. |
| resources/list, prompts/list | Return empty lists. Prism exposes tools only. |
Prism identifies itself as the server prism version 1.0.0, and tells the agent that tool names follow the mcp__<server>__<tool> convention.
Tool namespacing
Two servers can both expose a tool called search. To keep them distinguishable, Prism prefixes every tool name with its server id.
Upstream servers What the agent sees ──────────────── ─────────────────── weather → get_forecast mcp__weather__get_forecast github → search mcp__github__search filesystem → read_file mcp__filesystem__read_file
Server ids are whatever you named the server in Prism — which the marketplace prefills from the registry entry. Only the first __ after the server id splits the name, so upstream tool names that contain double underscores still route correctly.
tools/call with a bare tool name returns a JSON-RPC invalid-params error telling the agent to use the names from tools/list.Transports
| Transport | Use it when | Fields |
|---|---|---|
| stdio | The server is a local process — npx, uvx, docker, a binary. | command, args, env, cwd |
| http | The server exposes the Streamable HTTP transport. | url, headers |
| sse | The server only exposes the deprecated HTTP+SSE transport. | url, headers |
For stdio servers, Prism resolves the command from your PATH and then from the places a GUI process does not inherit — /opt/homebrew/bin, ~/.local/bin, ~/.npm-global/bin, ~/.cargo/bin, ~/go/bin and the platform npm config directory. On Windows, .cmd and .bat shims such as npx are run through cmd.exe, which exec cannot do directly.
Authentication to upstream servers
| Mode | Meaning |
|---|---|
| none | The server needs no credentials. |
| static | Prism sends the headers or bearer token you supplied. |
| oauth | Prism runs the MCP OAuth 2.1 flow and stores the resulting token for you. |
Brokered OAuth
With oauth, Prism discovers the server's authorization server, registers a client, opens your browser for consent, and stores the access and refresh tokens in config.json with file mode 0600. Tokens are refreshed automatically 60 seconds before expiry, and an upstream 401 triggers a refresh attempt before the call is retried.
Prism supports three registration modes and caches a registered client per authorization server, so a second MCP server on the same provider reuses the existing registration instead of registering again.
| Registration mode | How the client id is obtained |
|---|---|
| dcr | Dynamic client registration (RFC 7591) — the default when the server supports it. |
| preregistered | A client id you already have, entered manually. |
| cimd | Client ID Metadata Document — off by default because it needs a stable HTTPS document you host yourself. |
auto_connect is on (the default), the first agent call to an unauthorized OAuth server opens the sign-in window by itself and the call is retried once you approve. Set it to false in the MCP tab if you would rather authorize servers manually, up front.Add an MCP server
Open the MCP tab
MCP.Search the marketplace or add manually
Set the auth mode
Optionally restrict its tools
Grant agents access
The marketplace
Prism ships with the official registry (registry.modelcontextprotocol.io) seeded and searches its catalog locally, so typing in the search box is instant and works offline once synced. Any registry that speaks the same OpenAPI shape can be added as an extra source — a private or company catalog becomes a drop-in addition rather than a separate client.
| Install path | What Prism does |
|---|---|
| Package manager entry | Writes a stdio server using npx or uvx, with the registry's declared arguments and secrets. |
| .mcpb bundle | Downloads the archive and verifies its published SHA-256 before unpacking — nothing runs unless the digest matches. Downloads are capped at 512 MB. |
| Git import | Point Prism at a repository containing an mcp.json and every server it declares is added, with ${PLUGIN_ROOT} and ${PLUGIN_DATA} resolved for you. |
Per-agent access
Access is an allowlist per agent. An agent reaching /mcp/<agent> sees only its own servers, and a tools/call for a server outside that list is rejected with "server is not enabled for this endpoint". The unrestricted /mcp endpoint reaches every enabled server.
Prism writes the gateway entry into each agent's own MCP config file:
| Agent | MCP config file | Server map |
|---|---|---|
| Claude Code | ~/.claude.json | mcpServers |
| Codex | ~/.codex/config.toml | TOML tables |
| Factory Droid | ~/.factory/mcp.json | mcpServers (with oauth: false) |
| OpenCode | ~/.config/opencode/opencode.json | mcp (type: remote) |
| ZCode | ~/.zcode/cli/config.json | mcp.servers |
| Zed | Zed settings.json (JSONC) | context_servers |
| Grok Build | ~/.grok/config.toml | TOML tables |
| Pi | ~/.pi/agent/mcp.json | mcpServers (read by the pi-mcp-adapter extension) |
| Oh My Pi (OMP) | ~/.omp/agent/mcp.json | mcpServers |
| Kimi Code | $KIMI_CODE_HOME/mcp.json or ~/.kimi-code/mcp.json | mcpServers |
| Prime Agent | ~/.prime/agent/settings.json | mcpServers (user scope only) |
| Empryo | %LOCALAPPDATA%\Empryo\config.json or ~/.empryo/config.json | array-shaped server list |
| Hermes | %LOCALAPPDATA%\hermes\config.yaml or ~/.hermes/config.yaml | server list |
| DeepSeek Harness | $DSH_HOME/cordis.patch.yml (default ~/.dsh) | one insert row |
Authorization: Bearer prisminto each agent's entry — never an upstream key. Removing access deletes only Prism's entry, leaving any servers you configured yourself untouched.Limits and lifecycle
| Limit | Value | Why |
|---|---|---|
| Request body cap | 8 MB | A malformed or hostile agent cannot exhaust memory. |
| Idle stdio reap | 300 seconds (configurable) | Local server processes are shut down when unused, and restarted on demand. |
| Tool list cache | 30 seconds | Keeps tools/list fast without going stale. |
| Tool list timeout | 20 seconds | One slow server cannot stall a tools/list across many servers. |
| Tool call timeout | 10 minutes | Long-running tools still have a bound. |
| Crash recovery | One restart per failure | A dead process is replaced once before the error is reported. |
Remote HTTP and SSE servers are left connected because keeping them costs nothing; only child processes are reaped. Changing the idle timeout in the MCP tab sets idle_timeout_sec.
Server states
| State | Meaning |
|---|---|
| ready | Connected and answering. |
| idle | Configured but not started yet — normal for stdio servers between calls. |
| needs_auth | The upstream rejected the credentials. Authorize it, or let auto-connect do it. |
| runtime_missing | The command could not be found — install Node or uv, or give an absolute path. |
| error | Any other failure. The message is reported in /mcp/status and the MCP tab. |
| disabled | Turned off in Prism, so agents do not see it. |
Configuration
{
"mcp": {
"servers": [
{
"id": "weather",
"name": "Weather",
"transport": "stdio",
"enabled": true,
"command": "npx",
"args": ["-y", "@example/weather-mcp"],
"env": { "WEATHER_API_KEY": "..." },
"auth_mode": "none"
},
{
"id": "linear",
"name": "Linear",
"transport": "http",
"url": "https://mcp.linear.app/mcp",
"enabled": true,
"auth_mode": "oauth"
}
],
"agent_servers": {
"claude-code": ["weather", "linear"],
"zed": ["weather"]
},
"idle_timeout_sec": 300,
"auto_connect": true,
"registries": [
{ "id": "official", "name": "Official MCP Registry", "base_url": "https://registry.modelcontextprotocol.io", "enabled": true, "builtin": true }
]
}
}config.json with mode 0600 and masked on the way to the admin UI. Everything MCP-related stays on your machine.Related
Agent Integrations
Detection, backups and auto-sync for all 14 agents.
Config Reference
The full mcp section, field by field.
Troubleshooting
needs_auth, runtime_missing and restart loops.
Web Search
The other capability Prism serves locally to agents.
Guide: the MCP gateway
Why aggregation matters, how brokered OAuth works, and the operational limits.