query_changelists
Get changelist details and list changelists (READ permission)
Read a Perforce depot — file history, changelists, shelves, reviews and streams — without a workspace sync or a Swarm tab.
LABSCO SUMMARY
Each tool carries the READ permission marker and dispatches on an action, so who changed this file and what the review said is two calls rather than a p4 session plus a browser. The stream tools reach past file history into parent and child graphs, integration status and interchanges — the answers that decide whether a merge is safe to start.
Eight read-only query tools over a Perforce server, each dispatching on an action parameter: server, workspaces, files, changelists, shelves, jobs, reviews and streams.
A Perforce server and workspace you can reach — P4PORT, P4USER and P4CLIENT — plus uv on your PATH, which resolves the Python runtime through UV_PYTHON. Every tool is marked READ permission.
One command plus credentials — uvx p4mcp-server --readonly --allow-usage, then supply credentials
USE CASES
Annotate the file to see which revision each line came from, then read the changelist behind it for the description and the rest of the files it moved.
Pull the review with its state and comments, filtered by project or keyword, and check the jobs attached to the changelist so the review is read against what it was meant to fix.
Ask the stream for its parent and child graph, integration status and interchanges — the changes waiting to move — then read the changelists those interchanges name.
List their shelves, read the diff of the shelved changelist, and check which workspace it came from before you decide to unshelve it.
Search by file name or grep by content, case-insensitively and capped by max_results, across paths your workspace never synced.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
query_changelistsGet changelist details and list changelists (READ permission)
query_filesGet file content, history, info, diff, annotations, search by name, grep by content (READ permission)
query_jobsGet jobs from changelist and get job details (READ permission)
query_reviewsGet 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'.
query_serverGet server info and current user information (READ permission)
query_shelvesList shelves, get shelve diff and files (READ permission)
query_streamsQuery streams: list, get spec, children/parent/graph, integration status, workspaces, validate files, check resolve, interchanges (READ permission)
query_workspacesGet workspace details, list workspaces, check type and status (READ permission)
BEFORE YOU INSTALL
8 tools when we connected; the project documents 15. 8 is the read-only set; without --readonly the 7 modify_* tools register too. --toolsets and server-side administrator settings can narrow the set, and --search-transform replaces it with search tools.
All 6 documented clients run the server on your machine.
INSTALLATION
uvx p4mcp-server --readonly --allow-usage{
"mcpServers": {
"perforce-p4-mcp": {
"command": "uvx",
"args": [
"p4mcp-server",
"--readonly",
"--allow-usage"
],
"env": {
"P4PORT": "ssl:<YOUR_PERFORCE_HOST>:1666",
"P4USER": "<YOUR_P4USER>",
"P4CLIENT": "<YOUR_P4CLIENT>"
}
}
}
}{
"servers": {
"perforce-p4-mcp": {
"command": "uvx",
"args": [
"p4mcp-server",
"--readonly",
"--allow-usage"
],
"env": {
"P4PORT": "ssl:<YOUR_PERFORCE_HOST>:1666",
"P4USER": "<YOUR_P4USER>",
"P4CLIENT": "<YOUR_P4CLIENT>"
}
}
}
}