mcp-perforce-server

by iprabhu

Not rated
GitHub

About

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.

Details

Author
iprabhu
Categories
Developer Tools, Infrastructure

Setup

Install mcp-perforce-server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/iprabhu/mcp-perforce-server

Follow the installation instructions in the repository README, then restart your MCP client.

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.

mcp-perforce-serveris 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.

- 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=true
- P4_DISABLE_DELETE=true

The server includes higher-level helpers on top of rawp4commands.

- p4.review.bundle: pending review changelists with optional details and reviewers
- p4.change.inspect:describe+fixes+reviews+ optional diff + optional file history
- p4.path.synccheck: drift and sync-state analysis between two depot paths
- p4.file.inspect: per-file metadata, history, optional content, and optional blame
- p4.workspace.snapshot: workspace info, status, optional config, opened files, and recent changes
- p4.search.inspect: grouped search results with optional file metadata and content previews
- p4.review.prepare: explicit or discovered changelists prepared into review-ready bundles

- Node.js 18+
- Perforce CLI available asp4orp4.exe
- Valid Perforce environment via.p4configor MCPenv
- Install the Perforce CLI and ensurep4is 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.

P4PORT=ssl:perforce.example.com:1666 P4USER=your-username P4CLIENT=your-workspace-name P4PASSWD=your-password-or-ticket

Example 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" } } } }
{ "mcpServers": { "perforce": { "command": "node", "args": ["C:\\Tools\\git-projects\\mcp-perforce-server\\dist\\server.js"] } } }

The server supports two transport modes:

Standard input/output transport for IDE and CLI integration. Each MCP client spawns its own server process.

- 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-server

Server-Sent Events transport runs an HTTP server for web-based clients.

- 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=sse

- Main:GET http://localhost:3000/mcp
- Health:GET http://localhost:3000/health
- Post:POST http://localhost:3000/mcp

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, seeSSE_SETUP_GUIDE.md

- MCP Configuration Examples- Quick config snippets
-
SSE Setup Guide- Comprehensive deployment guide with Docker, Kubernetes, and production examples

The default runtime profile is conservative.

- p4.add,p4.edit,p4.delete,p4.revert,p4.sync
- p4.changelist.create,p4.changelist.update,p4.changelist.submit,p4.submit
- p4.resolve,p4.shelve,p4.unshelve
- p4.copy,p4.move,p4.integrate,p4.merge

- 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

- Batch-style inputs for commands such assync,opened,filelog,annotate,grep,files,dirs,print,fstat,sizes,have,users,streams,jobs, andfixes
- Expanded native flag coverage for tools such assync,interchanges,fstat,files,dirs,streams,clients,labels,jobs, andsizes
- Support for both workspace-facing and depot-to-depot diffing viap4.diffandp4.diff2

Most installations only need a small set of variables.

- P4PORT
- P4USER
- P4CLIENT
- P4PASSWD
- P4CHARSET
- P4COMMANDCHARSET
- P4LANGUAGE

For full configuration tables and examples, see:

- PERFORCE_SETUP.md
-
MCP_CONFIG_EXAMPLES.md

npm install npm run build npm test npm run test:integration

- npm run build
- npm test
- npm run test:integration

- 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

Interact with GitHub APIs for automation and repository management.

Integrates with GitHub APIs for advanced automation and interaction, supporting both remote and local deployments.

Integrate with GitHub APIs for automation and interaction.

Seamlessly integrate with GitHub APIs for development automation and interaction.

Seamlessly integrate with GitHub APIs for development automation and interaction.

Seamlessly integrate AI assistants with GitLab using the glab CLI tool.

A server for Perforce (P4) version control operations, wrapping P4 commands for easier and more reliable use.

Model Context Protocol (MCP) server for GitLab — exposes 1006 GitLab REST & GraphQL API operations as MCP tools (28 meta-tools / 43 enterprise), 24 resources, 38 prompts, and 17 completion types for AI assistants. Written in Go, single static binary, stdio and HTTP transport.

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

Reverse-engineer architecture from source code (Go, TypeScript, Python) or markdown. 19 tools for architecture graphs, drift detection between git refs, and validation rules.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.