Skip to main content
GPROXY fronts MCP servers (Model Context Protocol, streamable HTTP) the way it fronts model providers. An instance administrator registers a server as a provider; users, teams and organizations sign in to it; and any MCP client reaches it through GPROXY with only a gateway API key. A client that cannot do OAuth itself needs no change. The gateway understands tools: it lists them, filters them by scope, routes calls to the right server and audits each call. Only tools are proxied. Prompts and resources are not.

Registering a server

A server is a provider whose channel is mcp. It is listed in GET /admin/api/channels as “MCP server”.
The provider’s proxy and connection profile apply as for any provider. Models, routes, operation rules and rewrite rules do not apply to an 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.
A server whose authorization server does not support dynamic client registration cannot be signed in to with OAuth in this version.

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 as Authorization: Bearer <key> or in x-api-key. Claude Code:
Codex, in ~/.codex/config.toml:
A client that signs in to GPROXY with OAuth instead of a key needs a token with the OAuth scope 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 deny wins.
  • 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.
A tool the caller may not call does not appear in the tool list, and calling it answers “Unknown tool”.

Examples

Read-only access to one server, nothing else: Everything except destructive tools: One server, minus one tool:

Managing rules

Rules are the mcp-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 is read, 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 action mcp.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 initialize and 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_required results, 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 plain 502 with a JSON-RPC error. The server’s WWW-Authenticate is 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.