sharpapi-mcp
Official# SharpAPI MCP Server
[](https://www.npmjs.com/package/@sharp-api/mcp-server)
[](https://mcpservers.org/servers/sharp-api/sharpapi-mcp)
MCP server for [SharpAPI](https://sharpapi.io). 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](https://docs.sharpapi.io/en/sdks/mcp) · [Get a free key](https://sharpapi.io) · [Pricing](https://sharpapi.io/pricing) · [Changelog](CHANGELOG.md)
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](https://docs.sharpapi.io/en/sdks/mcp) 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](#tools).
## Install
Install the [npm package](https://www.npmjs.com/package/@sharp-api/mcp-server) globally, which puts `sharpapi-mcp` on your PATH:
```bash
npm install -g @sharp-api/mcp-server
```
Or run it without installing:
```bash
npx -y @sharp-api/mcp-server
```
To run from source instead, use the GitHub repository:
```bash
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:
```bash
claude mcp add SharpAPI -e SHARPAPI_KEY=sk_your_key_here -- npx -y @sharp-api/mcp-server
```
Codex:
```bash
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`:
```json
{
"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:
```json
{
"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:
```bash
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 `/mcp` is rejected (400);
- an unlisted `Host` or `Origin` (403), and anything but `POST /mcp` (`GET /healthz` answers 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_sports` here is `get_sports` there
- `list_sportsbooks` here is `get_sportsbooks` there
- `list_events` here is `get_events` there
- `get_ev` here is `find_ev_opportunities` there
- `get_arbitrage` here is `find_arbitrage` there
- `get_middles` here is `find_middles` there
## Notes
- Tool errors are returned with `isError` so 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](https://github.com/Sharp-API/SharpAPI-MCP/issues) or write to support@sharpapi.io. To report a security problem, see [SECURITY.md](SECURITY.md).
## License
MIT
TDQS
Scored across 21 tools
Most tools target clearly distinct resources (splits, closing lines, arbitrage, EV, middles, account, discovery lists), but the odds family overlaps heavily: get_odds, get_event_odds and compare_odds all return per-book prices for an event, and compare_futures_lines is explicitly documented as 'same data as get_futures_odds, for one future'. The descriptions do include helpful cross-references ('use get_odds with event, market and cursor'), which keeps this from being worse, but an agent still has to reason about response shape and pagination rather than purpose when picking among them.
Every tool is snake_case with a leading verb (list_, get_, compare_, find_), and the verb choice is semantically meaningful: list_ for discovery, get_ for retrieval, compare_ for side-by-side views, find_ for opportunity scans. No camelCase or ad-hoc naming anywhere.
21 tools is on the heavy side, but the surface spans a genuinely broad product: six id-discovery tools, a large odds family, futures, analytics (arb/EV/middles/low-hold), splits, closing lines and account introspection. Each tool maps to a distinct capability rather than being padding, though the odds family could plausibly be consolidated into fewer parameterized tools.
The read-only lifecycle is well covered: discovery of sports/sportsbooks/leagues/markets/market types/events, live odds, best odds, deltas, closing lines, splits, futures and derived analytics, plus account/plan introspection. Minor gaps remain: get_futures_odds takes a team_id but there is no list_teams (or list_players) tool to resolve ids, and no search-by-name lookup, so agents must rely on free-text selection strings.