Perforce P4

v2025.1.2830393Version Controlstable

[Community Supported] Perforce P4 MCP Server is a Model Context Protocol (MCP) server that integrates with the Perforce P4 version control system.

mcpmcp-serverp4p4-code-reviewp4-mcp
Share:
92
Stars
0
Downloads
0
Weekly
0/5

What is Perforce P4?

Perforce P4 is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to [community supported] perforce p4 mcp server is a model context protocol (mcp) server that integrates with the perforce p4 version control system.

[Community Supported] Perforce P4 MCP Server is a Model Context Protocol (MCP) server that integrates with the Perforce P4 version control system.

This server falls under the Version Control category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • MCP protocol support

Use Cases

Interact with Perforce P4 version control from Claude.
Manage code reviews using P4 API integration.
Execute P4 commands programmatically for automation.
perforce

Maintainer

LicenseMIT
Languagepython
Versionv2025.1.2830393
UpdatedMay 18, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx p4mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Perforce P4

The Perforce P4 MCP Server integrates Helix Core (Perforce) version control with AI assistants via the Model Context Protocol, enabling natural-language interaction with changelists, code reviews, streams, shelved files, jobs, and workspaces. It exposes separate read and write toolsets covering the full P4 workflow — from querying file history and reviewing diffs to submitting changelists and voting on reviews. Enterprise development teams using Helix Core can leverage AI to navigate large depot structures, summarize code reviews, and automate repetitive P4 operations without memorizing P4 command syntax.

Prerequisites

  • Access to a Perforce Helix Core server (P4PORT address and credentials)
  • P4 client/workspace configured (P4CLIENT recommended)
  • Python 3.11+ (only for source builds; pre-built binaries require no Python)
  • uvx (from the uv package manager) for the simplest install, OR download a pre-built binary
  • An MCP client such as Claude Desktop, VS Code, or Cursor
1

Install uvx and verify

uvx is the recommended way to run p4mcp-server without a permanent install. Install uv (which includes uvx) if you don't have it.

# Install uv (includes uvx)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Verify uvx works
uvx p4mcp-server --version
2

Set P4 environment variables

Configure the standard Perforce environment variables so the server can connect to your Helix Core instance. These can also be set in your MCP client config env block.

export P4PORT=ssl:perforce.example.com:1666
export P4USER=your_username
export P4CLIENT=your_workspace_name
3

Configure your MCP client

Add the P4 MCP server to your MCP client config. The --readonly flag disables all write operations for a safe read-only mode. Remove it only if you need the server to submit changelists or modify files.

{
  "mcpServers": {
    "perforce": {
      "command": "uvx",
      "args": ["p4mcp-server", "--readonly", "--allow-usage"],
      "env": {
        "P4PORT": "ssl:perforce.example.com:1666",
        "P4USER": "your_username",
        "P4CLIENT": "your_workspace_name"
      }
    }
  }
}
4

Authenticate with Helix Core

Run p4 login in your terminal to cache credentials before starting the MCP server. The server uses the same P4 trust/ticket mechanism as the p4 command-line client.

p4 login
# Enter your password when prompted
5

Restart your MCP client and test

Restart your MCP client. Ask it to list pending changelists or query your workspace to verify the connection to Helix Core.

Perforce P4 Examples

Client configuration

Claude Desktop config for the Perforce P4 MCP Server in read-only mode using uvx.

{
  "mcpServers": {
    "perforce": {
      "command": "uvx",
      "args": ["p4mcp-server", "--readonly", "--allow-usage"],
      "env": {
        "P4PORT": "ssl:perforce.example.com:1666",
        "P4USER": "your_username",
        "P4CLIENT": "your_workspace_name"
      }
    }
  }
}

Prompts to try

Natural-language Perforce operations you can perform via the P4 MCP Server.

- "List all pending changelists for my user."
- "Show me the diff for changelist 12345."
- "What files were modified in the last 10 submitted changelists to //depot/main/...?"
- "Summarize the open code reviews assigned to me."
- "Show the stream hierarchy for the //depot/main stream."

Troubleshooting Perforce P4

Connection fails with 'Connect to server failed' or SSL errors

Verify P4PORT is correct and reachable: run 'p4 -p ssl:perforce.example.com:1666 info' in a terminal. For SSL trust errors, run 'p4 trust' to accept the server's fingerprint. Set P4MCP_SSL_VERIFY=false temporarily to bypass certificate verification during debugging.

Server starts but returns 'Ticket has expired' on every tool call

Re-authenticate by running 'p4 login' in the terminal before restarting the MCP client. Helix Core tickets expire based on server policy. Some deployments require periodic re-login or SSO token refresh.

'uvx p4mcp-server' is slow on first invocation

uvx downloads the package on first use. Subsequent runs use the local cache. For zero-latency startup, download the pre-built binary from the GitHub Releases page and use its absolute path as the 'command' in your MCP client config instead of uvx.

Frequently Asked Questions about Perforce P4

What is Perforce P4?

Perforce P4 is a Model Context Protocol (MCP) server that [community supported] perforce p4 mcp server is a model context protocol (mcp) server that integrates with the perforce p4 version control system. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Perforce P4?

Follow the installation instructions on the Perforce P4 GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Perforce P4?

Perforce P4 works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Perforce P4 free to use?

Yes, Perforce P4 is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Version Control MCP Servers

Explore all version control servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "p4mcp": { "command": "npx", "args": ["-y", "p4mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Perforce P4?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides