Perforce P4 MCP Server is a MCP server that integrates with the Perforce P4 version control system.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
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 changelists, files, shelves, workspaces, jobs, reviews, and server metadata.
Features Β· Prerequisites Β· System Requirements Β· Install Β· Deployment Β· Client Configurations Β· P4 Configurations Β· Tools
Logging Β· Troubleshoot Β· Support Β· Contributions Β· License
logs/ directory.| Component | Supported Versions |
|---|---|
| Operating Systems | Windows 10+ macOS 12+ Linux (glibc 2.34+, e.g. Ubuntu 22.04+, Rocky Linux 9+) |
| Perforce P4 Server | 2026.1 (earlier versions untested) |
| Python | 3.11+ (required only for building from source) |
If you have uv installed, you can run P4 MCP Server directly without any manual installation:
This automatically fetches and runs the latest version from PyPI. No Python virtual environment setup or dependency management needed.
Requirements:
Download the appropriate binary for your operating system:
Extract and use the executable directly. No Python installation is required.
Requirements:
Build:
chmod +x build.sh && ./build.sh packagechmod +x build.sh && ./build.sh packagebuild.bat packageOutput:
p4-mcp-server-<version>.tgzp4-mcp-server-<version>.zipRun the P4 MCP Server directly on your machine using the default STDIO transport.
Add the following to your mcp.json:
Note: This example shows explicit
envvalues. IfP4CONFIGis set, you can omit them and use the generic configuration example in theMCP client configurationsection instead.
Run the P4 MCP Server from a Docker container with STDIO transport, allowing MCP clients to manage the container lifecycle.
Note: Docker-based execution is currently supported on macOS and Linux only.
Prerequisites
Pull the Docker image
Configure MCP Client
Add the following to your mcp.json:
Configuration Options
| Flag | Description |
|---|---|
-i | Interactive mode (required for STDIO) |
--rm | Remove container when stopped |
--hostname | Match workspace host restriction |
-e P4PORT | P4 server address |
-e P4USER | P4 username |
-e P4CLIENT | Workspace name |
-v | Mount P4 tickets file |
Authentication
Using P4 tickets:
Note: Use the full path to your tickets file (not
~). After runningp4 login, restart the MCP server to pick up the new ticket.
Using a password:
Workspace Host Restrictions
β οΈ Important: Docker containers have their own hostname, which differs from your local machine. If your P4 workspace is restricted to a specific host, operations like
syncwill fail.
To resolve this, set the container hostname to match your workspace's host restriction:
To find your workspace host name:
Mounting Client Root for Write Operations
β οΈ Important: By default, the Docker container cannot access your local workspace files. For write operations like
sync,submit, orreconcile, you must mount your client root directory into the container at the same path.
Add a volume mount for your client root:
Example configuration with client root mounted:
To find your client root:
Note: The mount path inside the container must match the client root path exactly, as P4 tracks files by their absolute paths.
Run the MCP server on a VM using the HTTP transport, allowing clients to connect over the network.
Start the server on the VM:
Configure the MCP client:
Add the following to your mcp.json:
Note: Ensure the VM's firewall allows inbound connections on the chosen port. For production use, consider placing the server behind a reverse proxy with TLS.
Run the MCP server in a Docker container using HTTP transport and expose the MCP endpoint over a host port.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/p4mcp-server)<a href="https://allmcps.com/mcp/p4mcp-server"><img src="https://allmcps.com/api/badge/p4mcp-server?style=directory" alt="P4mcp Server on AllMCPs" /></a>