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:

claude mcp add --transport http thirdfy https://mcp.thirdfy.com/mcp
  1. Start Claude Code and run /mcp.
  2. Choose thirdfy, then Authenticate. Your browser opens the Thirdfy sign-in page.
  3. 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:

claude mcp add --transport http thirdfy https://mcp.thirdfy.com/mcp/public

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

Use Thirdfy to onboard me with you@example.com.

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:

export AGENT_API_KEY="agent-..."
claude mcp remove thirdfy
claude mcp add --transport http thirdfy https://mcp.thirdfy.com/mcp \
  --header "Authorization: Bearer $AGENT_API_KEY"

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:

ScopeWho sees itStored in
local (default)You, in this project~/.claude.json
projectEveryone who clones the repo.mcp.json at the project root
userYou, in every project~/.claude.json

For a team repo, commit a .mcp.json that reads each person's key from their own environment:

{
  "mcpServers": {
    "thirdfy": {
      "type": "http",
      "url": "https://mcp.thirdfy.com/mcp",
      "headers": {
        "Authorization": "Bearer ${AGENT_API_KEY}"
      }
    }
  }
}

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

Using Thirdfy:
1. List the OpenMarket actions.
2. Run get_openmarket_btc_funding and summarize it.
3. Check if my Hyperliquid venue is ready to trade.

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

IssueFix
/mcp shows failedCheck the URL is https://mcp.thirdfy.com/mcp and the transport is http
401 Authentication requiredRun /mcp, choose thirdfy and Authenticate again, or add the Authorization: Bearer agent-... header (step 3)
Writes return insufficient_scopeYou granted Read only. Authenticate again and tick Trade
Literal ${AGENT_API_KEY} sentExport the variable before you start Claude Code
AGENT_IDENTITY_MISMATCHThe model passed a different key in arguments. The header key is used