MCP server
ParlayLedger MCP server
Connect Claude, Cursor or any MCP client to ParlayLedger with your API key. Agents get a tool that backtests a betting strategy on ParlayLedger's historical odds and results.
https://api.parlayledger.com/mcp- Transport Streamable HTTP
- Sessions Stateless
- Responses JSON
The server is stateless: every request stands alone, there is no session id and no event stream to resume. Clients send JSON-RPC over POST. GET and DELETE on /mcp return 405.
Authentication
Use the same customer API key as the REST API, from your dashboard. Send it either way:
X-API-Key: <apiKey>Authorization: Bearer <apiKey>
The key must belong to a ParlayLedger account. Every request, including initialize and tools/list, needs a valid key.
Metering
- Each
tools/callis metered as one API call against your monthly quota, with the same quota headers and the same 429 when it runs out. initialize,tools/listandpingare not metered.- Send one
tools/callper HTTP request. A JSON-RPC batch with more than one is rejected with 400. - On top of the API call,
backtest_strategyuses one backtest from your plan's monthly backtest limit.
Connect a client
Put your key in an environment variable, for example PARLAYLEDGER_API_KEY, rather than in a file you commit.
Claude Code
Add it with the CLI, or commit a project .mcp.json that reads the key from the environment. Add --scope user to the CLI command to use it in every project.
claude mcp add --transport http parlayledger https://api.parlayledger.com/mcp \
--header "X-API-Key: $PARLAYLEDGER_API_KEY"Cursor
Add the server to ~/.cursor/mcp.json, or to .cursor/mcp.json in a project.
{
"mcpServers": {
"parlayledger": {
"url": "https://api.parlayledger.com/mcp",
"headers": {
"X-API-Key": "${env:PARLAYLEDGER_API_KEY}"
}
}
}
}Claude Desktop
Two ways to connect. Use whichever your account supports.
Other clients
Most clients that support remote HTTP servers take a URL and headers:
{
"mcpServers": {
"parlayledger": {
"url": "https://api.parlayledger.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Try it with cURL
curl https://api.parlayledger.com/mcp \
-H "X-API-Key: $PARLAYLEDGER_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "backtest_strategy",
"arguments": {
"rules": {
"version": 1, "sport": "icehockey", "league": "NHL", "market": "moneyline", "side": "home",
"conditions": [{ "field": "home_is_favorite", "op": "eq", "value": false }],
"price": { "source": "consensus" }, "stake": { "units": 1 }
}
}
}
}'The result is a JSON-RPC response whose result.content[0].text holds the tool output as JSON.
backtest_strategy
Backtest a sports betting strategy against ParlayLedger historical odds and results. Accepts Rule DSL v1 JSON or the id of a published strategy.
Arguments
Send exactly one of the two.
rulesobject (Rule DSL v1)optionalThe strategy:
version1,league,market(moneyline, spread or total),side, up to sixconditionson pregame fields,priceandstake.publicationIdstringoptionalThe id of a published ParlayLedger strategy.
{
"rules": {
"version": 1,
"sport": "icehockey",
"league": "NHL",
"market": "moneyline",
"side": "home",
"conditions": [
{
"field": "home_is_favorite",
"op": "eq",
"value": false
},
{
"field": "home_prev_result",
"op": "eq",
"value": "loss"
}
],
"price": {
"source": "consensus"
},
"stake": {
"units": 1
}
}
}Rules use pregame information only, so a backtest never sees the result of the game it is betting on.
Result
| Field | Type | Description |
|---|---|---|
sample | number | Graded bets, pushes included. Voids are not bets. |
wins, losses, pushes | number | Results at 1 unit per bet. |
winRate | number | null | Wins over wins plus losses. |
units, roi | number, number | null | Profit in units, and units per bet. |
maxDrawdownUnits | number | Largest peak to trough fall, in units. |
byMonth | array | { month, bets, units } per month. |
window | object | null | { from, to }: the first and last game in the sample. |
warnings | string[] | Codes such as sample_below_minimum or legacy_pricing. |
rulesHash, dataVersion | string | Identify the exact rules and data the run used. |
rules, rulesText | object, string[] | The normalized rules and their plain-English text. |
publicationId | string | Present when you backtested a published strategy. |
Errors and limits
A tool that cannot run returns a result with isError: true and one of these messages:
| Message | What to do |
|---|---|
| You've used this month's backtests. | Wait for next month or upgrade your plan. |
| Send either rules or publicationId. | Pass rules or publicationId, not both. |
| MCP tools need the API key of a ParlayLedger account. | Use the key from your ParlayLedger dashboard. |
HTTP errors come before the tool runs:
- 400Send one tools/call per request.
- 401Valid X-API-Key required, or Invalid API key
- 405GET or DELETE on /mcp
- 429Monthly API quota exceeded