MCP Perforce Server

by Cocoon-AI

30 stars
279 downloads
Not rated
GitHub

About

A server for Perforce (P4) version control operations, wrapping P4 commands for easier and more reliable use.

Details

Author
Cocoon-AI
GitHub stars
30
Downloads
279
Categories
Developer Tools, Infrastructure, Other

- Non-interactive operations that avoid interactive prompts.
- Structured, parseable responses instead of raw P4 output.
- Multi-project support via .p4config files.
- File operations: add, edit, delete, revert, sync, diff.
- Changelist management: create and submit changelists.
- Stream operations: list, info, switch, create, edit, graph.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Perforce Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

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.

p4_add

Add files to Perforce

p4_edit

Open files for edit in Perforce

p4_delete

Mark files for deletion in Perforce

p4_revert

Revert files or changelist

p4_sync

Sync files from the depot

p4_diff

Show differences for files

p4_changelist_create

Create a new changelist with a description

p4_changelist_submit

Submit a changelist

p4_move_to_changelist

Move files to a specific changelist

p4_status

Get current P4 workspace status and pending changes

p4_info

Show Perforce configuration info for current directory

mcp_perforce_version

Show MCP Perforce server version

p4_raw_command

FOR DEBUGGING: Executes a raw p4 command and returns stdout/stderr

p4_stream_list

List all streams or streams matching a pattern

p4_stream_info

Get detailed information about a specific stream

p4_stream_switch

Switch workspace to a different stream

p4_stream_create

Create a new stream

p4_stream_edit

Edit stream specification

p4_stream_graph

Show stream hierarchy graph

p4_client_list

List all clients/workspaces for the current user

p4_client_info

Get detailed information about a specific client/workspace

p4_client_create

Create a new client/workspace

p4_client_edit

Edit an existing client/workspace specification

p4_client_delete

Delete a client/workspace

p4_client_switch

Switch to a different client/workspace

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp perforce server": {
            "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"
        }
    }
}

MCP Perforce Server

A Model Context Protocol (MCP) server that provides a clean interface for Perforce (P4) operations in Claude Desktop. This server wraps P4 commands to make them more reliable and easier for Claude to use, eliminating issues with interactive prompts and complex state management.

Features

- Non-interactive operations: All commands are wrapped to avoid interactive prompts
- Structured responses: Clean, parseable output instead of raw P4 output
- Multi-project support: Automatically uses .p4config files for per-project settings
- Common operations: Add, edit, delete, submit, revert, sync, and more
- Changelist management: Create and submit changelists with explicit parameters
- Error handling: Graceful error handling with clear error messages

Installation

Prerequisites

- Node.js 18+ installed
- Perforce command-line client (p4) installed and in your PATH
- .p4config files in your project directories (recommended)

Quick Install with Claude Code

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.