{
  "markdown": "<p align=\"center\">\n  <a href=\"https://usekeel.io/keel-mcp\">\n    <img src=\"https://usekeel.io/og/keel-mcp.png\" alt=\"keel-trade — Build, backtest, and automate Hyperliquid trading strategies with your agent\" width=\"100%\">\n  </a>\n</p>\n\n<h1 align=\"center\">keel-trade</h1>\n\n<p align=\"center\">\n  <strong>The Keel CLI and stdio MCP server.</strong><br>\n  Build, backtest, and automate <a href=\"https://hyperliquid.xyz\">Hyperliquid</a> trading strategies — with your agent in the loop for <em>creation</em> and a deterministic engine in the loop for <em>execution</em>.\n</p>\n\n<p align=\"center\">\n  <a href=\"https://pypi.org/project/keel-trade/\"><img src=\"https://img.shields.io/pypi/v/keel-trade.svg\" alt=\"PyPI version\"></a>\n  <a href=\"https://www.python.org/downloads/\"><img src=\"https://img.shields.io/badge/python-3.11+-blue.svg\" alt=\"Python 3.11+\"></a>\n  <a href=\"LICENSE\"><img src=\"https://img.shields.io/badge/license-MIT-green.svg\" alt=\"MIT License\"></a>\n  <a href=\"https://usekeel.io/keel-mcp\"><img src=\"https://img.shields.io/badge/product-keel--mcp-635BFF.svg\" alt=\"Product page\"></a>\n  <a href=\"https://glama.ai/mcp/servers/keel-trade/keel-trade\"><img src=\"https://glama.ai/mcp/servers/keel-trade/keel-trade/badges/score.svg\" alt=\"keel-trade MCP server\"></a>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://usekeel.io\">Website</a> ·\n  <a href=\"https://usekeel.io/keel-mcp\">Product page</a> ·\n  <a href=\"https://usekeel.io/docs\">Docs</a> ·\n  <a href=\"https://app.usekeel.io/share/gDXjURKqWPs8CZ4eXdqAI?ref=H0O2KN\">Sample backtest</a> ·\n  <a href=\"https://github.com/keel-trade/keel-trade/discussions\">Discussions</a>\n</p>\n\n---\n\n## What is Keel?\n\n[Keel](https://usekeel.io) is a quantitative crypto trading platform built around Hyperliquid — strategy development, backtesting, live execution, and portfolio management on the venue with the deepest on-chain perpetual order book. The full platform includes:\n\n- A **web app** for composing strategies, running backtests, and deploying live ([app.usekeel.io](https://app.usekeel.io))\n- A **deterministic backtest engine** with real Hyperliquid funding + price + slippage, walk-forward, and Monte Carlo\n- **Bit-for-bit live execution** — the same compiled strategy artifact runs in backtest and on Hyperliquid\n- A **strategy library** of documented, forkable trading strategies\n- A **screener + calculator suite** at [usekeel.io/lab](https://usekeel.io/lab) (funding leaderboard, momentum, overfit-check, walk-forward visualizer, more)\n- This package — `keel-trade` — the **agent-native research surface**\n\nThis repository is the public mirror of the `keel-trade` Python package: a single `pipx install` gives you both a CLI and a stdio MCP server, so the same tools work from a terminal or from any MCP-capable agent.\n\n## Why agents create strategies, not trade them\n\nMost agent-trading projects put an LLM in the execution loop. That makes systems slow, inconsistent, and hard to audit. Keel does the opposite:\n\n```\nYou ──── compose ────► Strategy graph ──── compile ────► Deterministic artifact\n                              ▲                                    │\n                              │                                    ▼\n                          Agent edits                          Backtest engine\n                          via MCP tools                        (real HL data)\n                                                                   │\n                                                                   ▼\n                                                              Live execution\n                                                              (same artifact)\n```\n\nThree properties drive the design:\n\n1. **Bit-for-bit parity between backtest and live.** Same compiled artifact, same engine, same data path. There is no second implementation that can drift.\n2. **Typed composition over freeform code.** Strategies are graphs of versioned components. Compile errors catch bugs at author time instead of in production.\n3. **Agents compose, the deterministic engine executes.** Claude / Cursor / Codex help you build the strategy. They are not in the trade loop.\n\n## Choose your surface\n\n`keel-trade` (this package) is the CLI + local MCP path. Keel is one product\nwith several places to use it — pick by where you are:\n\n<!-- surface-routing:begin -->\n<!-- GENERATED from shared/surface-routing.json — edit there, then run\n     python packages/keel-trade/keel-sdk/scripts/check_surface_routing.py --write -->\n| You are… | Default path (shown first) | Also works |\n| --- | --- | --- |\n| Using Claude/ChatGPT on web or phone | Hosted endpoint — paste the URL (directory one-click coming) | CLI + local MCP |\n| Working in Claude Code / Cursor / terminal | `pipx install keel-trade` (CLI + local MCP) | hosted endpoint |\n| Going live with a strategy | Keel web app (connect account, review sizing, go live) | reads on every surface |\n| Building your own agent/scripts | SDK + API key | CLI |\n| Just browsing/running strategies | Web app + library | hosted endpoint |\n<!-- surface-routing:end -->\n\n- **Hosted endpoint** — the remote MCP at `https://mcp.usekeel.io/mcp`: one\n  23-tool research/backtest/read surface (compose, backtest, share, read-only\n  monitoring — no live-write, no local files). Paste the URL into any\n  remote-MCP client; the one-click directory listing is coming. Going live is\n  a handoff into the Keel web app.\n- **CLI + local MCP** — this package (install below).\n- **SDK + API key** — the [REST API](https://usekeel.io/docs/api-reference)\n  for building your own agents and scripts.\n\nPer-surface zero-to-first-backtest runbook: [usekeel.io/agents](https://usekeel.io/agents).\n\n## Install\n\n### Claude Desktop — one-click (MCPB)\n\nDownload `keel-trade-<version>.mcpb` from the [latest release](https://github.com/keel-trade/keel-trade/releases/latest) and drag onto Claude Desktop. Cross-platform single bundle — works on macOS, Windows, and Linux.\n\nThe MCPB bundle requires system Python 3.11+ (same prerequisite as the terminal install path below). First launch takes ~10-30 seconds while the bundle pip-installs runtime deps to `~/.keel/mcpb-lib/py3.X/`; subsequent launches are instant.\n\n### Terminal — pipx / uv (Claude Code, Codex, Cursor, Windsurf, etc.)\n\n```bash\npipx install keel-trade\n```\n\n`uv tool install keel-trade` also works. Python 3.11+.\n\nThen register the stdio MCP command with your agent host:\n\n```bash\n# Claude Code\nclaude mcp add keel -- keel mcp serve\n\n# Codex\ncodex mcp add keel -- keel mcp serve\n```\n\nFor Cursor, Windsurf, and generic MCP clients, see [usekeel.io/keel-mcp#install](https://usekeel.io/keel-mcp#install) or the [agent setup guide](https://usekeel.io/docs/sdk/agent-setup).\n\n## First conversation with your agent\n\nAfter install, sign in once via the agent (no terminal commands needed):\n\n> **You:** _\"Connect to Keel.\"_\n>\n> **Agent:** _Calls `keel_auth_login`. Browser opens to app.usekeel.io, you click Allow, tokens land in `~/.keel/config.yaml`. Authenticated for 30 days with transparent refresh._\n\nThen describe what you want:\n\n> **You:** _\"Find me momentum signals for Hyperliquid top-30 perps and compose a backtest from 2024-08-15 to today.\"_\n>\n> **Agent:** _Calls `keel_components_search` → `keel_components_detail_batch` → `keel_strategy_compose` → `keel_backtest_run`. Returns a share URL with the full tearsheet (equity curve, Sharpe, max drawdown, per-asset attribution)._\n\nConcrete example: [this share URL](https://app.usekeel.io/share/gDXjURKqWPs8CZ4eXdqAI?ref=H0O2KN) is a funding-carry backtest produced through exactly this flow — Sharpe 2.17 over 2024-08-15 → 2026-04-30 on real Hyperliquid data.\n\n## What the MCP exposes\n\nThe default toolset spans status, auth, components, strategy lifecycle, backtest, audit, accounts, sharing, and read-only live monitoring. **Live-write tools** (`keel_live_deploy`, `keel_live_control`) require an explicit opt-in toolset plus a local arming step — agents can't deploy your account without you authorizing it twice.\n\nFull per-tool reference: [usekeel.io/docs/sdk/tool-reference](https://usekeel.io/docs/sdk/tool-reference).\n\n## CLI usage\n\nEvery MCP outcome tool has a CLI mirror. Useful for terminals, SSH sessions, CI, scripts, or agents that prefer subprocess calls:\n\n```bash\n# Auth + status\nkeel auth login\nkeel status\n\n# Search components, compose, backtest\nkeel components search \"momentum\"\nkeel strategy compose --source-file my-strategy.py --dry-run\nkeel backtest run str_abc123 --start-date 2024-08-15 --wait\n\n# Inspect a strategy\nkeel strategy get str_abc123\nkeel strategy log str_abc123\n```\n\nFull CLI reference: [usekeel.io/docs/sdk/cli-reference](https://usekeel.io/docs/sdk/cli-reference).\n\n## What you can do with Keel\n\n| Task                                                                           | Surface                                                                                    |\n| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |\n| **Backtest a Hyperliquid strategy** — real fees, funding, slippage, ~220 perps | [usekeel.io/hyperliquid-backtest](https://usekeel.io/hyperliquid-backtest)                 |\n| **Screen HL perps** — momentum, funding, volume, breakout, regime              | [usekeel.io/lab](https://usekeel.io/lab)                                                   |\n| **Use AI to build strategies** — typed composition, not freeform code          | [usekeel.io/ai-trading-strategy-builder](https://usekeel.io/ai-trading-strategy-builder)   |\n| **Backtest portfolios** across the HL universe                                 | [usekeel.io/crypto-portfolio-backtesting](https://usekeel.io/crypto-portfolio-backtesting) |\n| **Robustness diagnostics** — walk-forward, Monte Carlo, deflated Sharpe, PBO   | [usekeel.io/hyperliquid](https://usekeel.io/hyperliquid)                                   |\n| **Deploy a strategy live** on Hyperliquid (non-custodial)                      | [usekeel.io/strategy-os](https://usekeel.io/strategy-os)                                   |\n| **Compare strategies + venues**                                                | [usekeel.io/compare](https://usekeel.io/compare)                                           |\n| **Browse documented trading strategies**                                       | [usekeel.io/strategies](https://usekeel.io/strategies)                                     |\n\n## Documentation\n\n- **Product page**: [usekeel.io/keel-mcp](https://usekeel.io/keel-mcp)\n- **Getting started**: [usekeel.io/docs/getting-started](https://usekeel.io/docs/getting-started)\n- **Agent setup (per host)**: [usekeel.io/docs/sdk/agent-setup](https://usekeel.io/docs/sdk/agent-setup)\n- **CLI reference**: [usekeel.io/docs/sdk/cli-reference](https://usekeel.io/docs/sdk/cli-reference)\n- **MCP tool reference**: [usekeel.io/docs/sdk/tool-reference](https://usekeel.io/docs/sdk/tool-reference)\n- **REST API reference**: [usekeel.io/docs/api-reference](https://usekeel.io/docs/api-reference)\n- **Agent instructions** (canonical, machine-readable): [`AGENTS.md`](AGENTS.md)\n\n## Status\n\nAlpha. The CLI and MCP surface are stable and ship to PyPI on a regular cadence; the underlying engine and component library are actively developed.\n\n## How to contribute / report a bug\n\nSee [`CONTRIBUTING.md`](CONTRIBUTING.md). Short version:\n\n- **Bug report** → open an issue using the bug template\n- **Feature request, question, or pattern share** → use [Discussions](https://github.com/keel-trade/keel-trade/discussions)\n- **Security issue** → email `team@usekeel.io` (do not open a public issue)\n- **Patches** → PRs are welcome; we maintain in a private monorepo so PRs may take longer to land — see CONTRIBUTING for the porting process\n\n## Related\n\n- [Keel on Hyperliquid — the platform](https://usekeel.io)\n- [What is MCP?](https://usekeel.io/learn/what-is-mcp)\n- [AI agents on Hyperliquid — the definitive guide](https://usekeel.io/agent/hyperliquid)\n- [Why we don't put LLMs in the trade loop](https://usekeel.io/learn/agentic-trading)\n\n## License\n\nMIT. See [`LICENSE`](LICENSE).\n\n---\n\n<p align=\"center\">\n  Built by <a href=\"https://usekeel.io/about\">the Keel Research Team</a> · <a href=\"https://x.com/usekeelio\">@usekeelio</a>\n</p>\n",
  "bytes": 12306,
  "sha": "9b927e593dc5bbce29bd723fd09f0f6987884eee3fc1724c60b55da82ca75ea9",
  "repo_slug": "keel-trade/keel-trade",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_keel_trade_keel_trade_196416eb/readme"
}