PromptGate 0.7 — changelog
Archived from CHANGELOG.md, which keeps the unreleased changes and, until the next release, the latest one.
0.7.0 - 2026-10-21
Section titled “0.7.0 - 2026-10-21”The MCP release: agents reach far more than models — through the Model
Context Protocol they read repositories, tickets, files and databases,
and every tool result goes straight back into the prompt. PromptGate now
puts those servers behind one MCP endpoint, /mcp: an agent needs one
entry and a pg_ key, and every tool call is logged, rate-limited and
inspected in both directions like model traffic. Remote servers
(Streamable HTTP) and local programs (stdio) sit behind it; agents and
servers may speak either protocol era — 2026-07-28 or the
initialize-based 2025 versions — and need not match. AI Gateway
endpoints become tools, PromptGate itself becomes an MCP server for keys
that may steer it, and promptgate mcp import / setup / connect
move agents over. Own implementation, no MCP SDK and no new module —
golang.org/x/sys, already in the build, is now used directly for
process groups and job objects.
-
MCP protocol core (
internal/mcp, groundwork for the MCP gateway): JSON-RPC 2.0 messages decoded strictly (case-sensitive members, duplicate names and broken UTF-8 refused, so a message can’t mean one thing to PromptGate and another to the server behind it), both protocol eras — 2026-07-28 with per-request_metaand theMcp-Method/Mcp-Nameheaders, and the legacyinitializeversions 2025-11-25, 2025-06-18 and 2025-03-26 — header encoding and validation, and detection of an upstream server’s era. Fuzzed; no new dependency (encoding/json/v2from the standard library). -
MCP client for upstream servers over Streamable HTTP (groundwork for the MCP gateway): probes each server once with
server/discoverand falls back to aninitializesession for legacy servers, as the spec’s detection rules prescribe (the status code alone never decides — a stateless legacy server answers 200 with “method not found”); sends PromptGate’s own per-request metadata to modern servers and none to legacy ones, so a client’s identity and capabilities never reach the server; reads JSON and SSE answers with per-message size limits, relays progress notifications, answers a legacy server’sping, refuses sampling and elicitation, tells legacy servers about cancelled calls, sets a forgotten session up again once and ends sessions withDELETE. Tool parameters markedx-mcp-headerare mirrored intoMcp-Param-*headers; tools with invalid annotations are detected. -
MCP servers as child processes (stdio, groundwork for the MCP gateway): started on first use, probed once (a silent server counts as legacy after 30 s; the era holds for restarts), restarted after a crash with backoff (1 s doubling to 1 min, reset after 30 s of uptime), stopped when idle if configured. Each server runs in its own process group (Unix) or job object (Windows), so stopping it — stdin closed, then SIGTERM, then SIGKILL — also ends what it started (
npx→node); on Linux and Windows the children die with PromptGate even if it crashes. A server inherits onlyPATH,HOMEand similar basics from PromptGate’s environment — provider keys stay out — plus its ownenv. Clients’ progress tokens are swapped per call so clients sharing a process never see each other’s progress; cancelled calls are cancelled at the server; pretty-printed JSON is compacted to one line; stderr and stray stdout lines go to the log, rate-limited. -
MCP configuration:
mcp.servers(remoteurl+headers, or a localcommandwithargs,env,dir,start: lazy|eager,idle_stop;timeout,tools.allow/denywith patterns,disabled),mcp.separator,mcp.list_ttl,mcp.max_result_bytes,surfaces.mcp_gateway.mount(/mcp),keys[].mcp(servers or single tools),limits.mcp(per server orserver/tool) andguardrails.mcp(per server); every reference is checked on load. A reload reopens only servers whose settings changed — an unchanged local program keeps running. Seedocs/mcp.md. -
promptgate mcp serversconnects to every MCP server and shows transport, target, status, protocol version and tool count (exit 1 if one fails);promptgate mcp tools [server]lists the tools agents see. Both work without a running gateway. -
MCP gateway on
/mcp: agents reach every server undermcp.serversthrough one entry with apg_key. Tools and prompts are named<server>__<name>, resources keep their URIs and are routed by the servers’ lists and templates. Lists come from all servers in parallel, are cached (mcp.list_ttl, or a server’s shorterttlMs) and leave a failing server out instead of failing.keys[].mcpnarrows what a key sees and calls — a tool outside it looks like one that doesn’t exist. Both protocol eras on the agent side: modern requests are served statelessly with their headers checked,initializeopens an in-memory session bound to the key (batches for 2025-03-26). Progress is relayed live over SSE, cancelling a call cancels it at the server,Mcp-Param-*headers are set for modern servers. Config reloads restart only the servers that changed. -
promptgate mcp call <server__tool> --args '{…}'calls one tool through the gateway’s routing and prints the result; progress goes to stderr. -
MCP requests in the request log, console and metrics: one row per request (surface
mcp; method, server and tool as route, provider and model; cost 0; tool errors, unreachable servers, limits and cancelled calls told apart). Schema v13 addsrequests.surfaceand separate per-minute MCP totals, so model stats, budgets, cost and anomalies never count tool calls.promptgate logs --surface ai|mcp,promptgate stats --by server|tool(or--surface mcp), metricspromptgate_mcp_requests_total,promptgate_mcp_request_duration_secondsandpromptgate_mcp_server_up. -
limits.mcpis enforced: per server ("*"for every other one) and perserver/tool, shared by all keys; a call over a limit gets JSON-RPC error-32029withretryAfterand never reaches the server. -
promptgate replayand the playground refuse MCP rows instead of sending them to a model. -
Guardrails on MCP traffic, both directions, with the existing guards: arguments count as role
assistant, everything a server returns as roletool, so a guard covers MCP where it covers those roles in model traffic.blockrefuses arguments with JSON-RPC error-32001before the server is called and turns a blocked tool result into anisErrorresult with the reason;maskandredactrewrite them, redacted arguments are restored in the result (andMcp-Param-*headers carry only the token). Request rules (ip_allowlist,time_window,length) apply to MCP calls. Levels: global →guardrails.mcp.<server>→ key. What applies in the web UI takes an MCP server. -
AI Gateway endpoints as MCP tools,
endpoint__<slug>: variables (or theinput_schema, or oneinputmessage) become the tool’s input schema, an objectoutput_schemaits output schema withstructuredContent. Calls run through the model pipeline as the agent — key, address, limits, budgets, guardrails, logging — and refusals come back asisErrorresults.mcp.endpoints: falseturns the bridge off,mcp: falseon an endpoint hides it;keys[].mcptakesendpointandendpoint/<slug>.promptgate mcp toolsandpromptgate mcp callinclude them. -
PromptGate as an MCP server, for keys with
control: readorwrite(default none): toolspromptgate__stats,logs,budgets,anomalies,config(no secrets),endpointsandkeys(no hashes) read;key_create/rotate/disable/enable,endpoint_disable/enable/update,limit_set/removeandbudget_setchange. Changes take the web UI’s checked path — validated before anything is written, backed up, reloaded — and land in the audit trail asmcp:<key>.promptgate keys createtakes--mcpand--control;keys listshows both. -
Moving agents to the MCP gateway:
promptgate mcp importtakes over the MCP servers configured in Claude Code (incl. per-project servers in~/.claude.json), Claude Desktop, Cursor and VS Code — secrets in env, headers, URL parameters and flags become${ENV}references with the variables listed, HTTP+SSE servers and PromptGate itself are skipped;--writeadds them through the checked path.promptgate mcp setup claude-code|cursor|codex|claude-desktopshows or writes (--write) the agent’s entry for the gateway, keeping the rest of its config;--create-keymakes the agent a key.promptgate mcp connectis a stdio shim to the running gateway for agents that only start programs: both protocol eras, sessions reopened after a gateway restart. -
Web UI for the MCP gateway: an MCP servers page with each server’s state (connected/running, failing with the reason, disabled), protocol version and tool count — read without contacting a server — and per server its tools as agents call them, Reconnect, Disable, Enable, Delete and a checked YAML editor (also for new servers; literal secrets hidden on the detail page). The key form edits MCP servers, single tools and
control; Logs filter model requests or MCP tool calls; Rate limits have an MCP scope (budgets don’t). -
Tool definitions meet the guardrails: descriptions of tools, prompts and resources (and of their parameters) count as role
tool, so instructions planted in them (“tool poisoning”) are caught like those in tool results — a blocked definition is left out of the list, a masked one listed masked. Each list is prepared once per guard set and cached with it. -
A merged
tools/listfrom the cache is written out directly: 10 servers with 200 tools take about 0.3 ms with every content guard on (was 1.3 ms with the definitions inspected per request). -
bench/cmd/mockmcp, a deterministic MCP server for benchmarks; the MCP gateway’s conformance test against the official reference server (@modelcontextprotocol/server-everything, as a local program, both protocol eras) runs in the platforms workflow; the pgfuzz gate probes the MCP gateway (access, allowlist bypass through names, headers and cursors, protocol, secrets in arguments, injections in results, oversized results).
- Web UI: saving a key kept only its hash and status of the fields the
form doesn’t show — an
mcp:allowlist would have been dropped — and saving the global guardrails dropped override sections it didn’t know (nowmcpoverrides are a scope of their own, like keys and endpoints). - Web UI: the endpoint editor kept only the keys it knew, so an
endpoint’s
mcpsetting would have been dropped on save; it is now under Other settings.
Performance
Section titled “Performance”Measured against v0.6.0 under the same load (bench/results/2026-10-21-go-v0.7.0-release.md):
- The proxy path is as fast as in v0.6.0 (29,600–30,900 requests/s at 16 clients, v0.6.0 28,500–28,700).
- A tool call through the MCP gateway costs about 0.2 ms more than calling the server directly, with secrets, PII, injection and keyword guards on arguments and results and a log row each.
tools/listmerged from ten servers with 200 tools answers from the cache in 0.47 ms.- 18.7 MB binary (7.5 MB gzip), ready in ≈ 0.1 s, ≈ 52 MB RAM at idle.