MCP

PwrGit runs a local MCP server inside the app. An agent connected to it can find your repositories and worktrees, read safe repository metadata and pull request, CI and review status, see which repositories you used most recently, and — if you allow it — open one in a PwrGit window.

Two things are true of it throughout, and the rest of this page follows from them:

The server lives inside the installed app. There is nothing to clone, nothing to build, and no Node install to get right.

Turn on local agent access

Command+, (Ctrl+,) opens Settings. Go to Local Agents → MCP server and turn on Enable local-agent access. The section’s chip reads Listening once it is on, Off otherwise, and Failed if the listener could not start.

While it is on, PwrGit serves MCP at:

http://127.0.0.1:51731/mcp

It listens on the loopback address only, and accepts requests only for that exact host and port.

It is off by default. An always-listening local endpoint is a standing offer on every repository you have, so it is only ever on because you put it there. Once on, it stays on across restarts until you turn it off. Turning it off stops the listener and cancels every approval still waiting.

Connect an agent

With access on, Connect an agent in the same pane shows the command for each supported client, with Copy Claude Code command and Copy Codex CLI command.

Settings on Local Agents with access on. The MCP server card's chip reads Listening and the Enable local-agent access switch is On. Below it, Connect an agent shows the two Claude Code commands, claude mcp add with the 127.0.0.1:51731/mcp URL and claude mcp login pwrgit, with a Copy Claude Code command button, then the Codex CLI command.
Access on: the chip reads Listening, and the connect commands appear with copy buttons.

Claude Code:

claude mcp add --scope user --transport http pwrgit http://127.0.0.1:51731/mcp
claude mcp login pwrgit

Codex CLI:

codex mcp add pwrgit --url http://127.0.0.1:51731/mcp \
  --oauth-client-registration dcr

The client then asks PwrGit for access, and PwrGit opens its own window, Approve agent access: “client wants to connect to PwrGit. Review the permissions below.”

The Approve agent access window: Claude Code (pwrgit-docs) wants to connect to PwrGit. Under Session permissions the Session Name field reads Claude Code on this laptop and the Role menu is set to Local Repository Reader, listing Discover repository roots, Locate checkouts and Read repository metadata, with Repositories: All bounded repositories. Deny and Approve buttons at the bottom.
The approval window a Claude Code login opens. The client is named after the server entry, here pwrgit-docs.

Approve, and the client receives its token directly. You never see or copy one.

What approval guarantees

Other MCP clients

Any MCP client that supports Streamable HTTP with OAuth — dynamic client registration, the authorization-code flow with PKCE — can connect to the same URL. There is no way to mint a token by hand, by design: every token is the result of an approval.

What an agent can call

Ten tools. The parameter names matter: the repository argument is repository, not identity, and the path arguments are path, not repositoryPath.

Repositories and status

Tool Required Optional
pwrgit_repository_roots — roots (string[], up to 32), includeConventional (boolean), maxDepth (0–5, default 4)
pwrgit_find_checkout repository (string) provider (github | gitlab | gitcafe), roots (string[]), maxDepth (0–5), maxResults (1–20)
pwrgit_repository_info path (string) maxWorktrees (1–64, default 10)
pwrgit_watch_repository path (string) intervalMs (5000–300000, default 15000)
pwrgit_live_status_capabilities — —

Missing worktrees

A worktree whose folder was deleted outside Git is reported with missing: true and no status, and counted in the summary’s missing total. The rest of the answer still comes back; one missing checkout no longer fails the whole call. Missing worktrees sort near the top, beside prunable ones.

The running app

Tool Parameters What it does
pwrgit_app_profiles — Profile names, repo folders, the active profile and repository counts. No account email or credentials
pwrgit_app_repositories profileId, query, sort (recently_viewed | name), limit (1–100, default 20) Search indexed repositories by name, path or branch, with their worktrees, pins and cached status
pwrgit_app_recent_repositories profileId, limit (1–100, default 20) Repositories you actually selected in PwrGit, newest first
pwrgit_app_open repoId (required), worktreeId Opens or focuses that repository’s profile window, optionally on one worktree
pwrgit_app_refresh repoId (required) Picks up worktrees added or removed outside PwrGit and refreshes cached status

“Which repositories was I working in?” is pwrgit_app_recent_repositories. Its order is when you last selected a repository in PwrGit, not when it last had a commit. Cached status can be stale until refreshed — it is not a fresh Git or network request.

pwrgit_app_open and pwrgit_app_refresh are the only tools that change anything, and what they change is PwrGit’s own windows and index, never a repository.

Roles and permissions

A Session is bound to one role, and the role is the whole of what that agent can do. Four are built in:

Role What it grants
Repository Discovery Find repository roots, and locate a checkout by forge identity
Local Repository Reader The above, plus repository metadata and status, and the app’s repository list
Live Forge Status The above, plus pull/merge request, CI and review status, and live status
PwrGit Workspace Control The above, plus opening repositories in PwrGit windows. No Git writes

Pick Repository Discovery for an agent that only needs to find things, Live Forge Status only for one that genuinely watches your pull requests, and PwrGit Workspace Control only for one you want to drive PwrGit’s windows.

A Session can never exceed what its client asked for. Its effective permissions are its role intersected with the scopes approved at sign-in. Changing the role later cannot widen it past those scopes; reconnect the client to grant more.

Built-in roles cannot be edited. A custom role — New custom role, or Duplicate selected role — picks individual permissions and, more usefully, can be limited to Only these existing roots. That restricts every path-taking tool and both live-status paths to the folders you name. Symlinks are resolved before that boundary is checked, and a restricted role cannot quietly widen itself by falling back to other folders.

Settings → Local Agents → Authorization graph draws the whole thing: each Session, the role it holds, and the permissions and repository boundary that role resolves to.

The Authorization graph with 1 active. Sessions lists Claude Code on this laptop, marked ACTIVE, with its role menu set to Local Repository Reader and a Revoke link. Roles lists the four built-in roles with Local Repository Reader highlighted, 3 permissions on All bounded repositories. Permissions and scope below starts with the repository boundary, All bounded repositories, and Discover repository roots.
One approved Session, traced to its role and the permissions that role grants.

What never leaves PwrGit

Repository status an agent reads is counts and states, never content. It does not contain:

Live pull and merge request status carries the request’s URL and the usernames of its latest reviewers. The app tools return local paths, branch names and profile names, which is what they are for.

Forge status goes through the gh and glab CLIs you are already signed in to, exactly as the rest of PwrGit does. PwrGit never extracts or returns their tokens. A signed-out or missing CLI reports the provider as unavailable and local status keeps working. See Forges.

Session tokens are stored only as SHA-256 hashes.

Revoke access

Settings → Local Agents → Authorization graph → Sessions, then Revoke on the Session. It also lists each Session as Active or Revoked, and lets you change a Session’s role in place.

Revocation applies to a running agent. PwrGit re-checks the authorization policy on every request — every tool call, resource read and live-status update — so a revoked Session stops working immediately, with nothing to restart on either side. Role changes and repository-root edits apply the same way.

Turning off local-agent access does not revoke anything. It stops the listener, so no client can connect while it is off, but every Session is still there when you turn it back on. Revoke the Session when that is what you mean.

Troubleshooting

Symptom Cause
The client cannot connect PwrGit is not running, or Enable local-agent access is off. The chip reads Off
The chip reads Failed The listener could not start — the error is under the switch. Another process may hold port 51731
No approval window appears The client’s login did not reach PwrGit — check the URL is exactly http://127.0.0.1:51731/mcp
“Approval expired. Start a new PwrGit login.” Nobody answered within five minutes. Run the client’s login again
“No role fits the permissions requested by this agent.” The client asked for fewer scopes than any role needs
An agent gets permission errors on some tools Its role, or the scopes it was approved with, do not grant that permission — check the Authorization graph
An agent sees no repositories Its role is restricted to roots that do not contain them
Pull request or CI status is missing gh / glab is missing or signed out — see Forges → Troubleshooting. GitCafe has no live status

Not yet

The protocol

This page covers connecting an agent. The versioned wire contract — resource schemas, the CI and review state vocabulary, event kinds, the OAuth routes and loopback checks, and the discovery budgets — is in docs/mcp-server.md in the PwrGit repository.