Registering a server
A server is a provider whosechannel is mcp. It is listed in GET /admin/api/channels as “MCP server”.
Signing in
A credential of an MCP server has one of three kinds:
OAuth uses the same authorization-code sign-in as other credentials:
POST /admin/api/credential-login/authcode/start, then /complete. See Logging in to obtain a credential. GPROXY discovers the server’s authorization server from its protected-resource metadata (RFC 9728, also read from the WWW-Authenticate challenge) and the authorization server’s metadata (RFC 8414 or OIDC), registers itself dynamically (RFC 7591), and uses PKCE S256 and the resource parameter (RFC 8707). It refreshes the token before it expires, and once more after a 401.
After you approve, the browser is sent to http://127.0.0.1:47821/callback. Nothing listens there, so the page does not load; paste the address from the address bar back into the dialog.
Who can use a server
A caller can use a server only when its key can see a live credential of that provider. This is the ordinary credential visibility rule, decided by the key’s binding. When several credentials are visible, the caller’s own is preferred, then its team’s, then its organization’s, then a shared one. A session keeps the credential it started with.The two addresses
On the aggregated address a tool is named
<server>__<tool>. A name that is longer than 64 characters, or that has characters outside [A-Za-z0-9_-], is not offered there; reach such a tool through the server’s own address.
Configuring a client
A client needs the URL and the gateway key, nothing else: the transport is streamable HTTP, and the key is sent asAuthorization: Bearer <key> or in x-api-key.
Claude Code:
~/.codex/config.toml:
gproxy:mcp.
Scopes
MCP is allowed by default: a user or key with no MCP rule may use every server it can see a credential for. The model permission rules are not consulted for MCP. A rule has a subject, a scope, an action and a priority. The subject is one user or one API key, never both.Scope syntax
* stands for the whole server part or the whole tool part; it is not a pattern inside a name. The nature forms also accept * as the server: mcp:*:@destructive.
Evaluation
- A subject with no rule is allowed everything.
- Otherwise the rules are tried from the highest priority down, and the first one that matches decides. At equal priority a
denywins. - A tool that no rule matches is denied.
- A key’s rules only narrow its user’s: the user’s rules are evaluated, then the key’s, and both must allow.
- Rules apply to every caller, instance administrators included.
Examples
Read-only access to one server, nothing else:
Everything except destructive tools:
One server, minus one tool:
Managing rules
Rules are themcp-scopes family of the management API, for instance administrators: list, create, batch, and get, update or delete by ID under /admin/api/mcp-scopes. The list accepts userId, apiKeyId, ownerUserId, search, page and pageSize.
Tool nature
Each tool isread, write or destructive. The nature comes from the tool’s MCP annotations, with the specification’s conservative defaults:
A tool that declares nothing is therefore
destructive.
An administrator can override the nature of a tool. The tool list offered to callers carries the hints of the resulting nature. Overrides are the mcp-tool-natures family (/admin/api/mcp-tool-natures), with providerId, tool and nature; only nature can be changed afterwards.
GET /admin/api/mcp-tools/{providerId} returns the server’s tools with the declared nature, the effective nature and the ID of the override, if any. It asks the server live, so the provider needs a base URL and a live credential, and the request answers 502 when the server cannot be reached.
Audit
Every tool call writes one record to the audit trail, with the actionmcp.tools.call:
See Usage, logs, and audit.
Protocol behaviour and limits
- Towards clients, GPROXY speaks MCP revision 2026-07-28 (stateless, no
initialize) and the session-based revisions 2024-11-05 to 2025-11-25. - Towards servers, it prefers 2026-07-28 and falls back to
initializeand a session, which is what servers such as DeepWiki and Notion speak today (2025-11-25). - For a session-based server, the mapping from the caller’s session to the upstream session and credential is stored durably, so any instance can continue a session.
- Every answer is one JSON body. There is no SSE stream towards clients and no GET stream, and progress notifications are dropped.
- Server-initiated requests (sampling, elicitation) work only as
input_requiredresults, when both the client and the server speak 2026-07-28; they pass through unchanged. A session-based server is opened without client capabilities and cannot ask. - When a server answers
401, GPROXY refreshes the credential once and retries. If the server still refuses, the client gets a plain502with a JSON-RPC error. The server’sWWW-Authenticateis never forwarded, so a client never starts OAuth with the server itself. - A server’s tool list is cached for 5 minutes, per server and credential. A tool the server adds or removes can take that long to show.
- Prompts and resources are not proxied.