Perforce P4

Provides a safe, structured MCP interface to Perforce P4 enabling read and write operations for changelists, files, shelves, workspaces, jobs, reviews, and server metadata.
  • javascript

46

GitHub Stars

javascript

Language

4 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "perforce-p4mcp-server": {
      "command": "/absolute/path/to/p4-mcp-server",
      "args": [
        "--readonly",
        "--allow-usage"
      ],
      "env": {
        "P4PORT": "ssl:perforce.example.com:1666",
        "P4USER": "your_username",
        "P4CLIENT": "your_workspace"
      }
    }
  }
}

You can use the Perforce P4 MCP Server to expose safe, structured read and write operations for Perforce P4 data within a Model Context Protocol environment. It connects to your P4 server, presents read/write capabilities for changelists, files, shelves, workspaces, jobs, reviews, and server metadata, and supports optional telemetry and robust logging for observability.

How to use

To use the P4 MCP Server, first ensure you have a reachable Perforce P4 server and valid credentials. Start the MCP server with read-only mode by default for safety, and enable specific tool categories as needed. Connect your MCP client to the local server using the configured command and environment variables. You can perform read operations to discover workspaces, changelists, files, shelves, and reviews, and you can perform write operations only when you configure the server for write access and have the necessary permissions.

How to install

Follow these steps to install the P4 MCP Server from the provided binaries or build from source.

# Windows (pre-built binary)
unzip p4-mcp-server-2025.2.0.zip
cd p4-mcp-server-2025.2.0
./p4-mcp-server.exe --help

# macOS (pre-built binary)
tar -xzf p4-mcp-server-2025.2.0.tgz
cd p4-mcp-server-2025.2.0
./p4-mcp-server --help

# Build from source (requires Python 3.11+ with Tkinter)
# macOS/Linux
chmod +x build.sh && ./build.sh package
# Windows
build.bat package

# After building, use the produced package as your server binary

Additional configurations and notes

The server supports a set of environment variables and command-line arguments to control behavior. The recommended default is read-only mode with usage statistics disabled unless you explicitly enable them.

Available tools

query_server

Read server information and current user details including version, uptime, and permissions.

query_workspaces

Retrieve workspace information, list workspaces, inspect a specific workspace, and check its status.

query_changelists

Access changelist details, including files, descriptions, and related jobs.

query_files

Fetch file content, history, metadata, diffs, and annotations for blame analysis.

query_shelves

Inspect shelved changelists, view differences, and list shelf contents.

query_jobs

Retrieve job details and statuses linked to changelists.

query_reviews

Discover and inspect code reviews, their comments, participants, and activity.

modify_workspaces

Create, update, delete, or switch workspaces to manage development environments.

modify_changelists

Create, update, submit, delete, or move files within changelists.

modify_files

Add, edit, delete, move, revert, reconcile, resolve, or synchronize files.

modify_shelves

Shelve or unshelve changes, update shelves, and move files between shelves.

modify_jobs

Link or unlink jobs to changelists to track defects and work items.

modify_reviews

Create reviews, manage participants, vote, transition state, and comment.

execute_delete

Execute approved delete operations for resources with proper confirmation.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational