# p4mcp-server [Health: Active]

**Category:** 🔄 Version Control  
**Repository:** https://github.com/perforce/p4mcp-server  
**GitHub Stars:** 127  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/p4mcp-server

## Description
Perforce P4 MCP Server is a MCP server that integrates with the Perforce P4 version control system.

## Tools
Capabilities this server exposes over MCP:

- **query_server** — Get server info and current user information (READ permission)
- **query_workspaces** — Get workspace details, list workspaces, check type and status (READ permission)
- **modify_workspaces** — Create/delete workspace, Update workspace specs, and switch active workspace (WRITE permission)
- **query_files** — Get file content, history, info, diff, annotations, search by name, grep by content (READ permission)
- **modify_files** — Add, edit, move, delete, revert, reconcile, resolve, and sync files (WRITE permission)
- **query_changelists** — Get changelist details and list changelists (READ permission)
- **modify_changelists** — Create/delete changelists, update changelists and organize files/jobs (WRITE permission)
- **query_shelves** — List shelves, get shelve diff and files (READ permission)
- **modify_shelves** — Create/delete, update shelves and unshelve files (WRITE permission)
- **query_jobs** — Get jobs from changelist and get job details (READ permission)
- **modify_jobs** — Link or unlink jobs (WRITE permission)
- **query_reviews** — Get review details and list reviews (READ permission).
Open review - state is 'approved but pending=true' or 'needsReview' or 'needsRevision'.
Closed review - state is 'approved but pending=false' or 'rejected' or 'archived'.
- **modify_reviews** — Create/update/delete reviews (WRITE permission)
- **query_streams** — Query streams: list, get spec, children/parent/graph, integration status, workspaces, validate files, check resolve, interchanges (READ permission)
- **modify_streams** — Create/update/delete streams, edit/resolve/revert/shelve stream specs, copy/merge/integrate/populate between streams, switch workspace, create stream workspace (WRITE permission)

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "p4mcp-server": {
    "command": "uvx",
    "args": ["p4mcp-server"],
    "env": {
      "P4PORT": "",
      "P4USER": "",
      "P4CLIENT": "",
      "P4CONFIG": ""
    }
  }
}
```

**Requires environment variables:** `P4PORT`, `P4USER`, `P4CLIENT`, `P4CONFIG` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What p4mcp-server does

p4mcp-server connects MCP-compatible AI assistants to a Perforce P4 server. Its tools cover server and user information, workspaces, files, changelists, shelves, jobs, reviews, and streams. Read operations can inspect file content, history, diffs, annotations, changelist data, shelf contents, review states, stream relationships, and integration status.

Write operations support common repository workflows: creating and changing workspaces, editing or reconciling files, managing changelists and shelves, linking jobs, updating reviews, and copying or merging between streams. P4 Code Review workflows include finding reviews, checking their state, and creating, updating, or deleting reviews. P4 DAM access is available through the product's REST API for asset searches, metadata, review management, bundles, tags, and projects.

## How it works

The server is built with FastMCP and communicates with P4 through the P4 Python bindings. It normally runs locally over STDIO, allowing an MCP client to start and manage the process. A Docker image is also available for STDIO deployment, and pre-built binaries are provided for macOS, Windows, and Linux.

P4 access requires a reachable server and valid authentication, using either a ticket-based login or a password. The P4 connection can be supplied with standard connection settings such as the server address, user, and workspace, or through P4CONFIG. For container use with ticket authentication, the P4 tickets file can be mounted into the container.

The server starts in read-only mode by default. Tool categories can be enabled or disabled independently for server metadata, files, changelists, shelves, workspaces, jobs, reviews, streams, and P4 DAM. Destructive delete and obliterate actions use interactive PROCEED/CANCEL elicitation, and ownership checks are part of the safety controls.

## Setup and configuration

The simplest installation uses `uvx`, which downloads and runs the latest package from PyPI:

```bash
uvx p4mcp-server
```

Run it with `--readonly` to explicitly keep write operations disabled, or use `--allow-usage` to enable consented usage statistics. Pre-built archives can be downloaded for supported operating systems when an offline or air-gapped installation is needed. Building from source requires Python 3.11 or later with Tkinter.

A local MCP configuration supplies the executable path and P4 connection values:

```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"
      },
      "args": ["--readonly"]
    }
  }
}
```

Supported platforms include Windows 10 or later, macOS 12 or later, and Linux distributions with glibc 2.34 or newer. Application and session logs are written to the `logs/` directory. Usage telemetry is optional and disabled by default.

## Tools and capabilities

- Query server details and current-user information.
- List, inspect, create, update, delete, and switch P4 workspaces.
- Read file content, history, diffs, annotations, and search results.
- Add, edit, move, delete, revert, reconcile, resolve, and sync files.
- Create and manage changelists, shelves, jobs, and reviews.
- Inspect review states, including open and closed review classifications.
- Explore stream parents, children, graphs, interchanges, and integration status.
- Copy, merge, integrate, populate, resolve, revert, and shelve stream changes.
- Access P4 DAM assets and metadata through the REST API.

_Full upstream README: https://allmcps.com/mcp/p4mcp-server/readme_

