Basic information
About MCP Perforce Server
MCP Perforce Server
MCP Perforce Server is a MCP server in the Other category listed in the AddMCP.net directory, published by Cocoon-AI. It exposes 25 tools, including p4_add, p4_edit, p4_delete, p4_revert and more. Supported transport: stdio. Runtime: node. License: MIT. The repository has 30 GitHub stars. Source code is hosted on github.com.
Setup
{
"mcpServers": {
"perforce": {
"command": "npx",
"args": [
"-y",
"@cocoon-ai/mcp-perforce"
],
"env": {
"P4CONFIG": ".p4config"
}
}
}
}
{
"mcpServers": {
"perforce": {
"command": "npx",
"args": [
"-y",
"@cocoon-ai/mcp-perforce"
],
"env": {
"P4CONFIG": ".p4config"
}
}
}
}
{
"servers": {
"perforce": {
"command": "npx",
"args": [
"-y",
"@cocoon-ai/mcp-perforce"
],
"env": {
"P4CONFIG": ".p4config"
}
}
}
}
MCP Perforce Server config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"perforce": {
"command": "npx",
"args": [
"-y",
"@cocoon-ai/mcp-perforce"
],
"env": {
"P4CONFIG": ".p4config"
}
}
}
}
MCP Perforce Server tools
-
p4_add
— Add files to Perforce
files:array*, path:string -
p4_edit
— Open files for edit in Perforce
files:array*, path:string -
p4_delete
— Mark files for deletion in Perforce
files:array*, path:string -
p4_revert
— Revert files or changelist
files:array, changelist:string, path:string -
p4_sync
— Sync files from the depot
files:array, force:boolean, path:string -
p4_diff
— Show differences for files
files:array*, path:string -
p4_changelist_create
— Create a new changelist with a description
description:string*, path:string -
p4_changelist_submit
— Submit a changelist
changelist:string*, description:string, path:string -
p4_move_to_changelist
— Move files to a specific changelist
files:array*, changelist:string*, path:string -
p4_status
— Get current P4 workspace status and pending changes
path:string -
p4_info
— Show Perforce configuration info for current directory
path:string -
mcp_perforce_version
— Show MCP Perforce server version
(no parameters) -
p4_raw_command
— FOR DEBUGGING: Executes a raw p4 command and returns stdout/stderr
command:string*, path:string -
p4_stream_list
— List all streams or streams matching a pattern
depot:string, filter:string, path:string -
p4_stream_info
— Get detailed information about a specific stream
stream:string*, path:string -
p4_stream_switch
— Switch workspace to a different stream
stream:string*, force:boolean, path:string -
p4_stream_create
— Create a new stream
stream:string*, type:string*, parent:string, description:string*, path:string -
p4_stream_edit
— Edit stream specification
stream:string*, spec:string, path:string -
p4_stream_graph
— Show stream hierarchy graph
depot:string, path:string -
p4_client_list
— List all clients/workspaces for the current user
user:string, path:string -
p4_client_info
— Get detailed information about a specific client/workspace
client:string, path:string -
p4_client_create
— Create a new client/workspace
client:string*, root:string*, stream:string, view:array, description:string, options:array, path:string -
p4_client_edit
— Edit an existing client/workspace specification
client:string*, spec:string, path:string -
p4_client_delete
— Delete a client/workspace
client:string*, force:boolean, path:string -
p4_client_switch
— Switch to a different client/workspace
client:string*, path:string
Overview
What is MCP Perforce Server?
A Model Context Protocol (MCP) server that provides a clean, non-interactive interface for Perforce (P4) operations in Claude Desktop. It wraps P4 commands to eliminate interactive prompts and complex state management, making them more reliable for AI assistants.
How to use MCP Perforce Server?
Install the package globally via npm and add it to Claude Desktop configuration. The server uses .p4config files for automatic per-project Perforce settings. Once configured, you ask Claude to execute commands like p4_status, p4_sync, p4_changelist_create, or p4_stream_switch.
Key features of MCP Perforce Server
- Non-interactive operations that avoid interactive prompts.
- Structured, parseable responses instead of raw P4 output.
- Multi-project support via
.p4configfiles. - File operations: add, edit, delete, revert, sync, diff.
- Changelist management: create and submit changelists.
- Stream operations: list, info, switch, create, edit, graph.
Use cases of MCP Perforce Server
- Letting Claude create changelists and submit changes automatically.
- Syncing workspace and reviewing open files in a single conversation.
- Switching between Perforce servers based on project directory.
- Managing streams and clients without typing raw P4 commands.
Frequently asked questions
1 What are the prerequisites for MCP Perforce Server?
Node.js 18+ and the Perforce command-line client (p4) must be installed and in your PATH. .p4config files in project directories are recommended.
2 How does MCP Perforce Server handle multiple Perforce servers?
It uses Perforce's built-in P4CONFIG mechanism. The server reads .p4config files from the current or parent directories to automatically switch between servers based on your working directory.
3 What should I do if the server doesn't appear in Claude?
Restart Claude Desktop, verify the configuration file is valid JSON, and confirm the package is installed globally with npm list -g @cocoon-ai/mcp-perforce.
4 How can I debug issues with MCP Perforce Server?
Enable debug logging by adding "DEBUG": "mcp:*" to the environment variables in the server configuration. You can also test P4 connectivity with p4 info and p4 login in your terminal.
5 What transports or authentication does MCP Perforce Server support?
The server uses the standard MCP SDK and relies on Perforce's own authentication (e.g., p4 login). It reads credentials and settings from .p4config files or environment variables like P4PORT, P4CLIENT, and P4USER.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In