Skip to content
Last updated December 3, 2026

PromptGate 0.7 — changelog

Archived from CHANGELOG.md, which keeps the unreleased changes and, until the next release, the latest one.

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 _meta and the Mcp-Method/Mcp-Name headers, and the legacy initialize versions 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/v2 from the standard library).

  • MCP client for upstream servers over Streamable HTTP (groundwork for the MCP gateway): probes each server once with server/discover and falls back to an initialize session 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’s ping, refuses sampling and elicitation, tells legacy servers about cancelled calls, sets a forgotten session up again once and ends sessions with DELETE. Tool parameters marked x-mcp-header are mirrored into Mcp-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 only PATH, HOME and similar basics from PromptGate’s environment — provider keys stay out — plus its own env. 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 (remote url + headers, or a local command with args, env, dir, start: lazy|eager, idle_stop; timeout, tools.allow/deny with 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 or server/tool) and guardrails.mcp (per server); every reference is checked on load. A reload reopens only servers whose settings changed — an unchanged local program keeps running. See docs/mcp.md.

  • promptgate mcp servers connects 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 under mcp.servers through one entry with a pg_ 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 shorter ttlMs) and leave a failing server out instead of failing. keys[].mcp narrows 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, initialize opens 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 adds requests.surface and 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), metrics promptgate_mcp_requests_total, promptgate_mcp_request_duration_seconds and promptgate_mcp_server_up.

  • limits.mcp is enforced: per server ("*" for every other one) and per server/tool, shared by all keys; a call over a limit gets JSON-RPC error -32029 with retryAfter and never reaches the server.

  • promptgate replay and 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 role tool, so a guard covers MCP where it covers those roles in model traffic. block refuses arguments with JSON-RPC error -32001 before the server is called and turns a blocked tool result into an isError result with the reason; mask and redact rewrite them, redacted arguments are restored in the result (and Mcp-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 the input_schema, or one input message) become the tool’s input schema, an object output_schema its output schema with structuredContent. Calls run through the model pipeline as the agent — key, address, limits, budgets, guardrails, logging — and refusals come back as isError results. mcp.endpoints: false turns the bridge off, mcp: false on an endpoint hides it; keys[].mcp takes endpoint and endpoint/<slug>. promptgate mcp tools and promptgate mcp call include them.

  • PromptGate as an MCP server, for keys with control: read or write (default none): tools promptgate__stats, logs, budgets, anomalies, config (no secrets), endpoints and keys (no hashes) read; key_create/rotate/disable/enable, endpoint_disable/enable/update, limit_set/remove and budget_set change. Changes take the web UI’s checked path — validated before anything is written, backed up, reloaded — and land in the audit trail as mcp:<key>. promptgate keys create takes --mcp and --control; keys list shows both.

  • Moving agents to the MCP gateway: promptgate mcp import takes 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; --write adds them through the checked path. promptgate mcp setup claude-code|cursor|codex|claude-desktop shows or writes (--write) the agent’s entry for the gateway, keeping the rest of its config; --create-key makes the agent a key. promptgate mcp connect is 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/list from 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 (now mcp overrides 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 mcp setting would have been dropped on save; it is now under Other settings.

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/list merged 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.
Was this page helpful?