Perforce P4 MCP Server

A Perforce MCP server for P4: files, changelists, shelves, reviews and streams for the agent, with a flag to disable writes.

  • 126 ★ on the repository
  • Last commit
  • MIT
MCP serverOfficial

Extended access

Why this level

  • Without `--readonly` the agent changes files and changelists in the depot with the rights of the P4 user.
  • The configuration holds P4 credentials, and HTTP mode has no authentication.
All reasons and checks

perforce/p4mcp-server

Install

Manual install

uvx p4mcp-server

Runs the server without installing; add flags such as `--readonly` to the client arguments.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • Without `--readonly` the agent changes files and changelists in the depot with the rights of the P4 user.
  • The configuration holds P4 credentials, and HTTP mode has no authentication.

This is third-party code. Review the repository files before installing.

What it does

Perforce P4 MCP Server connects an AI assistant to the Perforce P4 version control system through FastMCP and direct P4 Python bindings. The agent reads and changes files, changelists, shelves, workspaces, jobs, reviews and streams. P4 Code Review support covers review discovery, voting, state changes, comments and participants. The `--readonly` flag leaves read operations only. Delete and `obliterate` ask for PROCEED or CANCEL confirmation. The `--toolsets` flag narrows the tool set, and a P4 admin restricts tools per group with `mcp.toolset.*` properties. With `P4DAM_API_KEY` set, P4 DAM tools appear: asset search, metadata, tags and projects.

Who it is for. Game developers and studios on Perforce who want to work with changelists and reviews through Claude Code or Cursor.

Good fit when

  • The agent drafts a changelist description from workspace files.
  • Reviews in P4 Code Review are inspected and voted on from a conversation.
  • An admin gives developers read access only and lets reviewers write to reviews.
  • P4 DAM assets are searched by metadata and tags.

Not a fit when

  • The repository is on Git, which has separate GitHub and Git MCP servers.
  • You have no P4 account: a server, a user and a ticket or password are required.
  • Writes to the depot are unwanted and `--readonly` is not set.

Example request

Show my pending P4 changelists and draft a description for the next one from the files under `//depot/game`.

MCP

Transport
stdio, http
Authentication
key is optional

Environment variables

P4PORT required
P4 server address, for example `ssl:perforce.example.com:1666`.
P4USER required
P4 user name.
P4CLIENT
P4 workspace.
P4PASSWD secret
P4 ticket or password when login does not use `.p4tickets`.
P4DAM_API_KEY secret
P4 DAM key; without it P4 DAM tools are not registered.

Limitations

Community support level. Operation was tested with P4 Server 2026.1; earlier versions were not tested. You need P4 server access and a valid ticket or password login. The HTTP transport has no authentication: it listens on `127.0.0.1` by default, and `--host 0.0.0.0` belongs only on a trusted network. Anonymous usage statistics turn on with `--allow-usage`, which appears in README examples: drop it if you do not want statistics.

How to disable. Remove the `perforce-p4-mcp` entry from the MCP client configuration. If you ran a Docker or HTTP server, stop the container and delete the mounted `.p4tickets` ticket.

FAQ

How do I run it without installing?

With `uvx p4mcp-server`. Prebuilt binaries for macOS, Windows and Linux are in the releases for offline environments.

How do I forbid writes?

Add `--readonly` to the arguments. An admin disables writes centrally with `p4 property -a -n mcp.toolsets.write -v false`.

Which variables should I set?

`P4PORT`, `P4USER` and, if needed, `P4CLIENT`. P4 DAM needs `P4DAM_API_KEY`; without it those tools are not registered.

Can tools be restricted per group?

Yes. `mcp.toolset.<name>.enabled`, `.write` and `.tools` properties set access for a P4 group, and `mcp.toolsets.allowed` keeps only the listed toolsets.

How do I connect remotely?

Run the server with `--transport http --host 0.0.0.0 --port 8000` on a trusted machine and point the client at `http://<host>:8000/mcp`. HTTP has no authentication.

Discussion

No questions or reviews yet.

MCP server for a pfSense firewall via its REST API: 332 tools, confirmation for risky actions and a revision to roll back to

MCP serverBroad access121Repository stars

A community MCP server for Azure DevOps work items, code and builds, with PAT authentication for on-premises Azure DevOps Server

MCP serverBroad access400Repository stars

MCPM

mcpm

A package manager and registry for MCP on all platforms and clients: finds, adds and configures MCP servers, remembers the source and updates

CLIExtended access1KRepository stars
Editors’ pick

GitHub's official MCP server: code, issues, pull requests, Actions and security alerts straight from the agent

MCP serverBroad access34.4KRepository stars

MCP server giving an agent a PowerShell 7 console shared with the user: commands appear live, passwords and MFA codes stay manual.

MCP serverBroad access110Repository stars
Official

Puter's hosted MCP server gives agents files, puter.site websites, workers and key-value storage from a cloud account.

MCP serverExtended access44.2KRepository stars

README in short

The server runs over stdio, HTTP and in Docker. Client configuration is described for Claude Code, Cursor and others, and P4-side permissions apply on top of client flags and override them.

README badge

Report a problem