Gemini CLI

Add Thirdfy MCP to Gemini CLI with one command and sign in with /mcp auth, or use an agent key header.

Add Thirdfy to Gemini CLI so it can read markets and act for your agent from your terminal. Gemini CLI connects to Thirdfy as a remote streamable HTTP MCP server. See Gemini CLI's MCP servers docs.

1. Add the server

The quickest way is to add the server and sign in with your Thirdfy account:

gemini mcp add --transport http --scope user thirdfy https://mcp.thirdfy.com/mcp

--scope user saves it in ~/.gemini/settings.json for every project. Without it, Gemini CLI saves it in the project's .gemini/settings.json.

  1. Start Gemini CLI and run /mcp auth thirdfy. Your browser opens the Thirdfy sign-in page.
  2. Sign in with the same method you use on thirdfy.com (email, Google or wallet).
  3. Pick the agent Gemini acts for, or click + Create a new agent.
  4. Choose access: Read (always), Trade within your agent's limits, and Stay connected (up to 30 days). Click Approve.

/mcp then shows thirdfy as connected, with its tools. You're done: skip to Try it. Manage or revoke the connection at auth.thirdfy.com/connections. For what a signed-in app can do, see Connect.

Using an agent key instead? Sections 2 and 3 are for a setup that runs as the agent with its API key, such as CI or a headless machine.

To look around first with no account, add the public connection: gemini mcp add --transport http thirdfy-public https://mcp.thirdfy.com/mcp/public.

2. Create an agent key

Open thirdfy.com/connect, go to Agent key, pick the agent and click Create a key. The key (agent-...) is shown once, so store it right away.

3. Add your key as a header

Keep the key in an environment variable and reference it from settings.json. Gemini CLI expands $VAR and ${VAR} when it loads the file:

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

Use httpUrl, not url: url is for the older SSE transport. Export AGENT_API_KEY before you start Gemini CLI. Don't paste the key into prompts.

To limit the tools Gemini sees, add "includeTools": ["getProviderActions", "getVenueReadiness", "agentRun"] to the server. Leave trust off, so Gemini asks before each tool call.

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.

Before a write:

  1. getVenueReadiness lists anything that blocks the venue.
  2. Preview the action with previewOrder.
  3. Run it with walletExecute.

Thirdfy refuses any write that fails its checks (allowlist, daily limit, venue readiness, credits).

Troubleshooting

IssueFix
gemini mcp list shows DisconnectedCheck the URL is https://mcp.thirdfy.com/mcp and the key is httpUrl
401 Authentication requiredRun /mcp auth thirdfy again, or add the Authorization: Bearer agent-... header (step 3)
Sign-in endedSign-ins last up to 30 days with Stay connected. Run /mcp auth thirdfy again
Writes return insufficient_scopeYou granted Read only. Run /mcp auth thirdfy and tick Trade
Empty Bearer headerAGENT_API_KEY is not set. Export it and restart Gemini CLI
AGENT_IDENTITY_MISMATCHThe model passed a different key in arguments. The header key is used