Connect an agent
Connect Claude Code, Cursor or another MCP client to StackHangar, choose which projects it may ask about, and approve it with a passkey.
This page helps you connect a coding agent so it can ask you for keys. You connect each agent once. You never copy a token.
#Before you start
- Your vault is unlocked and you have at least one project. See Unlock your vault.
- You have a passkey. See Passkeys.
- On the Free plan you can connect 1 agent. Solo has no limit.
#The server address
StackHangar's MCP server is at:
https://app.stackhangar.com/api/mcp
The Agents page in the app shows the same address and the command below.
#Connect Claude Code
Run this in your terminal. It contains nothing secret, so it is safe to run anywhere, even inside an agent chat.
claude mcp add --transport http stackhangar https://app.stackhangar.com/api/mcp- In Claude Code, run
/mcp, pickstackhangarand choose Authenticate. - StackHangar opens in your browser on a Connect an agent page. See below for what to do there.
#Connect Cursor and other MCP clients
Add https://app.stackhangar.com/api/mcp as a remote (HTTP) MCP server. The exact place to add it depends on the client; follow its own documentation for remote MCP servers. Clients that support MCP sign-in open the same Connect an agent page in your browser.
#The Connect an agent page
The page shows:
- App, with an Unverified badge. The app's name is its own claim.
- Published at, where the app says it is published, or a note that the app registered itself and StackHangar can't confirm who made it.
- Sends you back to, the address you are returned to after you approve. It says when that is an app on your own computer.
To connect the agent:
- Check that you just started connecting an agent. If you didn't, choose Deny.
- Edit Agent name. It is shown on every approval request, so use a name that tells your agents apart.
- Tick the Projects it may ask about. You must pick at least one.
- Choose Approve with passkey and complete the passkey check.
- Return to your agent.
#What the agent gets
The agent gets its own short-lived sign-in, limited to the projects you ticked. It can ask you to add or use keys in those projects. You still approve every request with your passkey. The agent never gets a value. See AI agents.
The Agents page has no way to edit an agent's projects. To change them, disconnect the agent and connect it again.
#If your client can't sign in through the browser
Open Agents and expand Advanced: manual token (for clients without MCP sign-in). Enter a name, tick the projects and choose Create manual token. This needs a passkey check.
The token is shown once, with a ready-made Claude Code command that includes it. For other clients, use the same address and an Authorization: Bearer header with the token.
Warning
A manual token is a long-lived secret. Run the command in your own terminal, not in an agent chat. Keep the token out of code, shared notes and chat messages. Anyone with it can ask for credentials, though you still approve each request with your passkey.
#If something goes wrong
- The passkey prompt was closed. Nothing is connected. Choose Approve with passkey again.
- "Create a project first." The page lists no projects. Create one, then connect the agent again.
- The plan doesn't allow another connected agent. The Free plan includes 1 connected agent. Disconnect one on the Agents page, or upgrade to Solo.
- You declined by mistake. Start the sign-in again from your client.
See also Troubleshooting.
Something missing or wrong on this page? Tell us.