Skip to main content
worm-mcp is Worm’s official Model Context Protocol server. It exposes 38 tools so AI agents in Cursor, Claude Code, Claude Desktop, and other MCP clients can query markets, manage positions, and trade — all over stdio with local Solana signing.

GitHub

Source, issues, and developer setup.

PyPI

pip install worm-mcp or launch via uvx.

How it works

Your MCP client launches worm-mcp as a subprocess. Public market tools work with no credentials. Set WALLET_PRIVATE_KEY to enable authenticated reads and trading — the server bootstraps HMAC credentials on first run and caches them locally.
Requirements: Python 3.10+, an MCP client, and uv (or pipx / pip). A funded Solana wallet is only needed for trading and other authenticated write tools.

Installation

worm-mcp runs over stdio — your client launches it on demand. Omit WALLET_PRIVATE_KEY to use only public, read-only tools.

Cursor

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project), then enable it under Settings → MCP:

Claude Code

Register once from the CLI; --scope user makes it available in every project:
Confirm with claude mcp list (shows worm … ✓ Connected).

Claude Desktop

Settings → Developer → Edit Config opens claude_desktop_config.json. Add the same mcpServers block and restart the app.

Other clients

Windsurf, Cline, Zed, VS Code, and others use the same launch config — only the config file location differs. Alternatives if you don’t have uv:

Developer setup

Clone the repo for local development or an unpublished build:
Point your client at the editable checkout with --with-editable, or set command to the venv binary directly. See the GitHub README for full developer config examples.

Environment variables

Use a dedicated wallet funded with only what you intend to trade. Never commit private keys to version control or shared configs.

Tools

Public (no credentials)

Authenticated read (HMAC)

Authenticated write (HMAC)

Authenticated write: local signing

Requires WALLET_PRIVATE_KEY.

Notes for agents

  • Spot vs margin: place_order is for non-margin (orderbook) markets. Use open_margin_position when margin_enabled=true. Margin markets quote against an AMM, so get_orderbook may be empty — size with estimate_margin_position.
  • Margin lifecycle: open_margin_position returns a position-request pubkey. The actual position appears via list_margin_positions (match position_request_pubkey) once funding completes. TP/SL is unsupported on Hyperliquid-backed markets.
  • Leverage: always call estimate_margin_position and confirm with the user before opening. Leverage carries liquidation risk.
  • Docs on demand: call read_worm_docs with no arguments for the index, then pass a path for exact API schemas and examples.

Security

  • Your private key is used only to sign transactions locally — it is never sent to the Worm API or any third party.
  • Bootstrapped HMAC credentials are cached at ~/.worm/config.json with 0600 permissions, keyed by API base URL and wallet. Writes are atomic and locked so concurrent clients can’t corrupt cached credentials.

Verify

After enabling the server and restarting your client:
  • Public: ask “List trending markets on Worm”
  • Authenticated: ask “What’s my Worm account summary?”
A sensible answer means the server is wired up correctly.

Troubleshooting

Install uv, or use pipx run worm-mcp / pip install worm-mcp.
Fully restart the client — it spawns the server once at startup. In Claude Code, check claude mcp list.
Confirm WALLET_PRIVATE_KEY is a valid base58 Solana key. Delete ~/.worm/config.json to force a fresh credential bootstrap.

Next steps

Python SDK

Build custom integrations with worm-sdk.

Authentication

HMAC signing and API key bootstrap details.