
sharpapi-mcp
io.github.Sharp-API/sharpapi-mcp
Live sports betting odds, +EV, arbitrage, middles and betting splits from SharpAPI.
Documentation
SharpAPI MCP Server
MCP server for SharpAPI. Exposes live sports betting odds, +EV, arbitrage, middles and betting splits as Model Context Protocol tools, for compatible AI applications to query sports betting data.
Documentation · Get a free key · Pricing · Changelog
Built on the official MCP TypeScript SDK v2. It speaks the current MCP revision (2026-07-28) and the 2025-era revisions, over stdio and over Streamable HTTP. Requires Node.js 20 or later.
Two ways to connect
Hosted, nothing to install. SharpAPI runs an MCP server at https://mcp.sharpapi.io/mcp. Add it to your app as a remote server and send your key in an X-API-Key header. The documentation has the setup for each app.
Local, this package. Run npx -y @sharp-api/mcp-server with SHARPAPI_KEY set. The rest of this page is about the package.
Both read the same API with your key, under your plan. Six tools are named differently on the two servers; the list is at the end of Tools.
Install
Install the npm package globally, which puts sharpapi-mcp on your PATH:
npm install -g @sharp-api/mcp-server
Or run it without installing:
npx -y @sharp-api/mcp-server
To run from source instead, use the GitHub repository:
npx github:Sharp-API/SharpAPI-MCP
Configure
Set SHARPAPI_KEY in the environment. Get a free key at https://sharpapi.io; the free tier serves pre-match odds from DraftKings and FanDuel with a 60-second delay, at 12 requests/min, with no card.
The key is read from the environment only. There is deliberately no way to pass it as a tool argument: tool arguments are model-generated and end up in transcripts and logs.
Claude Code:
claude mcp add SharpAPI -e SHARPAPI_KEY=sk_your_key_here -- npx -y @sharp-api/mcp-server
Codex:
codex mcp add SharpAPI --env SHARPAPI_KEY=sk_your_key_here -- npx -y @sharp-api/mcp-server
Claude Desktop (claude_desktop_config.json) and Cursor (~/.cursor/mcp.json, or .cursor/mcp.json in a project), running the npm package through npx:
{
"mcpServers": {
"SharpAPI": {
"command": "npx",
"args": ["-y", "@sharp-api/mcp-server"],
"env": { "SHARPAPI_KEY": "sk_your_key_here" }
}
}
}
With the global install, call the sharpapi-mcp binary directly:
{
"mcpServers": {
"SharpAPI": {
"command": "sharpapi-mcp",
"env": { "SHARPAPI_KEY": "sk_your_key_here" }
}
}
}
Try it
Once the server is connected, ask your assistant:
- "What sports have live events right now?"
- "Show me NBA odds for tonight's games on DraftKings."
- "Find arbitrage opportunities in soccer with at least 1% profit."
- "Compare the odds for the Chiefs game across all books."
- "What plan is my key on, and what can it call?"
Run as a remote (HTTP) server
The same tools can be served over Streamable HTTP for clients that connect by URL. This entry point is a separate script (dist/http.js), not the sharpapi-mcp binary. From a clone:
npm ci && npm run build
SHARPAPI_BASE_URL=https://api.sharpapi.io npm run start:http
# listening on http://127.0.0.1:8787/mcp
Each caller sends their own SharpAPI key with every request, in an Authorization: Bearer <key> header or in X-API-Key. The server holds no key of its own and refuses to start if SHARPAPI_KEY is set, so every API call runs under the caller's own plan and rate limits.
| variable | meaning | default |
|---|---|---|
SHARPAPI_BASE_URL | API base URL the server calls (required) | none |
MCP_ALLOWED_HOSTS | Host header names accepted, comma-separated | localhost,127.0.0.1 |
MCP_ALLOWED_ORIGINS | Origin host names accepted; a request with any other Origin gets 403 | none |
MCP_HOST, MCP_PORT | listen address | 127.0.0.1, 8787 |
What it refuses, without calling the API:
- a request with no key (401), or with a key in the URL: any query string on
/mcpis rejected (400); - an unlisted
HostorOrigin(403), and anything butPOST /mcp(GET /healthzanswers a liveness probe); - a key the API rejected in the last minute, and further requests from an address that has sent 10 rejected keys in 5 minutes (429);
- more than 4 concurrent requests per key or 64 in total, and request bodies over 64 KiB.
Each tool call makes exactly one API request, with no retries. The server writes one JSON line per request to stdout: time, client address, MCP method, tool name, client name and version, the first 12 characters of the key (never more than half of it), HTTP and API status, latency and result size. It never logs the full key, request headers, the query string, tool arguments or results.
Tools
Reference lists:
| tool | what it does | plan |
|---|---|---|
list_sports | Sports covered, with live/upcoming counts. Start here to find valid sport ids. | any |
get_leagues | League ids with their sport and event counts. Pass sport to list one sport. | any |
list_sportsbooks | Book ids for the sportsbook argument. | any |
get_markets | Market ids (moneyline, point_spread, ...) for the market argument, with the books pricing each. Scope with league or sport. | any |
get_market_types | The shape of each market type's selections, with stable numeric ids. | any |
get_account_info | The plan, rate limit and features of the key in use. | any |
Events and odds:
| tool | what it does | plan |
|---|---|---|
list_events | Events with ids, start times, teams. | any |
get_odds | Normalized odds across books: American, decimal, implied probability. Paginated: pass pagination.next_cursor back as cursor. | any |
get_odds_delta | Only the odds that changed since a timestamp (10 minutes back at most). The list of removed odds is left out unless include_removed is true. | any |
get_best_odds | Best price per selection across books. The line-shopping view. | any |
compare_odds | One event's prices side by side across books, one row per market, selection and line. Pass market to compare one market. | any |
get_event_odds | The odds for one event across books, in one call with no pagination. Pass sportsbook to read one book. Takes an event id from list_events. | any |
get_closing_lines | Each book's last pre-match prices for an event, with no-vig and fair closing probabilities, for closing-line value (CLV). Pass sportsbook and market. | Pro+ |
get_splits | Public betting splits: share of bets (bets_pct) and of money (handle_pct) on each side of the spread, total and moneyline. sportsbook: "consensus" is the deduplicated row. Paginated: pass pagination.next_offset back as offset. | Pro+ |
Opportunities:
| tool | what it does | plan |
|---|---|---|
get_arbitrage | Cross-book arbitrage: combined implied probability under 100%. | Hobby+ |
get_ev | +EV bets against fair probability. Carries fair_probability, the de-vigged number. | Pro+ |
get_middles | Two-sided gaps where both bets can win. | Pro+ |
find_low_hold | The tightest lines across books: lowest combined margin (hold_percentage). | Pro+ |
Futures:
| tool | what it does | plan |
|---|---|---|
get_futures | Season-long markets (championship and division winners, MVP and other awards, win totals) with their ids. | Enterprise |
get_futures_odds | Odds on futures, grouped by future. Takes a future_id from get_futures, or a league. | Enterprise |
compare_futures_lines | One future side by side across books. | Enterprise |
The API enforces plan requirements. The server returns API errors unchanged, including details about the required tier.
Answers are compact JSON. Three tools read routes that return everything held for one event, with no page size: get_event_odds, compare_odds and get_closing_lines. For a busy game that is thousands of rows, so an answer over about 100 kB is cut to its first rows and carries a truncated note: which lists were cut, how many rows each kept of how many, and how to ask for less. compare_odds and get_closing_lines narrow by market in this server, matching the id whole against each row's market_type; when nothing matches, the answer lists the ids the event does carry as available_markets. Paginated tools are never cut: use their limit and cursor or offset.
There is no separate no-vig tool. SharpAPI does not expose de-vigged odds as its own endpoint; the fair number arrives as fair_probability on each get_ev opportunity.
The hosted server at https://mcp.sharpapi.io/mcp has 21 tools as well. Fifteen share a name with this package; six are named differently:
list_sportshere isget_sportstherelist_sportsbookshere isget_sportsbookstherelist_eventshere isget_eventsthereget_evhere isfind_ev_opportunitiesthereget_arbitragehere isfind_arbitragethereget_middleshere isfind_middlesthere
Notes
- Tool errors are returned with
isErrorso clients can handle rate limits and plan requirements. - Diagnostics are written to stderr; in stdio mode stdout is reserved for the MCP protocol.
Support
Questions and bug reports: open an issue or write to support@sharpapi.io. To report a security problem, see SECURITY.md.
License
MIT
@sharp-api/mcp-servernpm install @sharp-api/mcp-server