Local MCP gateway that proxies AI clients to many MCP servers with a token-efficient code mode
Perforce Agentic Gateway (PAG) — Local MCP Gateway
Perforce Agentic Gateway (PAG) is a local MCP gateway that proxies AI clients to many MCP servers. It provides a “token efficient code mode,” where AI clients are configured once to connect to PAG, and subsequent MCP server configuration is routed through PAG.
🛠️ Key Features
Local MCP gateway that proxies AI clients to many MCP servers
Token efficient code mode
Centralized management of connected MCP servers via PAG
Restarts MCP server processes when they crash
Stores necessary configuration for MCP servers
🚀 Use Cases
Configure AI clients once, then access multiple MCP servers through PAG
Avoid separately setting up and loading tools for each MCP server
⚡ Developer Benefits
Reduced per-server setup by configuring through PAG
Less overhead from not loading MCP tools independently for each server
Improved resilience via crash restarts for managed MCP server processes
⚠️ Limitations
Requires routing AI client connections through the local PAG instance
Perforce Agentic Gateway (PAG) is a local MCP gateway providing a token efficient code mode. AI clients are configured once, to connect to PAG and all other MCP servers are instead configured through PAG. Instead of being set up with and loading the tools of each MCP separately, PAG manages the running MCP server processes, restarts them when they crash, and stores their necessary credentials in your OS Keychain.
@latest keeps PAG current on each launch. Add --working-directory <dir> to pin a project. Other clients (Codex, VS Code, ...): see Connecting AI clients. Restart the client; pag__* tools should appear.
Prefer to install once instead of fetching on demand? uv tool install perforce-agentic-gateway puts a perforce-agentic-gateway command on your PATH that you run in place of uvx perforce-agentic-gateway — see Installing PAG as a tool.
2. See what's available
Ask your assistant:
"What MCP servers are in the PAG registry?"
Lists everything installable from configured registries — including Perforce's first-party servers, e.g. P4, BlazeMeter, Perfecto, Delphix, IPLM.
3. Enable a server from the catalog
Perforce product support MCP servers are available straight from the catalog. Ask your assistant to recommend servers for what you're working on:
"What MCP servers would help with this project?"
PAG scans your project for technology signals and suggests catalog servers, always asking before it enables anything. Or name one directly:
"Enable the P4 server."
PAG records it in your config and starts it. Most Perforce servers need credentials (typically a server URL and an access token); when so, the assistant hands you a dashboard link to enter them — secrets never travel through the chat. See Perforce servers and Secrets.
Browse the full catalog any time with uvx perforce-agentic-gateway view. See Using PAG.
4. Or add a custom server
Anything not in a registry — a local command, a container, or a remote HTTP endpoint — you add directly. The MCP fetch server runs via uvx and needs no credentials, so it's a handy zero-setup server to run end to end and see the flow:
"Add a custom server named fetch that runs uvx mcp-server-fetch."
PAG writes it to your config and starts it.
5. Run a real command
"Fetch https://modelcontextprotocol.io and tell me what MCP is."
The assistant calls fetch__fetch through PAG and answers from the live page.
Why it stays fast
text
AI client --one stdio connection--> PAG --> server A (command)
| --> server B (remote HTTP)
+-> server C (container)
PAG doesn't forward every downstream tool to your client (20 servers can mean a thousand tools). It exposes a small, fixed pag__* set and keeps the full catalog inside the gateway:
pag__explore searches the catalog; only the slice the assistant asks for enters its context.
pag__execute runs JavaScript that calls downstream tools, so loops and fan-out across servers take one round trip instead of many.
Full mechanics (the sandbox, qualified tool names, prompts and resources) are in Tools and the sandbox.