p4mcp-server
v2025.1.2830393Perforce P4 MCP Server is a MCP server that integrates with the Perforce P4 version control system.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
query_server
Get server info and current user information (READ permission)
| Parameter | Type | Description |
|---|---|---|
action * | string | Server query action: server_info returns P4 server metadata and version, current_user returns authenticated user details and permissions |
query_workspaces
Get workspace details, list workspaces, check type and status (READ permission)
| Parameter | Type | Description |
|---|---|---|
action * | string | Workspace query action: list returns all workspaces matching filters, get retrieves specific workspace spec, type identifies workspace category, status shows opened files and sync state |
max_results | integer | Maximum number of results to return |
user | Filter by user - optional for list action | |
workspace_name | Workspace name - required for get, type, status actions |
modify_workspaces
Create/delete workspace, Update workspace specs, and switch active workspace (WRITE permission)
| Parameter | Type | Description |
|---|---|---|
action * | string | Workspace modification action: create makes new workspace, delete removes workspace, update modifies workspace spec, switch changes active workspace |
workspace_name * | string | Workspace name |
workspace_description | Workspace description | |
workspace_line_end | Line ending style (local, unix, win, mac) | |
workspace_options | Workspace options | |
workspace_root | Root path of the workspace | |
workspace_view | View mappings in depot-to-client format |
query_files
Get file content, history, info, diff, annotations, search by name, grep by content (READ permission)
| Parameter | Type | Description |
|---|---|---|
action * | string | File query action, metadata includes extra information like optional attributes and file size |
file_path * | string | Primary file path - required for all actions |
case_insensitive | boolean | Case-insensitive matching for grep action |
diff2 | boolean | Use p4 diff2 for depot-to-depot diff, false for mixed diff |
file2 | Second file path - required for diff action | |
max_results | Maximum number of results to return. Bounds history/search/grep and also caps fstat info/metadata via 'p4 fstat -m N'. Omit for unbounded info/metadata results. | |
pattern | Search or grep pattern - required for search and grep actions | |
ranges | Optional line ranges for the content action only. Each inner list is a [start, end] pair, 1-based inclusive. When set, the response carries a 'chunks' array with one entry per range instead of the who… |
modify_files
Add, edit, move, delete, revert, reconcile, resolve, and sync files (WRITE permission)
| Parameter | Type | Description |
|---|---|---|
action * | string | File modification action |
changelist | string | Changelist ID or 'default' |
file_paths | Full depot or client or local paths | |
force | boolean | Force operation - use with caution |
mode | string | Resolve mode: auto(-am), safe(-as), force(-af), preview(-n), theirs(-at), yours(-ay) |
source_paths | Source paths - required for move action | |
target_paths | Target paths - required for move action |
query_changelists
Get changelist details and list changelists (READ permission)
| Parameter | Type | Description |
|---|---|---|
action * | string | Changelist query action: get retrieves specific changelist details, list returns all changelists matching filters |
changelist_id | Changelist ID - required for get action | |
depot_path | Filter by depot path - for list action | |
max_results | Maximum number of results to return. Bounds the 'list' action and also caps open files for get('default') via 'p4 opened -m N'. Omit for unbounded results. | |
status | Filter by status - for list action | |
user | Filter by user - for list action | |
workspace_name | Filter by workspace - for list action |
modify_changelists
Create/delete changelists, update changelists and organize files/jobs (WRITE permission)
| Parameter | Type | Description |
|---|---|---|
action * | string | Changelist modification action: create makes new changelist, update modifies description, submit commits changes, delete removes changelist, move_files reorganizes files between changelists |
changelist_id | Changelist ID - required for most actions except create | |
description | string | Changelist description - required for create, optional for update |
file_paths | File paths - required for move_files action |
query_shelves
List shelves, get shelve diff and files (READ permission)
| Parameter | Type | Description |
|---|---|---|
action * | string | Shelve query action: list returns all shelved changelists, diff shows shelved file differences, files lists files in shelved changelist |
changelist_id | Changelist ID - required for diff and files actions | |
max_results | integer | Maximum number of results to return |
user | Filter by user - for list action |
modify_shelves
Create/delete, update shelves and unshelve files (WRITE permission)
| Parameter | Type | Description |
|---|---|---|
action * | string | Shelve modification action: shelve stores files to shelf, unshelve restores files from shelf, update modifies shelved files, delete removes shelf, unshelve_to_changelist restores to specific changelis… |
changelist_id * | string | Changelist ID |
file_paths | File paths for shelve/unshelve/update/delete | |
force | boolean | Force operation - use with caution |
target_changelist | string | Target changelist for unshelve operations |
query_jobs
Get jobs from changelist and get job details (READ permission)
| Parameter | Type | Description |
|---|---|---|
action * | string | Job query action: list_jobs returns jobs linked to changelist, get_job retrieves specific job details |
changelist_id | Changelist ID - required for list_jobs action | |
job_id | Job ID - required for get_job action | |
max_results | integer | Maximum number of results to return |
modify_jobs
Link or unlink jobs (WRITE permission)
| Parameter | Type | Description |
|---|---|---|
action * | string | Job modification action: link_job associates job with changelist, unlink_job removes job association |
changelist_id * | string | Changelist ID - required for link_job/unlink_job |
job_id * | string | Job ID - required for link_job/unlink_job |
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'.
| Parameter | Type | Description |
|---|---|---|
action * | string | Review query action: list all reviews, dashboard for current user, get specific review, transitions, files_readby, files, comments, activity |
after | Review ID to seek to for pagination (list action). Reviews up to and including this ID are excluded. | |
after_updated | Return reviews updated on the day before this date/time in seconds since epoch (list action). Mutually exclusive with 'after'. | |
comments_fields | Comma-separated list of fields to return for comments action | |
fields | List of fields to return for list/get actions | |
from_version | Starting version for files action | |
include_transitions | Include allowed state transitions in get action response | |
keywords | Search keyword(s) to filter reviews (list action). Use with keywords_fields. | |
keywords_fields | Fields to search keywords in (list action). Valid: changes, author, participants, hasReviewer, description, updated, projects, state, testStatus, pending, groups, id | |
max_results | integer | Maximum number of results to return |
projects | Filter by project name(s) (list action) | |
result_order | Set to 'updated' to return most recently updated reviews first (list action) | |
review_id | Review ID - required for get, transitions, files_readby, files, comments, activity actions | |
state | Filter by review state(s) (list action). Valid: needsRevision, needsReview, approved, approved:isPending, approved:commit, approved:notPending, rejected, archived | |
to_version | Ending version for files action | |
up_voters | List of up voters for transitions action |
modify_reviews
Create/update/delete reviews (WRITE permission)
| Parameter | Type | Description |
|---|---|---|
action * | string | Review modification action. To delete/obliterate review, use 'obliterate' action which requires approval |
body | Comment body (required for add_comment, reply_comment) | |
change_id | Changelist ID (required for create, append_change, replace_with_change) | |
cleanup | Perform cleanup for approved:commit/committed transitions | |
comment_content | Content lines used to anchor an inline comment to the correct diff position (add_comment). Supply the code line the comment is on plus the four preceding lines, each terminated with a newline characte… | |
comment_file_path | File path for inline comment | |
comment_id | Comment ID (reply_comment, edit_comment, mark_comment_read/unread) | |
comment_left_line | Left diff line number for inline comment | |
comment_right_line | Right diff line number for inline comment | |
comment_version | Review version for comment attachment | |
description | Review description (optional on create) | |
fix_status | Job fix status when transitioning | |
jobs | Associated job IDs for transition | |
max_reviews | integer | Maximum number of inactive reviews to archive (0 = no limit) |
new_author | New author username (update_author) | |
new_description | New review description (update_description) | |
not_updated_since | ISO date (YYYY-MM-DD) threshold for archive_inactive | |
notify | Notification mode | |
participant_group_names | List of participant group names | |
participant_groups_required | List of required participant groups | |
participant_user_names | List of participant usernames | |
participant_users_required | List of required participant usernames | |
required_reviewers | List of required reviewers | |
review_id | Review ID (required for most actions except create, archive_inactive) | |
reviewer_group_names | List of reviewer group names | |
reviewer_groups_required | List of required reviewer groups | |
reviewers | List of reviewers | |
task_state | Task state. add_comment accepts only 'open'|'comment'; edit_comment additionally accepts 'addressed'|'verified' | |
transition | Transition target state | |
version | Review version (optional for vote) | |
vote_value | Vote value |
query_streams
Query streams: list, get spec, children/parent/graph, integration status, workspaces, validate files, check resolve, interchanges (READ permission)
| Parameter | Type | Description |
|---|---|---|
action * | string | Stream query action: 'list' streams, 'get' stream spec, 'children'/'parent'/'graph' of a stream, 'integration_status' (p4 istat), 'get_workspace'/'list_workspaces', 'validate_file'/'validate_submit' a… |
all_streams | boolean | Include virtual streams in 'list' results |
at_change | Changelist number for historical stream spec | |
both_directions | boolean | Show integration status in both directions (-a flag for integration_status) |
changelist | Changelist for validate_submit | |
fields | Fields to return for 'list' (e.g. ['Stream', 'Owner', 'Name', 'Type']) | |
file_paths | File paths for validate_file or interchanges | |
filter | Filter expression string for 'list' (-F flag). Supports &, |, and parentheses. E.g. 'Parent=//Ace/MAIN&(Type=development|Type=release)' | |
force_refresh | boolean | Force istat to assume cache is stale and search for pending integrations (-c flag) |
limit | Max changelists (interchanges) | |
long_output | boolean | Full changelist descriptions (interchanges) |
max_results | Maximum number of results to return. Bounds 'list' and 'list_workspaces' and also caps 'children' via 'p4 streams -m N'. Omit for unbounded results. | |
reverse | boolean | Reverse comparison direction (interchanges) |
stream_name | Stream depot path (e.g. '//depot/main'). Required for most actions. | |
stream_path | Stream path pattern(s) for 'list' (e.g. ['//depot/...']) | |
template | Template workspace for get_workspace | |
unloaded | boolean | Include unloaded streams/workspaces |
user | Filter workspaces by user (list_workspaces) | |
view_without_edit | boolean | View locked stream without opening for edit (-v flag) |
viewmatch | Single depot file path to filter streams whose views contain this path | |
workspace | Workspace name for get_workspace, validate_file, validate_submit |
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)
| Parameter | Type | Description |
|---|---|---|
action * | string | Stream modification action: 'create'/'update'/'delete' a stream, 'edit_spec'/'resolve_spec'/'revert_spec'/'shelve_spec'/'unshelve_spec' for spec editing, 'copy'/'merge'/'integrate'/'populate' for prop… |
alt_roots | Alternate root paths (create_workspace) | |
branch | Branch spec name for integrate/populate (-b flag) | |
changelist | Changelist for edit_spec, shelve_spec, unshelve_spec, or propagation, 'default' not allowed for edit_spec/shelve_spec/unshelve_spec | |
description | Stream or workspace description | |
file_paths | File paths for propagation | |
force | boolean | Force operation |
host | Host restriction (create_workspace) | |
ignored | Ignored paths | |
integrate_around_deleted | boolean | Integrate around deleted revisions (-Di flag) |
max_files | Limit number of files processed (-m flag) | |
name | Short display name for the stream | |
options | Stream options: 'allsubmit/ownersubmit unlocked/locked toparent/notoparent fromparent/nofromparent' | |
output_base | boolean | Show base revision with each scheduled resolve (-Ob flag for merge/integrate) or display list of files created (-o flag for populate) |
parent | Parent stream (required for non-mainline create) | |
parent_stream | Override parent stream for propagation (-P flag) | |
parent_view | Parent view treatment: 'inherit' or 'noinherit' | |
paths | Stream view paths (e.g. ['share ...', 'isolate dir/...']) | |
preview | boolean | Preview only, don't make changes (-n flag) |
quiet | boolean | Suppress informational messages (-q flag) |
remapped | Remapped paths | |
resolve_mode | Resolve mode for resolve_spec: 'auto', 'accept_theirs', 'accept_yours' | |
reverse | boolean | Reverse direction (-r flag) |
root | Workspace root directory (create_workspace) | |
schedule_branch_resolve | boolean | Schedule 'branch resolves' instead of branching new target files automatically (-Rb flag) |
skip_cherry_picked | boolean | Skip cherry-picked revisions already integrated (-Rs flag) |
source_path | Source path for populate | |
stream_name | Stream depot path (e.g. '//depot/main'). Also used as -S flag for propagation. | |
stream_type | Stream type (required for create): mainline, development, sparsedev, release, sparserel, task, virtual | |
target_changelist | Target changelist for unshelve_spec | |
target_path | Target path for populate | |
virtual | boolean | Copy using virtual stream (-v flag, copy only) |
workspace | Workspace name for switch | |
workspace_name | Workspace name to create (create_workspace) |