Build
MCP server
Give Claude or any Model Context Protocol framework direct access to Meridian — with a confirmation gate before anything trades.
Install
terminal
claude mcp add meridian -- npx @meridian/mcpSet MERIDIAN_API_KEY in your environment before starting — the server authenticates to the Meridian API with it over stdio transport.
Read tools
These execute immediately, no confirmation required.
| Tool | Description |
|---|---|
| search_markets | Search Polymarket markets by query |
| get_market | Get market detail by id |
| get_orderbook | Get live orderbook for a token |
| get_positions | List open positions |
| get_portfolio | Aggregate portfolio summary |
| get_policy | Read an agent's current risk policy |
Write tools
| Tool | Description |
|---|---|
| build_order_payload | Run the risk engine, return an unsigned payload |
| submit_order | Submit an order — gated behind confirmation, see below |
| cancel_order | Cancel an open order |
| set_policy | Update an agent's risk policy |
submit_order always asks first
Before submitting, the server shows the market, side, size, and price, and waits for explicit approval from the calling agent framework. No response within 30 seconds aborts the submission and returns a timeout — it never fires silently.Transports
Stdio is the default, authenticated via MERIDIAN_API_KEY. Set MCP_TRANSPORT=http to run Streamable HTTP on port 3001 instead — that transport is gated by x402 payment rather than an API key, so anonymous MCP clients can pay per call.
Error handling
Risk rejections and venue errors come back as structured tool errors with a rejection_code and a human-readable description — never a raw stack trace.
error response
{
"rejection_code": "DAILY_VOLUME_EXCEEDED",
"description": "Daily volume limit would be exceeded by this order."
}