Connect an agent

PwrSnap’s MCP server lives at:

http://127.0.0.1:51729/mcp

Loopback only: nothing off this machine can reach it. There is no API key, nothing to paste, and no helper or bridge to install. Every agent goes through the same OAuth 2.1 handshake (dynamic client registration, PKCE, and a redirect back to the agent on loopback), and every handshake ends in PwrSnap’s own approval window, where you pick a Session Name and a role and click Allow access. The recipes below get each agent to that window.

The agent will usually open a browser tab during the handshake. That page can’t approve anything; it reads Continue in PwrSnap and waits for your answer in PwrSnap’s window, then hands the result back to the agent.

Before you start

Turn on Settings → Local Agents → Enable local-agent access. Off by default; until it’s on, PwrSnap isn’t listening and every recipe on this page fails to connect. See Agents → turn it on for what the listener badge means.

Once the listener is up, the same Settings page shows a Claude Code and Codex card with the two commands below and a Copy button for each, so you don’t need this page open to grab them: “Run one of these in a terminal. The agent opens PwrSnap’s approval window; pick a Session Name and role there. Nothing else to install.” While the listener is off, starting, or failed, the card says why instead of showing the commands.

PwrAgent

No terminal needed. In a PwrAgent thread running on the Codex or an ACP backend, choose Connect to PwrSnap. PwrAgent runs the OAuth handshake itself and PwrSnap’s approval window opens.

If PwrSnap’s listener is off, PwrAgent tells you: “Enable Local Agent Access in PwrSnap, then choose Connect to PwrSnap again.” Flip the switch in Before you start and choose Connect to PwrSnap once more.

The same prompt offers Get PwrSnap when PwrSnap isn’t installed and Open PwrSnap when it’s installed but not running.

Claude Code

claude mcp add --scope user --transport http pwrsnap http://127.0.0.1:51729/mcp
claude mcp login pwrsnap

--scope user matters. The CLI’s default scope is local, which registers the server for the terminal’s current directory only; user makes PwrSnap available from every project.

login opens the authorization URL in your browser, PwrSnap’s approval window appears, and after you allow access Claude Code prints Authenticated with "pwrsnap". To check either side of that:

claude mcp get pwrsnap

shows Needs authentication before you log in and ✔ Connected after. PwrSnap’s tools are then available in every Claude Code session. Verified with Claude Code 2.1.251.

Codex CLI

codex mcp add pwrsnap --url http://127.0.0.1:51729/mcp --oauth-client-registration dcr

Codex detects OAuth during add and starts the flow itself: it opens your browser, PwrSnap’s approval window appears right away, and there’s no separate login step. --oauth-client-registration dcr tells Codex to register itself dynamically, which is the method PwrSnap supports. codex mcp login pwrsnap exists only for re-authenticating later, for example after you’ve revoked the session in PwrSnap. Verified with Codex CLI 0.152.1.

Anything else that speaks MCP

Any client that implements MCP’s OAuth client role (dynamic client registration, PKCE with S256, and a loopback redirect) connects the same way. Point it at the endpoint above and it discovers the rest from the standard metadata at /.well-known/oauth-authorization-server and /.well-known/oauth-protected-resource/mcp. A client that can’t complete that flow can’t connect; there is no token to paste instead.

Revoke or reconnect

Every connection is a named Session in Settings → Local Agents, each with a Revoke button. Session Names are unique while active, so a second connection under a name that’s still in use is refused with invalid_grant until you revoke the old session or pick a different name. Revoking takes effect on the agent’s next request, and so does picking a different role from the Session’s dropdown: no reconnect needed. Details, budgets, and the audit log are in Agents → sessions, budgets, and audit.