Claude Code
Add Thirdfy MCP to Claude Code with one command, onboard by email, then add your agent key as a header.
Claude Code connects to Thirdfy as a remote HTTP MCP server.
1. Add the server
Start Claude Code and run /mcp. thirdfy shows as connected, with its tool count. From a terminal, claude mcp list and claude mcp get thirdfy show the same.
2. Onboard by email
Claude calls startEmailOnboarding and asks for the code from your inbox. It then calls completeEmailOnboarding with acceptTerms: true. The response includes your agent API key (agent-...) and execution wallets. Save the key; it is shown once.
Prefer the shell? thirdfy-agent login email does the same and stores the key in ~/.thirdfy/config.json. See Agent CLI authentication.
3. Add your key as a header
Thirdfy reads the agent key from the connection header on every call. Put it in an environment variable and re-add the server with the header:
Your shell expands $AGENT_API_KEY when you run the command, so the stored config holds the key itself. For a config that keeps only the variable name, use a project .mcp.json (below).
Run /mcp again and reconnect. Credentialed tools now act for your agent. Don't paste the key into prompts; without the header those tools return 401 Authentication required.
Scopes and team setup
--scope decides where the server is saved:
| Scope | Who sees it | Stored in |
|---|---|---|
local (default) | You, in this project | ~/.claude.json |
project | Everyone who clones the repo | .mcp.json at the project root |
user | You, in every project | ~/.claude.json |
For a team repo, commit a .mcp.json that reads each person's key from their own environment:
Claude Code expands ${AGENT_API_KEY} when it connects. If the variable is unset, /mcp shows a warning. Claude Code asks for approval the first time it uses a project-scoped server.
4. Try it
Pair it with the CLI
Claude Code can also run the Agent CLI in the same session. Use MCP tools for discovery and single actions. Use thirdfy-agent ... --json for scripts, CI and repeatable runs.
Troubleshooting
| Issue | Fix |
|---|---|
/mcp shows failed | Check the URL is https://mcp.thirdfy.com/mcp and the transport is http |
401 Authentication required | Add the Authorization: Bearer agent-... header (step 3) |
Literal ${AGENT_API_KEY} sent | Export the variable before you start Claude Code |
AGENT_IDENTITY_MISMATCH | The model passed a different key in arguments. The header key is used |