p4mcp-server

v2025.1.2830393
io.github.hjain-perforce/p4mcp-server Checked 13 hours ago Published 11 months ago

Perforce 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)

ParameterTypeDescription
action *stringServer 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)

ParameterTypeDescription
action *stringWorkspace 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_resultsintegerMaximum number of results to return
userFilter by user - optional for list action
workspace_nameWorkspace name - required for get, type, status actions

modify_workspaces

Create/delete workspace, Update workspace specs, and switch active workspace (WRITE permission)

ParameterTypeDescription
action *stringWorkspace modification action: create makes new workspace, delete removes workspace, update modifies workspace spec, switch changes active workspace
workspace_name *stringWorkspace name
workspace_descriptionWorkspace description
workspace_line_endLine ending style (local, unix, win, mac)
workspace_optionsWorkspace options
workspace_rootRoot path of the workspace
workspace_viewView mappings in depot-to-client format

query_files

Get file content, history, info, diff, annotations, search by name, grep by content (READ permission)

ParameterTypeDescription
action *stringFile query action, metadata includes extra information like optional attributes and file size
file_path *stringPrimary file path - required for all actions
case_insensitivebooleanCase-insensitive matching for grep action
diff2booleanUse p4 diff2 for depot-to-depot diff, false for mixed diff
file2Second file path - required for diff action
max_resultsMaximum 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.
patternSearch or grep pattern - required for search and grep actions
rangesOptional 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)

ParameterTypeDescription
action *stringFile modification action
changeliststringChangelist ID or 'default'
file_pathsFull depot or client or local paths
forcebooleanForce operation - use with caution
modestringResolve mode: auto(-am), safe(-as), force(-af), preview(-n), theirs(-at), yours(-ay)
source_pathsSource paths - required for move action
target_pathsTarget paths - required for move action

query_changelists

Get changelist details and list changelists (READ permission)

ParameterTypeDescription
action *stringChangelist query action: get retrieves specific changelist details, list returns all changelists matching filters
changelist_idChangelist ID - required for get action
depot_pathFilter by depot path - for list action
max_resultsMaximum 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.
statusFilter by status - for list action
userFilter by user - for list action
workspace_nameFilter by workspace - for list action

modify_changelists

Create/delete changelists, update changelists and organize files/jobs (WRITE permission)

ParameterTypeDescription
action *stringChangelist modification action: create makes new changelist, update modifies description, submit commits changes, delete removes changelist, move_files reorganizes files between changelists
changelist_idChangelist ID - required for most actions except create
descriptionstringChangelist description - required for create, optional for update
file_pathsFile paths - required for move_files action

query_shelves

List shelves, get shelve diff and files (READ permission)

ParameterTypeDescription
action *stringShelve query action: list returns all shelved changelists, diff shows shelved file differences, files lists files in shelved changelist
changelist_idChangelist ID - required for diff and files actions
max_resultsintegerMaximum number of results to return
userFilter by user - for list action

modify_shelves

Create/delete, update shelves and unshelve files (WRITE permission)

ParameterTypeDescription
action *stringShelve 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 *stringChangelist ID
file_pathsFile paths for shelve/unshelve/update/delete
forcebooleanForce operation - use with caution
target_changeliststringTarget changelist for unshelve operations

query_jobs

Get jobs from changelist and get job details (READ permission)

ParameterTypeDescription
action *stringJob query action: list_jobs returns jobs linked to changelist, get_job retrieves specific job details
changelist_idChangelist ID - required for list_jobs action
job_idJob ID - required for get_job action
max_resultsintegerMaximum number of results to return

modify_jobs

Link or unlink jobs (WRITE permission)

ParameterTypeDescription
action *stringJob modification action: link_job associates job with changelist, unlink_job removes job association
changelist_id *stringChangelist ID - required for link_job/unlink_job
job_id *stringJob 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'.

ParameterTypeDescription
action *stringReview query action: list all reviews, dashboard for current user, get specific review, transitions, files_readby, files, comments, activity
afterReview ID to seek to for pagination (list action). Reviews up to and including this ID are excluded.
after_updatedReturn reviews updated on the day before this date/time in seconds since epoch (list action). Mutually exclusive with 'after'.
comments_fieldsComma-separated list of fields to return for comments action
fieldsList of fields to return for list/get actions
from_versionStarting version for files action
include_transitionsInclude allowed state transitions in get action response
keywordsSearch keyword(s) to filter reviews (list action). Use with keywords_fields.
keywords_fieldsFields to search keywords in (list action). Valid: changes, author, participants, hasReviewer, description, updated, projects, state, testStatus, pending, groups, id
max_resultsintegerMaximum number of results to return
projectsFilter by project name(s) (list action)
result_orderSet to 'updated' to return most recently updated reviews first (list action)
review_idReview ID - required for get, transitions, files_readby, files, comments, activity actions
stateFilter by review state(s) (list action). Valid: needsRevision, needsReview, approved, approved:isPending, approved:commit, approved:notPending, rejected, archived
to_versionEnding version for files action
up_votersList of up voters for transitions action

modify_reviews

Create/update/delete reviews (WRITE permission)

ParameterTypeDescription
action *stringReview modification action. To delete/obliterate review, use 'obliterate' action which requires approval
bodyComment body (required for add_comment, reply_comment)
change_idChangelist ID (required for create, append_change, replace_with_change)
cleanupPerform cleanup for approved:commit/committed transitions
comment_contentContent 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_pathFile path for inline comment
comment_idComment ID (reply_comment, edit_comment, mark_comment_read/unread)
comment_left_lineLeft diff line number for inline comment
comment_right_lineRight diff line number for inline comment
comment_versionReview version for comment attachment
descriptionReview description (optional on create)
fix_statusJob fix status when transitioning
jobsAssociated job IDs for transition
max_reviewsintegerMaximum number of inactive reviews to archive (0 = no limit)
new_authorNew author username (update_author)
new_descriptionNew review description (update_description)
not_updated_sinceISO date (YYYY-MM-DD) threshold for archive_inactive
notifyNotification mode
participant_group_namesList of participant group names
participant_groups_requiredList of required participant groups
participant_user_namesList of participant usernames
participant_users_requiredList of required participant usernames
required_reviewersList of required reviewers
review_idReview ID (required for most actions except create, archive_inactive)
reviewer_group_namesList of reviewer group names
reviewer_groups_requiredList of required reviewer groups
reviewersList of reviewers
task_stateTask state. add_comment accepts only 'open'|'comment'; edit_comment additionally accepts 'addressed'|'verified'
transitionTransition target state
versionReview version (optional for vote)
vote_valueVote value

query_streams

Query streams: list, get spec, children/parent/graph, integration status, workspaces, validate files, check resolve, interchanges (READ permission)

ParameterTypeDescription
action *stringStream 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_streamsbooleanInclude virtual streams in 'list' results
at_changeChangelist number for historical stream spec
both_directionsbooleanShow integration status in both directions (-a flag for integration_status)
changelistChangelist for validate_submit
fieldsFields to return for 'list' (e.g. ['Stream', 'Owner', 'Name', 'Type'])
file_pathsFile paths for validate_file or interchanges
filterFilter expression string for 'list' (-F flag). Supports &, |, and parentheses. E.g. 'Parent=//Ace/MAIN&(Type=development|Type=release)'
force_refreshbooleanForce istat to assume cache is stale and search for pending integrations (-c flag)
limitMax changelists (interchanges)
long_outputbooleanFull changelist descriptions (interchanges)
max_resultsMaximum number of results to return. Bounds 'list' and 'list_workspaces' and also caps 'children' via 'p4 streams -m N'. Omit for unbounded results.
reversebooleanReverse comparison direction (interchanges)
stream_nameStream depot path (e.g. '//depot/main'). Required for most actions.
stream_pathStream path pattern(s) for 'list' (e.g. ['//depot/...'])
templateTemplate workspace for get_workspace
unloadedbooleanInclude unloaded streams/workspaces
userFilter workspaces by user (list_workspaces)
view_without_editbooleanView locked stream without opening for edit (-v flag)
viewmatchSingle depot file path to filter streams whose views contain this path
workspaceWorkspace 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)

ParameterTypeDescription
action *stringStream 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_rootsAlternate root paths (create_workspace)
branchBranch spec name for integrate/populate (-b flag)
changelistChangelist for edit_spec, shelve_spec, unshelve_spec, or propagation, 'default' not allowed for edit_spec/shelve_spec/unshelve_spec
descriptionStream or workspace description
file_pathsFile paths for propagation
forcebooleanForce operation
hostHost restriction (create_workspace)
ignoredIgnored paths
integrate_around_deletedbooleanIntegrate around deleted revisions (-Di flag)
max_filesLimit number of files processed (-m flag)
nameShort display name for the stream
optionsStream options: 'allsubmit/ownersubmit unlocked/locked toparent/notoparent fromparent/nofromparent'
output_basebooleanShow base revision with each scheduled resolve (-Ob flag for merge/integrate) or display list of files created (-o flag for populate)
parentParent stream (required for non-mainline create)
parent_streamOverride parent stream for propagation (-P flag)
parent_viewParent view treatment: 'inherit' or 'noinherit'
pathsStream view paths (e.g. ['share ...', 'isolate dir/...'])
previewbooleanPreview only, don't make changes (-n flag)
quietbooleanSuppress informational messages (-q flag)
remappedRemapped paths
resolve_modeResolve mode for resolve_spec: 'auto', 'accept_theirs', 'accept_yours'
reversebooleanReverse direction (-r flag)
rootWorkspace root directory (create_workspace)
schedule_branch_resolvebooleanSchedule 'branch resolves' instead of branching new target files automatically (-Rb flag)
skip_cherry_pickedbooleanSkip cherry-picked revisions already integrated (-Rs flag)
source_pathSource path for populate
stream_nameStream depot path (e.g. '//depot/main'). Also used as -S flag for propagation.
stream_typeStream type (required for create): mainline, development, sparsedev, release, sparserel, task, virtual
target_changelistTarget changelist for unshelve_spec
target_pathTarget path for populate
virtualbooleanCopy using virtual stream (-v flag, copy only)
workspaceWorkspace name for switch
workspace_nameWorkspace name to create (create_workspace)