mcp-perforce-server
Provides tools for interacting with the Perforce version control system, enabling management of files, changelists, reviews, streams, labels, jobs, and more via p4 commands.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-perforce-serverShow me my pending changelists"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Perforce Server
mcp-perforce-server is a Model Context Protocol server for Perforce (p4) with safe defaults, structured JSON responses, and both native-style and MCP-optimized workflows.
It is designed for AI assistants and IDE integrations that need Perforce access without relying on brittle shell scripting.
What It Provides
59 MCP tools across repository inspection, file operations, changelists, reviews, jobs, labels, streams, analytics, and compliance.
Dual transport support: stdio (IDE/CLI) and SSE (HTTP server for web clients).
Safe-by-default runtime behavior:
P4_READONLY_MODE=trueP4_DISABLE_DELETE=true
Batch-capable inputs for the tool surface where native
p4supports multi-target usage.MCP-specific composite helpers that reduce round trips for common review and search workflows.
Structured responses with
ok,result, optionalerror, optionalwarnings, andconfigUsed.MCP clients see underscore-safe tool names, for example
p4_changes.Incoming calls also accept the historical dotted names, for example
p4.changes.
Related MCP server: Bitbucket Server MCP
Highlighted Workflows
The server includes higher-level helpers on top of raw p4 commands.
p4.review.bundle: pending review changelists with optional details and reviewersp4.change.inspect:describe+fixes+reviews+ optional diff + optional file historyp4.path.synccheck: drift and sync-state analysis between two depot pathsp4.file.inspect: per-file metadata, history, optional content, and optional blamep4.workspace.snapshot: workspace info, status, optional config, opened files, and recent changesp4.search.inspect: grouped search results with optional file metadata and content previewsp4.review.prepare: explicit or discovered changelists prepared into review-ready bundles
Install
npm install -g mcp-perforce-serverRequirements:
Node.js 18+
Perforce CLI available as
p4orp4.exeValid Perforce environment via
.p4configor MCPenv
Quick Start
Install the Perforce CLI and ensure
p4is onPATH.Configure Perforce credentials in
.p4configor via MCPenv.Add the server to your MCP client.
Start in the default safe profile before enabling any write-capable tools.
Example .p4config:
P4PORT=ssl:perforce.example.com:1666
P4USER=your-username
P4CLIENT=your-workspace-name
P4PASSWD=your-password-or-ticketExample MCP config using the globally installed server:
{
"mcpServers": {
"perforce": {
"command": "mcp-perforce-server"
}
}
}Example MCP config with explicit credentials:
{
"mcpServers": {
"perforce": {
"command": "mcp-perforce-server",
"env": {
"P4PORT": "ssl:perforce.example.com:1666",
"P4USER": "your-username",
"P4CLIENT": "your-workspace-name",
"P4PASSWD": "your-password-or-ticket",
"P4_READONLY_MODE": "true",
"P4_DISABLE_DELETE": "true"
}
}
}
}Windows local-repo example:
{
"mcpServers": {
"perforce": {
"command": "node",
"args": ["C:\\Tools\\git-projects\\mcp-perforce-server\\dist\\server.js"]
}
}
}Transport Modes
The server supports two transport modes:
Stdio Transport (Default)
Standard input/output transport for IDE and CLI integration. Each MCP client spawns its own server process.
Best for:
VS Code, Cursor, Claude Desktop integration
CLI tools and local automation
Single-user workflows
Process-isolated security model
# Default mode (no flag needed)
mcp-perforce-serverSSE Transport (HTTP Server)
Server-Sent Events transport runs an HTTP server for web-based clients.
Best for:
Web dashboards and analytics UIs
Team collaboration tools
Centralized deployments
Multi-user environments
API integrations
# Start SSE server
mcp-perforce-server --transport=sse
# With custom configuration
MCP_SSE_PORT=8080 MCP_SSE_ENABLE_AUTH=true mcp-perforce-server --transport=sseSSE Configuration:
Variable | Default | Description |
|
| HTTP server port |
|
| Server bind address |
|
| SSE endpoint path |
|
| CORS allowed origins |
|
| Enable token authentication |
| (empty) | Bearer token for auth |
SSE Endpoints:
Main:
GET http://localhost:3000/mcpHealth:
GET http://localhost:3000/healthPost:
POST http://localhost:3000/mcp
Production SSE Example:
export MCP_SSE_ENABLE_AUTH=true
export MCP_SSE_AUTH_TOKEN="your-secret-token"
export MCP_SSE_CORS_ORIGIN="https://your-dashboard.com"
export P4_READONLY_MODE=true
mcp-perforce-server --transport=sse📘 For complete SSE deployment guide, see SSE_SETUP_GUIDE.md
Quick references:
MCP Configuration Examples - Quick config snippets
SSE Setup Guide - Comprehensive deployment guide with Docker, Kubernetes, and production examples
Safety Model
The default runtime profile is conservative.
Setting | Default | Effect |
|
| Blocks write-capable tools. |
|
| Blocks |
Write-capable tools include:
p4.add,p4.edit,p4.delete,p4.revert,p4.syncp4.changelist.create,p4.changelist.update,p4.changelist.submit,p4.submitp4.resolve,p4.shelve,p4.unshelvep4.copy,p4.move,p4.integrate,p4.merge
Tool Surface
Major categories:
Repository and workspace inspection
File operations and diffing
Changelists and submissions
Merge, shelving, and resolve flows
Search and discovery
Review and workflow composites
Users, clients, streams, labels, jobs, and fixes
Compliance, audit, and operational diagnostics
Notable native parity improvements:
Batch-style inputs for commands such as
sync,opened,filelog,annotate,grep,files,dirs,print,fstat,sizes,have,users,streams,jobs, andfixesExpanded native flag coverage for tools such as
sync,interchanges,fstat,files,dirs,streams,clients,labels,jobs, andsizesSupport for both workspace-facing and depot-to-depot diffing via
p4.diffandp4.diff2
Configuration
Most installations only need a small set of variables.
Variable | Default | Purpose |
|
| Keep the server read-only by default. |
|
| Prevent delete operations unless explicitly enabled. |
|
| Config file name used during upward discovery. |
|
| Custom path to the Perforce CLI. |
|
| Preset: |
|
| Max concurrent subcalls for composite tools. |
|
| Enable read-response caching. |
| unset | Per-tool cache TTL overrides. |
|
| Server log level. |
Perforce connection variables:
P4PORTP4USERP4CLIENTP4PASSWDP4CHARSETP4COMMANDCHARSETP4LANGUAGE
For full configuration tables and examples, see:
Development
npm install
npm run build
npm test
npm run test:integrationCurrent verification baseline:
npm run buildnpm testnpm run test:integration
Documentation
SSE Transport Setup: SSE_SETUP_GUIDE.md - Complete guide for HTTP/web deployments
Tool catalog and descriptions: AGENTS.md
Docs index: docs/README.md
Perforce setup: PERFORCE_SETUP.md
MCP client config examples: MCP_CONFIG_EXAMPLES.md
Publishing workflow: PUBLISHING.md
Release notes draft: RELEASE_NOTES.md
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/iPraBhu/mcp-perforce-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server