Skip to content

MCP Overview

The Model Context Protocol is a JSON-RPC standard for exposing tools to AI agents. PromptGate plugs into MCP three different ways depending on what you’re trying to do:

SurfaceRoleURLProject type
MCP BridgeExpose your AI Gateway endpoints AS MCP tools to agentsPOST /api/{uuid}/mcpai_gateway
MCP GatewayAggregate multiple upstream MCP servers under one URLPOST /api/{uuid}/mcpmcp_gateway
MCP Control PlaneManage PromptGate itself via MCPPOST /api/control/mcpglobal

All three speak JSON-RPC 2.0. All three implement the standard initialize, tools/list, tools/call, ping, notifications/initialized methods. The endpoint URL determines which one you’re talking to.

You have an ai_gateway project with endpoints like summarize-ticket, classify-email, extract-fields. You want an agent (Claude Desktop, Cursor, your own) to discover and call these as tools.

→ Enable expose_as_mcp_tool on each endpoint, point the agent at /api/{uuid}/mcp, done.

You’re using multiple upstream MCP servers — a filesystem server, a GitHub server, a Slack server. Instead of configuring each agent with N URLs, you want one URL that aggregates all of them.

→ Create an mcp_gateway project, register each upstream as an MCP Server, point the agent at /api/{uuid}/mcp. Tool names are namespaced (fs__read_file, gh__create_issue) so calls route deterministically.

You want an agent to manage PromptGate: list projects, rotate tokens, toggle endpoints, pull metrics.

→ Use the global /api/control/mcp with an admin-scoped token. 12 tools cover the read + write surface.

Every MCP surface requires a Bearer token:

SurfaceRequired scope
Bridgemcp
Gatewaymcp
Control Planeadmin

See Client Tokens for token issuing.

The JSON-RPC envelope shape is uniform:

{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"tools": [
{ "name": "summarize-ticket", "description": "...", "inputSchema": {...} }
]
}
}

What changes between surfaces is which tools tools/list returns and what tools/call does:

  • Bridge: tools = your AI endpoints; call = run the endpoint pipeline.
  • Gateway: tools = union of upstream tools (with prefix); call = forward to the right upstream.
  • Control Plane: tools = PromptGate management ops; call = read DB or mutate state.

All three surfaces support:

  • Notifications (envelope without id) — return 204 No Content. Used by notifications/initialized.
  • Batch requests (top-level array of envelopes) — return an array of responses (notifications omitted).

The PROTOCOL_VERSION constant is 2024-11-05 across all three surfaces — that’s the MCP spec version PromptGate implements.

Tested against: Claude Desktop, Cursor, custom JSON-RPC clients.


© Akyros Labs LLC. All rights reserved.