magicmarkets binary serves the Model Context Protocol over stdio, or over HTTP on localhost. Point an agent at it and the agent can list events, read offers, check your balance and position, and, only if you allow it, quote and place orders.
The local server is read-only by default. Trading tools appear only when you set MAGICMARKETS_ALLOW_TRADING=1. MagicMarkets also runs a hosted MCP server that needs no install and has no read-only default.
The MCP server is in developer mode, and its tool set may still change. Install the CLI first. If a client cannot find
magicmarkets, put the absolute path from which magicmarkets in command.Add it to Claude Code
Add it to any MCP client
Serve over localhost HTTP
One long-running server can serve several clients:MAGICMARKETS_API_KEY. Each request sends the caller’s key in an X-Api-Key header:
Tools
Read-only by default, 11 tools:
With
MAGICMARKETS_ALLOW_TRADING=1, eight more:
MAGICMARKETS_ALLOW_TRADING, replace the registration and restart the client. Run magicmarkets mcp --print-tools to list what is registered with your current settings.
Why read-only by default
The trading tools are registered only whenMAGICMARKETS_ALLOW_TRADING is set as the server starts, so a prompt cannot switch them on. The tools that spend money or close orders carry MCP destructive hints, so a client that honours hints asks before it calls them.
Pairing with a heartbeat
If you let an agent trade, run a heartbeat in a separate terminal:Hosted MCP
MagicMarkets runs a hosted MCP server. You do not install anything.Add it to Claude Code
With OAuth sign-in. The client asks you to sign in to MagicMarkets on first use:OAuth for other clients
The server uses the OAuth 2.1 authorization code flow with PKCE (S256), dynamic client registration and the scope mcp. A client discovers the details at https://magicmarkets.com/.well-known/oauth-protected-resource and https://magicmarkets.com/.well-known/oauth-authorization-server.
Tools
The hosted server exposes the same 19 tools as the local server: the 11 tools in the first table and the 8 trading tools in the second. All 19 are available as soon as a client authenticates.Hosted or local
This server trades on your account. It is separate from the docs MCP server at
magicmarkets.com/docs/mcp, which only searches and reads these docs. See Machine-readable docs.
