P4mcp Server MCP Server

<strong>Perforce P4 MCP Server is a Model Context Protocol (MCP) server that integrates with the Perforce P4 version control system. It is built on

Local serverstdioPython

What is the P4mcp Server MCP server?

Perforce P4 MCP Server is a Model Context Protocol (MCP) server that integrates with the Perforce P4 version control system. It is built on FastMCP with direct P4 Python bindings to expose safe, structured read/write tools for. That is what the p4mcp server mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

  • Comprehensive P4 integration — Read/write tools across files, changelists, shelves, workspaces, jobs, reviews, streams, and server information
  • Code review workflows — P4 Code Review support for review discovery, voting, state transitions, commenting, and participant management
  • Safety first — Read-only mode by default, ownership checks, interactive MCP elicitation (PROCEED/CANCEL) for destructive delete and obliterate operations
  • Flexible toolsets — Configure which tool categories to enable: server, files, changelists, shelves, workspaces, jobs, reviews, and streams
  • Robust logging — Application and session logging to the logs/ directory
  • Optional telemetry — Consent-gated usage statistics. Disabled by default

Getting it running

p4mcp-server on PyPI is all you need. Most clients run it directly, so configuration is a few lines and a restart.

The tools it exposes

The server publishes 14 tools. What each one is for:

  • Authentication — Valid P4 login (ticket-based or password)
  • macOSp4-mcp-server-mac.zip
  • Windowsp4-mcp-server-win.zip
  • Linuxp4-mcp-server-linux.zip
  • P4PORT — P4 Server address. Examples: ssl:perforce.example.com:1666, localhost:1666
  • P4USER — Your P4 username
  • P4CLIENT — Your current P4 workspace. Optional, but recommended
  • P4MCP_MAX_RESULTS — Cap on the number of rows the P4 server returns per command (p4.maxresults). Default: 10000. Set to 0 to disable the limit (server default in
  • P4MCP_MAX_SCAN_ROWS — Cap on the number of rows the P4 server scans per command (p4.maxscanrows). Unset by default, so admin/group policy governs scan limits. Can be
  • P4MCP_LOG_DIR — Directory for log files. Default: logs/ in the server executable's directory. Can be overridden by the --log-dir CLI argument
  • P4MCP_TLS_CA_MODE — TLS certificate source mode
  • certifi — disable truststore injection and use default Python TLS certificate behavior. Custom CA bundles (P4MCP_CA_BUNDLE / --ca-bundle) take effect only in

What it needs from you

Configuration is passed through the environment: P4PORT, P4USER, P4CLIENT. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

  • P4 Server access: Connection to a P4 Server with proper credentials - Authentication: Valid P4 login (ticket-based or password)

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch P4mcp Server.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

How it compares

This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. P4mcp Server's toolset — Authentication, macOS, Windows and 11 more — is a fair guide to whether it matches your workflow. It is maintained by perforce; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Available tools

ToolWhat it does
AuthenticationValid P4 login (ticket-based or password)
macOS[p4-mcp-server-mac.zip](https://github.com/perforce/p4mcp-server/releases/latest/download/p4-mcp-server-mac.zip)
Windows[p4-mcp-server-win.zip](https://github.com/perforce/p4mcp-server/releases/latest/download/p4-mcp-server-win.zip)
Linux[p4-mcp-server-linux.zip](https://github.com/perforce/p4mcp-server/releases/latest/download/p4-mcp-server-linux.zip)
P4PORTP4 Server address. Examples: ssl:perforce.example.com:1666, localhost:1666
P4USERYour P4 username
P4CLIENTYour current P4 workspace. Optional, but recommended
P4MCP_MAX_RESULTSCap on the number of rows the P4 server returns per command (p4.maxresults). Default: 10000. Set to 0 to disable the limit (server default in effect). When a command would exceed this limit the server aborts it with an e
P4MCP_MAX_SCAN_ROWSCap on the number of rows the P4 server scans per command (p4.maxscanrows). Unset by default, so admin/group policy governs scan limits. Can be overridden by the --max-scan-rows CLI argument. Must be a non-negative integ
P4MCP_LOG_DIRDirectory for log files. Default: logs/ in the server executable's directory. Can be overridden by the --log-dir CLI argument.
P4MCP_TLS_CA_MODETLS certificate source mode.
certifidisable truststore injection and use default Python TLS certificate behavior. Custom CA bundles (P4MCP_CA_BUNDLE / --ca-bundle) take effect only in this mode.
P4MCP_SSL_VERIFYSet to false to disable SSL verification for P4 Code Review API requests. Default: true. Works in both TLS modes.
P4MCP_CA_BUNDLEPath to a custom CA certificate bundle (PEM) for P4 Code Review API requests. Takes priority over P4MCP_SSL_VERIFY. **Requires P4MCP_TLS_CA_MODE=certifi** to take effect.

How to install the P4mcp Server MCP server

{
  "mcpServers": {
    "perforce-p4-mcp": {
      "command": "/absolute/path/to/p4-mcp-server",
      "env": {
        "P4PORT": "ssl:perforce.example.com:1666",
        "P4USER": "your_username",
        "P4CLIENT": "your_workspace"
      },
      "args": [
        "--readonly", "--allow-usage"
      ]
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • P4 Server access: Connection to a P4 Server with proper credentials - Authentication: Valid P4 login (ticket-based or password)
VariableDescriptionRequired
P4PORTConfiguration value read at startup.Optional
P4USERConfiguration value read at startup.Optional
P4CLIENTConfiguration value read at startup.Optional

Example prompts to try

  • Use P4mcp Server to Authentication.
  • Use P4mcp Server to macOS.
  • Use P4mcp Server to Windows.

Frequently asked questions

It connects P4mcp Server to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (Authentication, macOS, Windows, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with P4mcp Server directly.