# Perforce Agentic Gateway

Local proxy connecting AI assistants to multiple MCP servers over one connection. It prevents context bloat and manages credentials in your system keychain.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 13
- Author: perforce
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/perforce/perforce-agentic-gateway
- Updated: 2026-09-21
- HTML: https://affpapa.org/en/nevibecode/mcp/perforce-agentic-gateway

## What it does

PAG acts as an intermediary layer between your client and downstream servers. Instead of burdening your assistant with hundreds of tool definitions at once, you configure PAG once over stdio. The gateway controls child processes, restarts crashed instances, and routes secret tokens through an external dashboard to keep them out of chat logs.

Context efficiency relies on a minimal toolset. Rather than exposing every method upfront, the assistant uses `pag__explore` to inspect catalog slices and `pag__execute` to trigger downstream logic via JavaScript. Multi-server loops run in one round trip.

Getting started requires `uv` on your machine. Servers packaged as containers will fail to launch without Docker or Podman.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add perforce-agentic-gateway -- uvx perforce-agentic-gateway
```
uvx runs the command named after the package; if the README names another one, use uvx --from perforce-agentic-gateway <command>

### Codex

**Platform CLI**
```bash
codex mcp add perforce-agentic-gateway -- uvx perforce-agentic-gateway
```
uvx runs the command named after the package; if the README names another one, use uvx --from perforce-agentic-gateway <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "perforce-agentic-gateway": {
            "command": "uvx",
            "args": [
                "perforce-agentic-gateway"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from perforce-agentic-gateway <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "perforce-agentic-gateway": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "perforce-agentic-gateway"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from perforce-agentic-gateway <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add perforce-agentic-gateway uvx perforce-agentic-gateway
```
uvx runs the command named after the package; if the README names another one, use uvx --from perforce-agentic-gateway <command>

## When to use it
- prevent context saturation caused by numerous tool definitions
- chain actions across different MCP tools in a single execution
- store authentication credentials outside chat history
- restart crashing downstream server processes automatically

## Example prompts
- Show me all available MCP servers in the PAG registry.
- Enable the P4 server from the catalog.
- Register a custom server called fetch that runs uvx mcp-server-fetch.

## Similar
- [agentic-ledger](https://affpapa.org/en/nevibecode/mcp/agentic-ledger.md) — MCP server · ★ 7
- [agentic-gateway](https://affpapa.org/en/nevibecode/skills/agentic-gateway.md) — skill · 1000 installs
- [p4mcp-server](https://affpapa.org/en/nevibecode/mcp/p4mcp-server.md) — MCP server · ★ 123
- [greploop](https://affpapa.org/en/nevibecode/skills/greploop.md) — skill · 2700 installs
- [cc-gateway-ai-proxy](https://affpapa.org/en/nevibecode/skills/cc-gateway-ai-proxy.md) — skill · 713 installs
- [check-pr](https://affpapa.org/en/nevibecode/skills/check-pr.md) — skill · 1200 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
