Lets an AI client read and manage Perforce P4 changelists, files, shelves, workspaces, jobs, reviews, and DAM assets.
Also known as perforce/p4mcp-server
- Stars
- 127
- Tools
- 106
- Downloads, 30 days
- —
- Latest version
- 2025.1.2830393
- Last commit
- Nov 2, 2026
- License
- MIT
What is Perforce P4 MCP?
Perforce P4 lets an AI client read and manage Perforce P4 changelists, files, shelves, workspaces, jobs, reviews, and DAM assets. It exposes 106 tools, such as server_info, current_user, list.
Summary generated from the project's README
About Perforce P4 MCP server
Managing version control and digital asset management directly through an AI assistant is possible with p4mcp-server. This tool integrates with the Perforce P4 system to provide structured read and write capabilities for files, changelists, shelves, workspaces, jobs, and streams. It also connects to P4 DAM via its REST API, allowing users to search for assets, manage metadata, and create asset bundles.
Developers can deploy this server locally using STDIO or via Docker on macOS and Linux. It is also available as an HTTP-based service for remote connections. The server requires valid Perforce credentials, such as a P4 ticket or password, and a P4DAM_API_KEY for asset management. To ensure safety, the server operates in a read-only mode by default and requires interactive confirmation for destructive operations like delete or obliterate.
Users can run the server easily using uvx or by downloading pre-built binaries for Windows, macOS, and Linux. The toolset is highly configurable, allowing you to enable or disable specific categories like reviews, streams, or server metadata depending on your workflow needs.
What you can do with it
- 1Manage version control workflowsAn AI can handle tasks involving changelists, shelves, and workspaces within Perforce.
- 2Facilitate code reviewsDevelopers can use the assistant to manage the entire code review lifecycle including voting and commenting.
- 3Organize digital assetsUsers can interact with P4 DAM to search for assets and update their tags.
- 4Execute safe file operationsThe server prevents accidental data loss by requiring confirmation for dangerous commands.
Written from the project's README. Every use case is checked against a quote from it.
Perforce P4 MCP tools 106
Detected from the READMEserver_infocurrent_userlistgettypestatuscontenthistoryinfometadatadiffannotations
| server_info | — | |
| current_user | — | |
| list | — | |
| get | — | |
| type | — | |
| status | — | |
| content | — | |
| history | — | |
| info | — | |
| metadata | — | |
| diff | — | |
| annotations | — |
Show all 106 toolsShow fewer tools
searchgreprangesfileslist_jobsget_jobdashboardtransitionsfiles_readbyactivitycommentsreview_idreview_fieldscomments_fieldsup_votersmax_resultschildrenparentgraphintegration_statusget_workspacelist_workspacesvalidate_filevalidate_submitcheck_resolveinterchangesstream_namestream_pathfilterfieldsworkspacefile_pathsview_without_editat_changeboth_directionsforce_refreshcreaterefresh_projectsvotetransitionappend_participantsreplace_participantsdelete_participantsadd_commentreply_commentedit_commentappend_changereplace_with_changejoinleavearchive_inactiveupdate_authorupdate_descriptionobliteratechange_iddescriptionreviewer_groupsvote_valueversionbodytask_statenotifycomment_idcontextupdatedeleteedit_specresolve_specrevert_specshelve_specunshelve_speccopymergeintegratepopulateswitchcreate_workspacestream_typeoptionsparent_viewchangelistresolve_modeparent_streambranchpreviewforcereversemax_filesquietoutput_basevirtualschedule_branch_resolveintegrate_around_deletedskip_cherry_picked
| search | — | |
| grep | — | |
| ranges | — | |
| files | — | |
| list_jobs | — | |
| get_job | — | |
| dashboard | — | |
| transitions | — | |
| files_readby | — | |
| activity | — | |
| comments | — | |
| review_id | — | |
| review_fields | — | |
| comments_fields | — | |
| up_voters | — | |
| max_results | — | |
| children | — | |
| parent | — | |
| graph | — | |
| integration_status | — | |
| get_workspace | — | |
| list_workspaces | — | |
| validate_file | — | |
| validate_submit | — | |
| check_resolve | — | |
| interchanges | — | |
| stream_name | — | |
| stream_path | — | |
| filter | — | |
| fields | — | |
| workspace | — | |
| file_paths | — | |
| view_without_edit | — | |
| at_change | — | |
| both_directions | — | |
| force_refresh | — | |
| create | — | |
| refresh_projects | — | |
| vote | — | |
| transition | — | |
| append_participants | — | |
| replace_participants | — | |
| delete_participants | — | |
| add_comment | — | |
| reply_comment | — | |
| edit_comment | — | |
| append_change | — | |
| replace_with_change | — | |
| join | — | |
| leave | — | |
| archive_inactive | — | |
| update_author | — | |
| update_description | — | |
| obliterate | — | |
| change_id | — | |
| description | — | |
| reviewer_groups | — | |
| vote_value | — | |
| version | — | |
| body | — | |
| task_state | — | |
| notify | — | |
| comment_id | — | |
| context | — | |
| update | — | |
| delete | — | |
| edit_spec | — | |
| resolve_spec | — | |
| revert_spec | — | |
| shelve_spec | — | |
| unshelve_spec | — | |
| copy | — | |
| merge | — | |
| integrate | — | |
| populate | — | |
| switch | — | |
| create_workspace | — | |
| stream_type | — | |
| options | — | |
| parent_view | — | |
| changelist | — | |
| resolve_mode | — | |
| parent_stream | — | |
| branch | — | |
| preview | — | |
| force | — | |
| reverse | — | |
| max_files | — | |
| quiet | — | |
| output_base | — | |
| virtual | — | |
| schedule_branch_resolve | — | |
| integrate_around_deleted | — | |
| skip_cherry_picked | — |
Configuration
P4DAM_API_KEY
| Name | Description | |
|---|---|---|
| P4DAM_API_KEY | — |
Automated checks
Ran Nov 12, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachablePass
- Open source license (OSI)Pass
- Commit or release in the last yearPass
- Package name not close to a popular packageNot checked
- Remote endpoint uses HTTPSNot checked
- Destructive tools are labelledNot checked
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesNot checked
README
View on GitHubFeatures
- Comprehensive P4 integration: Read/write tools across files, changelists, shelves, workspaces, jobs, reviews, streams, and server information.
- Code review workflows: P4 Code Review support for review discovery, voting, state transitions, commenting, and participant management.
- P4 DAM integration: Access P4 DAM assets and metadata through MCP-compatible AI assistants. Search for assets, retrieve metadata, manage reviews, create asset bundles, update asset tags, and browse projects. To learn more, see Configure P4 DAM access for P4 MCP Server in the P4 DAM documentation.
- Safety first: Read-only mode by default, ownership checks, interactive MCP elicitation (PROCEED/CANCEL) for destructive delete and obliterate operations.
- Flexible toolsets: Configure which tool categories to enable: server, files, changelists, shelves, workspaces, jobs, reviews, streams, and p4dam.
- Robust logging: Application and session logging to the
logs/directory. - Optional telemetry: Consent-gated usage statistics. Disabled by default.
- Cross platform: Supported on macOS, Linux and Windows with pre-built binaries.
Prerequisites
- P4 Server access: Connection to a P4 Server with proper credentials
- Authentication: Valid P4 login (ticket-based or password)
System Requirements
| 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) |
Local P4 MCP Server Installation
If you have uv installed, you can run P4 MCP Server directly without any manual installation:
# Run the server
uvx p4mcp-server
# Check version
uvx p4mcp-server --version
# Run with arguments
uvx p4mcp-server --readonly --allow-usage
This automatically fetches and runs the latest version from PyPI. No Python virtual environment setup or dependency management needed.
Requirements:
- uv installed on your system
- Python 3.11+ (uv will handle this automatically)
Download the appropriate binary for your operating system:
- macOS: p4-mcp-server-mac.zip
- Windows: p4-mcp-server-win.zip
- Linux: p4-mcp-server-linux.zip
Extract and use the executable directly. No Python installation is required.
# macOS / Linux
unzip p4-mcp-server-mac.zip # or p4-mcp-server-linux.zip
./p4-mcp-server --help
# Windows
Expand-Archive p4-mcp-server-win.zip -DestinationPath .
.\p4-mcp-server.exe --help
Requirements:
- Python 3.11+ (with Tkinter)
Build:
- macOS: chmod +x build.sh && ./build.sh package
- Linux: chmod +x build.sh && ./build.sh package
- Windows: build.bat package
Output:
- macOS & Linux: p4-mcp-server-<version>.tgz
- Windows: p4-mcp-server-<version>.zip
Deployment
STDIO-based deployment
Run the P4 MCP Server directly on your machine using the default STDIO transport.
Add the following to your mcp.json:
{
"mcpServers": {
"perforce-p4-mcp": {
"command": "/absolute/path/to/p4-mcp-server",
"env": {
"P4PORT": "ssl:perforce.example.com:1666",
"P4USER": "your_username",
"P4CLIENT": "your_workspace",
"P4DAM_API_KEY": "your_api_key"
},
"args": [
"--readonly", "--allow-usage"
]
}
}
}
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
- Docker installed and running
- Valid P4 credentials and access to a P4 server
Pull the Docker image
docker pull ghcr.io/perforce/p4mcp-server:latest
cd /path/to/p4mcp-server
docker build -t ghcr.io/perforce/p4mcp-server .
Configure MCP Client
Add the following to your mcp.json:
{
"servers": {
"perforce-p4mcp-docker": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"--hostname", "your-hostname",
"-e", "P4PORT=ssl:perforce.example.com:1666",
"-e", "P4USER=your_username",
"-e", "P4CLIENT=your_workspace",
"-e", "P4DAM_API_KEY=your_api_key",
"-v", "/Users/your_username/.p4tickets:/home/mcpuser/.p4tickets:ro",
"ghcr.io/perforce/p4mcp-server:latest"
]
}
}
}
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:
# macOS/Linux
-v /Users/your_username/.p4tickets:/home/mcpuser/.p4tickets:ro
Note: Use the full path to your tickets file (not
~). After runningp4 login, restart the MCP server to pick up the new ticket.
Note: By default the container starts as root, copies the bind-mounted tickets file to a location readable by the non-root
mcpuser, then drops privileges (viagosu) so the server runs asmcpuser. This auto-copy lets an owner-only (0600) tickets file owned by a foreign uid work on runtimes that preserve host ownership (native Linux Docker/podman). A:robind mount of the ticket is supported — the file is copied, not modified in place (this is distinct from a read-only container root filesystem; see below). Note the auto-copy runs only when the container starts as root (the default); forcing a non-root uid or a read-only root filesystem changes this behavior, as described below.
Kubernetes / restricted (non-root-enforced) profiles: the image intentionally starts as root and drops to
mcpuser(uid 1000) viagosu, so the server always runs non-root — both paths are supported. ForrunAsNonRoot/ restricted PodSecurity / OpenShift restricted SCC, setsecurityContext.runAsUser: 1000(andfsGroup: 1000when mounting the ticket). In that mode the entrypoint's root-only ticket copy is skipped, so the mounted ticket must already be readable by uid 1000 (owner-matched mount,-e P4PASSWD="your_ticket_content", orpodman -v <host>:/home/mcpuser/.p4tickets:U).
Read-only root filesystem (
--read-only/readOnlyRootFilesystem): provide a writable/tmpfs/home/mcpuser(e.g.--tmpfs /home/mcpuser) so the ticket copy can be written; otherwise the ticket copy fails and P4 will report a normal auth error.
Using a password:
-e P4PASSWD="your_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:
--hostname your-hostname
To find your workspace host name:
# macOS/Linux
p4 client -o your_workspace | grep "^Host:"
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:
-v /path/to/your/client/root:/path/to/your/client/root
Example configuration with client root mounted:
{
"servers": {
"perforce-p4mcp-docker": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"--hostname", "your-hostname",
"-e", "P4PORT=ssl:perforce.example.com:1666",
"-e", "P4USER=your_username",
"-e", "P4CLIENT=your_workspace",
"-e", "P4DAM_API_KEY=your_api_key",
"-v", "/Users/your_username/.p4tickets:/home/mcpuser/.p4tickets",
"-v", "/path/to/client/root:/path/to/client/root",
"ghcr.io/perforce/p4mcp-server:latest"
]
}
}
}
To find your client root:
p4 client -o your_workspace | grep "^Root:"
Note: The mount path inside the container must match the client root path exactly, as P4 tracks files by their absolute paths.
HTTP-based deployment
Security: HTTP binds to
127.0.0.1(local only) by default. Use--host 0.0.0.0for remote clients. HTTP has no authentication, so expose it only on trusted networks.
Run the MCP server on a VM using the HTTP transport, allowing clients to connect over the network.
Start the server on the VM:
P4PORT=ssl:perforce.example.com:1666 P4USER=your_username P4PASSWD=YOUR_TICKET ./p4-mcp-server --readonly --transport http --host 0.0.0.0 --port 8000
Configure the MCP client:
Add the following to your mcp.json:
{
"servers": {
"perforce-p4-mcp": {
"type": "http",
"url": "http://<ip-or-hostname>:8000/mcp"
}
}
}
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.
Start the container:
docker run --rm -p 8000:8000 \
-e P4PORT=ssl:perforce.example.com:1666 \
-e P4USER=your_username \
-e P4PASSWD=YOUR_TICKET \
-e P4DAM_API_KEY=your_api_key \
ghcr.io/perforce/p4mcp-server:latest \
python3 -m p4mcp.main --readonly --transport http --host 0.0.0.0 --port 8000
Note: In a container,
--host 0.0.0.0is required. To allow only the Docker host, use-p 127.0.0.1:8000:8000.
Configure the MCP client:
Add the following to your mcp.json:
{
"servers": {
"perforce-p4-mcp": {
"type": "http",
"url": "http://<ip-or-hostname>:8000/mcp"
}
}
}
Note: Docker supports HTTP-based deployment as well. The container image defaults to STDIO transport, so the HTTP startup command must explicitly override the default command. If you need write operations, also mount the client root and ticket file paths into the container.
MCP client configuration
Note: In all configuration examples below, if
P4CONFIGis set, you do not need to set any environment variables in theenvblock. The server will use the configuration from the specified P4CONFIG file instead.
Tip: If you have uv installed, you can use
uvx p4mcp-serverinstead of/absolute/path/to/p4-mcp-serverin thecommandfield. This eliminates the need to download or build binaries manually.{ "mcpServers": { "perforce-p4-mcp": { "command": "uvx", "args": [ "p4mcp-server", "--readonly", "--allow-usage" ], "env": { "P4PORT": "ssl:perforce.example.com:1666", "P4USER": "your_username", "P4CLIENT": "your_workspace", "P4DAM_API_KEY": "your_api_key" } } } }{ "mcpServers": { "perforce-p4-mcp": { "command": "/absolute/path/to/p4-mcp-server", "env": { }, "args": [ "--readonly", "--allow-usage" ] } } }
See the JetBrains AI Assistant VCS Integration documentation for detailed configuration steps.
See the Claude Code MCP docs for more information.
Using uvx (no installation required):
{
"mcpServers": {
"perforce-p4-mcp": {
"command": "uvx",
"args": [
"p4mcp-server",
"--readonly", "--allow-usage"
],
"env": {
"P4PORT": "ssl:perforce.example.com:1666",
"P4USER": "your_username",
"P4CLIENT": "your_workspace",
"P4DAM_API_KEY": "your_api_key"
}
}
}
}
Using pre-built binary:
{
"mcpServers": {
"perforce-p4-mcp": {
"command": "/absolute/path/to/p4-mcp-server",
"env": {
"P4PORT": "ssl:perforce.example.com:1666",
"P4USER": "your_username",
"P4CLIENT": "your_workspace",
"P4DAM_API_KEY": "your_api_key"
},
"args": [
"--readonly", "--allow-usage"
]
}
}
}
See the Cursor MCP documentation for more information.
{
"mcpServers": {
"perforce-p4-mcp": {
"command": "/absolute/path/to/p4-mcp-server",
"env": {
"P4PORT": "ssl:perforce.example.com:1666",
"P4USER": "your_username",
"P4CLIENT": "your_workspace",
"P4DAM_API_KEY": "your_api_key"
},
"args": [
"--readonly", "--allow-usage"
]
}
}
}
See the Eclipse MCP documentation for more information.
{
"servers": {
"perforce-p4-mcp": {
"command": "/absolute/path/to/p4-mcp-server",
"env": {
"P4PORT": "ssl:perforce.example.com:1666",
"P4USER": "your_username",
"P4CLIENT": "your_workspace",
"P4DAM_API_KEY": "your_api_key"
},
"args": [
"--readonly", "--allow-usage"
]
}
}
}
See the Kiro MCP documentation for more information.
{
"mcpServers": {
"perforce-p4-mcp": {
"command": "/absolute/path/to/p4-mcp-server",
"env": {
"P4PORT": "ssl:perforce.example.com:1666",
"P4USER": "your_username",
"P4CLIENT": "your_workspace",
"P4DAM_API_KEY": "your_api_key"
},
"args": [
"--readonly", "--allow-usage"
]
}
}
}
See the VS Code documentation for more information.
{
"servers": {
"perforce-p4-mcp": {
"command": "/absolute/path/to/p4-mcp-server",
"env": {
"P4PORT": "ssl:perforce.example.com:1666",
"P4USER": "your_username",
"P4CLIENT": "your_workspace",
"P4DAM_API_KEY": "your_api_key"
},
"args": [
"--readonly", "--allow-usage"
]
}
}
}
See the Windsurf MCP documentation for more information.
{
"mcpServers": {
"perforce-p4-mcp": {
"command": "/absolute/path/to/p4-mcp-server",
"env": {
"P4PORT": "ssl:perforce.example.com:1666",
"P4USER": "your_username",
"P4CLIENT": "your_workspace",
"P4DAM_API_KEY": "your_api_key"
},
"args": [
"--readonly", "--allow-usage"
]
}
}
}
P4 Environment Variables
P4PORT- P4 Server address. Examples:ssl:perforce.example.com:1666,localhost:1666P4USER- Your P4 usernameP4CLIENT- Your current P4 workspace. Optional, but recommended
Result limit environment variables
P4MCP_MAX_RESULTS- Cap on the number of rows the P4 server returns per command (p4.maxresults). Default:10000. Set to0to disable the limit (server default in effect). When a command would exceed this limit the server aborts it with an error rather than truncating results, so keep the value generous. Can be overridden by the--max-resultsCLI argument. Must be a non-negative integer; an invalid value fails fast at startup before any P4 connection is attempted.P4MCP_MAX_SCAN_ROWS- Cap on the number of rows the P4 server scans per command (p4.maxscanrows). Unset by default, so admin/group policy governs scan limits. Can be overridden by the--max-scan-rowsCLI argument. Must be a non-negative integer when supplied.
Logging environment variables
P4MCP_LOG_DIR- Directory for log files. Default:logs/in the server executable's directory. Can be overridden by the--log-dirCLI argument.
SSL/TLS environment variables
P4MCP_TLS_CA_MODE- TLS certificate source mode.system(default): use OS trust store viatruststore. Note: In this mode,truststoreoverrides theverify=parameter — custom CA bundles set viaP4MCP_CA_BUNDLEor--ca-bundleare ignored. To use a custom CA bundle, setP4MCP_TLS_CA_MODE=certifi.certifi: disabletruststoreinjection and use default Python TLS certificate behavior. Custom CA bundles (P4MCP_CA_BUNDLE/--ca-bundle) take effect only in this mode.
P4MCP_SSL_VERIFY- Set tofalseto disable SSL verification for P4 Code Review API requests. Default:true. Works in both TLS modes.P4MCP_CA_BUNDLE- Path to a custom CA certificate bundle (PEM) for P4 Code Review API requests. Takes priority overP4MCP_SSL_VERIFY. RequiresP4MCP_TLS_CA_MODE=certifito take effect.
Telemetry environment variables
OTEL_EXPORTER_OTLP_ENDPOINT- OTLP collector endpoint for telemetry export. Default:https://grpc.public.prd.shared.perforce.com.OTEL_EXPORTER_OTLP_PROTOCOL- OTLP export protocol. Onlygrpcis supported; other values fall back togrpcwith a warning.
P4 DAM environment variables
P4DAM_API_KEY- P4 DAM API key. Sent asAuthorization: account_key='<key>'with all P4 DAM API requests. Requires an active P4 DAM session. When unset, P4 DAM tools are not registered. The toolset is silently skipped at startup.
P4 DAM URL discovery: The P4 DAM base URL is read from the
P4.HTH.URLP4 property on the server. If the property is unset, P4 DAM tool calls fail at runtime.SSL for P4 DAM: P4 DAM API requests use the same SSL configurations as Swarm —
P4MCP_TLS_CA_MODE,--ca-bundle/P4MCP_CA_BUNDLE, and--ssl-no-verify/P4MCP_SSL_VERIFY.
Perforce P4 MCP questions
What tools does Perforce P4 MCP provide?
It exposes 106 tools, including server_info, current_user, list, get, type.
Does the Perforce P4 MCP server support read-only mode?
Yes. The server runs in read-only mode by default, and destructive operations require confirmation.
How does the P4 MCP server authenticate to Perforce?
It uses a valid P4 login via ticket-based authentication or a password.
Which transports does the Perforce P4 MCP server support?
It supports STDIO transport locally or in Docker, and HTTP transport for VM deployments.
Can I choose which tool categories the P4 MCP server exposes?
Yes. You can configure which tool categories such as server, files, changelists, shelves, workspaces, jobs, reviews, streams, and p4dam are enabled.
Does the P4 MCP server collect usage data?
It has optional telemetry that is consent-gated and disabled by default.