Claude Code
Add Thirdfy MCP to Claude Code with one command and sign in with your Thirdfy account, or use an agent key header.
Add Thirdfy to Claude Code so it can read markets and act for your agent from your terminal. Claude Code connects to Thirdfy as a remote HTTP MCP server.
1. Add the server
The quickest way is to add the server and sign in with your Thirdfy account:
- Start Claude Code and run
/mcp. - Choose thirdfy, then Authenticate. Your browser opens the Thirdfy sign-in page.
- Choose the agent, or click + Create a new agent, and choose what Claude may do.
You're done. Skip to Try it.
Using an agent key instead? Sections 2 and 3 below are for a setup that runs as the agent with its API key, such as CI or a shared project. Start with the public connection, which needs no account:
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 Thirdfy emails you. It then calls completeEmailOnboarding with acceptTerms: true. The response includes your agent API key (agent-...) and execution wallets. Save the key now. 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 the key in an environment variable, then re-add the server with the header:
Your shell expands $AGENT_API_KEY when you run the command, so the saved config holds the key itself. To save only the variable name, use a project .mcp.json (below).
Run /mcp again and reconnect. Tools that need a key 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 to look things up and run 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 | Run /mcp, choose thirdfy and Authenticate again, or add the Authorization: Bearer agent-... header (step 3) |
Writes return insufficient_scope | You granted Read only. Authenticate again and tick Trade |
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 |