# Codex + Keel

Paste this into your assistant:

```
Read https://usekeel.io/agents and walk me through connecting Keel (usekeel.io) here, then help me run my first backtest.
```

Add the Keel server to Codex and it can search components, compose and validate strategies in the Keel DSL, and run backtests on real Hyperliquid history — from the session you already have open.

- Client: OpenAI · One command · Terminal
- Keel MCP server: https://mcp.usekeel.io/mcp
- Guide: https://usekeel.io/agents/codex
- Verified · 0.155.1: These steps are verified against Codex 0.155.1, checked 2026-09-19. Earlier versions are not covered — if what you see does not match, check your version first.

## Quick start

1. **Add the Keel server** — One command, no install. The server is one URL.

   ```bash
   codex mcp add keel --url https://mcp.usekeel.io/mcp
   codex mcp login keel
   ```

2. **Sign in** — codex mcp login keel. Sign in with your Keel account on the page that opens; there is no API key to paste.
3. **Check it worked** — Two ways to tell, and either one settles it. A connection that is already live is not improved by signing in again.

   In Codex — Keel should be listed there with its sign-in recorded. If it is, you are connected — signing in again changes nothing.

   ```bash
   codex mcp list
   ```

   Ask the agent — keel_account_status answers with the Keel account the session is signed in as, which nothing but a live connection can return. If the agent says it has no Keel tools, the sign-in did not finish.

   ```
   Use keel_account_status and tell me which Keel account this session is signed in as.
   ```

4. **Ask for a strategy** — The first prompt to try. The agent reads Keel's instructions and starts from the strategy-creation skill.

   ```
   Connect to Keel (usekeel.io), then compose a carry strategy and backtest it.
   ```

## What Codex gets

Every client gets the same thing — the tools, the knowledge and the skills — behind one sign-in. Codex is no exception.

- **29 tools** — The tool list, with schemas your client reads by name.
- **7 skills** — Keel's own method, loaded the moment the agent needs it, through keel_help in every client.
- **14 knowledge topics** — The DSL reference and the component knowledge base, read by the agent as it works.

## Prompts to try

- Connect to Keel (usekeel.io), then compose a carry strategy and backtest it.
- Search Keel components for a volatility filter and show me how to wire it.
- Fork the Keel library's carry entry and run a backtest on it.
- Read my strategy's memory notes and suggest the next iteration.
- Read https://usekeel.io/agents and tell me what Keel (usekeel.io) is and why I would use it. If I want to try it, tell me how to add it here.

## Troubleshooting

The first request to https://mcp.usekeel.io/mcp answers 401 with sign-in metadata. That is the handshake, not an error: Codex opens the Keel consent page, you approve, and the tools appear in the session. Nothing to install and no API key to paste.

**The first command fails with "Dynamic client registration not supported"**

Your Codex is too old. Keel is verified against codex-cli 0.155.1; versions before it added CIMD sign-in (0.147.0 fails exactly this way) cannot complete the flow. Run `codex update` to get the latest Codex, then run the two commands again.

**The tools do not appear after connecting**

Check the client itself first — `codex mcp list` should show `Auth: OAuth`. If it does, you are connected and re-running the sign-in will not change anything; just ask the agent to use Keel. If it does not, remove and re-add the connection, then sign in or sign up on the Keel page that opens.

**A tool answers with an authentication error**

Reconnect from your client; its OAuth flow refreshes the token. Nothing to install and no key to paste.

**You want to run the strategy on your account**

The agent builds, tests and reads. When you want to run a strategy on your account, it hands it to the Keel app and you take it from there.

## Docs

- Agent setup: https://usekeel.io/docs/agents/setup
- Agent briefing: https://usekeel.io/agents.md
- All agents: https://usekeel.io/agents

## Related guides

- Claude Code: https://usekeel.io/agents/claude-code
- Claude: https://usekeel.io/agents/claude
- ChatGPT: https://usekeel.io/agents/chatgpt
