MCP Gateway

obleth can front MCP (Model Context Protocol) servers with the same identity

obleth can front MCP (Model Context Protocol) servers with the same identity layer it applies to LLM traffic. Clients authenticate once with an obleth API key and reach any registered MCP server through a single endpoint — /mcp/{server} — while obleth injects the upstream credential and records access.

This keeps obleth lean: it is a transport-transparent reverse proxy for MCP, not a re-implementation of it. obleth does not parse JSON-RPC, so any MCP-over-HTTP server (streamable-HTTP or SSE) works unchanged.

Auto-injecting MCP tools into chat/completions and executing tool calls server-side is intentionally out of scope here — that's a planned Phase 2 feature. This gateway is about authenticated, audited access to MCP servers.

Registering a server

From the dashboard (MCP Servers → Register) or the Management API:

curl -X POST "${OBLETH_ADMIN_BASE_URL}/api/v1/mcp-servers" \
  -H "Authorization: Bearer $OBLETH_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "name": "github",
        "upstream_url": "https://mcp.githubcopilot.com/mcp",
        "auth_header": "Bearer ghp_…"
      }'
  • name — the path segment clients use: /mcp/github.
  • upstream_url — the MCP server's base URL.
  • auth_header — optional full Authorization header value obleth injects toward the upstream (stored encrypted-at-rest in production). Clients never see it.

Other endpoints: GET /api/v1/mcp-servers, GET/PUT/DELETE /api/v1/mcp-servers/{id}. All writes are audited and synced to every gateway pod via Redis.

Calling through the gateway

Clients point their MCP client at obleth using their obleth API key:

POST https://{obleth-host}/mcp/github
Authorization: Bearer sk_...
Content-Type: application/json

{ "jsonrpc": "2.0", "method": "tools/list", "id": 1 }

obleth:

  1. authenticates the obleth API key (same keys as LLM traffic),
  2. resolves the registered server from its hot cache,
  3. strips the client's credential, injects the server's auth_header,
  4. reverse-proxies the request and streams the response back (JSON or SSE).

Sub-paths are supported: /mcp/{server}/{rest} forwards {rest} (and the query string) to the upstream.

Observability

Per-call counts are exported as Prometheus metrics (server names are low-cardinality):

  • obleth_mcp_requests_total{server, status="2xx|4xx|5xx"}

Registry changes (create/update/delete) appear in the audit log. With OTLP tracing enabled, each call produces an mcp_request span tagged with the server name.

Errors

StatusMeaning
401missing/invalid obleth API key
403key disabled, or the MCP server is disabled
404no MCP server registered under that name
502the upstream MCP server failed