Run an OpenClaw agent on Thirdfy
Give an OpenClaw agent its own Thirdfy agent key, store it as a runtime secret, connect it over MCP, and let it read markets and trade from its own wallet within its limits.
Your OpenClaw agent runs on its own, so it can't sign in through a browser. It uses an agent key instead. You get the key once, store it in OpenClaw's runtime secrets, and point OpenClaw's MCP connector at Thirdfy. Then the agent reads markets, checks venues and trades from its own wallet, within the limits you set.
What you need
- An OpenClaw runtime that can add a remote MCP server with a custom header.
- A Thirdfy agent and its agent key (
agent-...). Step 1 shows how to get one. - Funds in the agent's execution wallet, if you want it to trade. It can read without them.
1. Get an agent and its key
You do this once. Pick one way.
With the Agent CLI
Sign in by email on your own machine. The second command creates the agent and its wallets.
The agent key (agent-...) is saved in ~/.thirdfy/config.json under agent.apiKey. whoami shows the agent's 0x address as agent.agentKey.
Over MCP, without an account
Connect any MCP client to https://mcp.thirdfy.com/mcp/public. No key is needed there.
- Call
startEmailOnboardingwith your email. - Call
completeEmailOnboardingwith the email, the code from your inbox andacceptTerms: true. - Copy the key from
data.bootstrap.agentApiKey. It is shown only once, so save it in your password manager.
2. Store the key as a runtime secret
Save the key in OpenClaw's runtime secrets as THIRDFY_AGENT_API_KEY.
Never put the key in prompts, skill files, logs or tool arguments.
3. Connect OpenClaw to Thirdfy
Point OpenClaw's MCP connector at https://mcp.thirdfy.com/mcp (streamable HTTP), and send the key as a header:
The exact file and variable syntax depend on your OpenClaw pack. Thirdfy reads the key from the header on every call, so your agent can act only for itself.
Check the connection from a shell:
4. Make a first read
Ask your agent to call a read. Nothing is signed or sent.
Have the agent call getProviderActions before it plans. Then it uses only actions it is allowed to call, with the names discovery returns.
5. Preview, then run a trade
The agent trades from its own execution wallet (agent_wallet). Before a write, it follows these steps:
- Check the wallet.
agentWalletBootstrapwithrequireFundingCheck: trueshows the execution wallet and whether it is funded. Fund that wallet, not your login wallet. - Check the venue. Call
getVenueReadinessfor the venue, for example Hyperliquid. Go on only whenreadyistrueandblockingReasonsis empty. - Preview. Call
previewOrderwith the same arguments as the trade. It shows whether Thirdfy would run it. Nothing moves. - Run. Call
agentRunorwalletExecutewith the same arguments.
If a write answers CONFIRMATION_REQUIRED, repeat the call with the confirmationToken only after you agree to the summary.
What happens before every trade
- Your agent's limits apply. Thirdfy checks the action allowlist, the daily limit, any delegation and credits on every write. If one check fails, nothing runs.
- Venues are checked. Thirdfy refuses a venue order when the venue isn't ready, and says why. Run the venue onboarding tools before the first Polymarket, Hyperliquid or Lighter write.
- The key stays yours. If a call names a different key in its arguments, it fails with
AGENT_IDENTITY_MISMATCH. - No double orders on hosted runtimes. Runtimes hosted on EarnOrg pass
executionContext(runtimeId,orgId) onwalletExecute,executeIntentandagentRun. This ties credits and duplicate-order protection to the right runtime. Place orders there need anidempotencyKeythat starts withearnclaw:<runtimeId>.
If something goes wrong
| What you see | What to do |
|---|---|
401 Authentication required | Send Authorization: Bearer <agent key> on the connector, and check the secret is set in the runtime |
AGENT_IDENTITY_MISMATCH | A different key was passed in the tool arguments. Remove it |
LIVE_GATE_OFF | Thirdfy's checks returned executeAllowed: false. Fund the wallet or fix the venue credentials |
Venue readiness shows blockingReasons | Fund or set up the venue first. Run the venue onboarding tools |
403 ... is not allowed | The action is not on the agent's allowlist. Allow it for the agent, or pick another action |
POLICY_DAILY_LIMIT | The agent's daily limit is used up |
DAILY_FREE_LIMIT_EXCEEDED | No free requests are left and the balance is empty. Top up at thirdfy.com/credits |
| Idempotency rejected | On a hosted runtime, use an idempotencyKey that starts with earnclaw:<runtimeId> |
For developers
| MCP URL | https://mcp.thirdfy.com/mcp (streamable HTTP, agent key header) |
| Header | Authorization: Bearer agent-... (X-API-KEY: agent-... works too) |
| No account | https://mcp.thirdfy.com/mcp/public: catalog, signals, help, and email or wallet onboarding |
| Tool REST | POST https://mcp.thirdfy.com/tool/<toolName> |
| Scoped identity | bootstrapSelfIdentity sets up a limited identity without email |
OpenClaw can use the Agent CLI instead of MCP. Keep THIRDFY_AGENT_API_KEY and THIRDFY_AGENT_KEY (the agent's 0x address) in the runtime secrets, and have the agent run thirdfy-agent actions --provider <id> before it plans:
Use agent_wallet for the agent's own wallet. Use self only when local signing is set up, and hybrid or thirdfy only after delegation is ready. See Hermes and OpenClaw with the CLI.