Skip to main content
The 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:
In this mode the server does not read MAGICMARKETS_API_KEY. Each request sends the caller’s key in an X-Api-Key header:
The address is loopback only by default, and the server has no TLS of its own.

Tools

Read-only by default, 11 tools: With MAGICMARKETS_ALLOW_TRADING=1, eight more:
A client reads the tool list once at startup. After you change 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 when MAGICMARKETS_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:
If that process or the machine stops, the heartbeat expires and every open order on the account closes. Ctrl-C cancels the heartbeat and leaves orders open. With trading enabled, the agent can also manage its own heartbeat with the heartbeat tools. See Safety.

Hosted MCP

MagicMarkets runs a hosted MCP server. You do not install anything.
The hosted server has no read-only default. Trading tools are available to any authenticated client, and place_order spends real money. Use a client that asks before each tool call.

Add it to Claude Code

With OAuth sign-in. The client asks you to sign in to MagicMarkets on first use:
With an API key:
If you also run the local server, give one of the two registrations a different name.

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.