Sport Data API
Connect an AI agent (MCP)
Point Claude Code, Claude Desktop or Cursor at the ALT Sports Data warehouse through a read-only MCP server and ask questions in plain English.
Internal and partner use for now
The warehouse MCP server signs in to the warehouse with AWS credentials. External developers are not issued
those credentials today. If you have an asd_live_ or asd_test_ key, use the
REST API or Ask the warehouse. Both
read the same curated data under your key's entitlements.
The warehouse MCP server (asdcheck) lets an AI agent read the curated ALT Sports Data warehouse through the
Model Context Protocol. Once connected, you ask your agent a question such as
"who finished on the podium at the last Supercross round" and the agent picks a tool, runs a read-only query and
answers from the rows that came back.
How it relates to the REST API
Both read the same curated asd_* schemas, so a Supercross event returned by GET /v1/smx/events is the same
row the MCP server sees in asd_smx.events. The paths to that data differ.
| Warehouse Data API (REST) | Warehouse MCP server | |
|---|---|---|
| Who it is for | External developers and products | Internal teams and partners with warehouse access |
| Credential | Authorization: Bearer asd_live_… | AWS IAM credentials for the Redshift Data API |
| Runs where | Hosted at platform-api.altsportsleagues.ai | Locally, as a stdio process your AI client starts |
| Entitlements, credits, rate limits | Enforced per key | Not applied; access is whatever the IAM identity can read |
| Query style | Fixed resources with filters and cursors | Verified named queries, plus one read-only SQL statement |
| Sports modeled | Every sport in the catalog your key is entitled to | Four verticals: smx, wsl, masl, hlr |
Tools
The server exposes eleven tools. Each one returns plain JSON. When something goes wrong (an unknown sport key, a
bad column, a refused statement) the tool returns an error and a hint instead of failing, so the agent can
correct itself on the next turn.
| Tool | Parameters | What it returns |
|---|---|---|
list_sports | none | The four verticals, their schemas and the six backbone tables. Offline, no warehouse call. |
list_queries | none | The catalog of verified, ready-written questions and the argument each one takes. |
declared_model | none | The documented schema contract: backbone tables and core columns. Offline. |
sports_overview | none | Row counts for every backbone table in every vertical. |
sport_schema | sport, optional table | Tables and columns for one vertical. Read this before writing SQL. |
freshness | none | How current each vertical is, from the warehouse's own ops.freshness view. |
run_named_query | query, optional argument, limit (default 200) | Rows for one entry from list_queries, plus the true row_count. |
run_sql | sql, limit (default 200) | Rows for one read-only SQL statement, plus the true row_count. |
list_checks | optional group | The data-quality check inventory, without running anything. |
run_checks | optional sport, group, check, jobs (default 8) | Pass, fail and error verdicts from the data-quality suite. A full run is slow. |
verify_contract | sport | Missing backbone tables and core columns, comparing the documented contract with the live warehouse. |
Valid sport values are smx (Supercross and Motocross), wsl (World Surf League), masl (Major Arena Soccer
League) and hlr (High Limit Racing). In masl a competitor is a team; in the other three it is an athlete.
Verified questions
list_queries currently returns 14 entries. Agents are instructed to prefer these over writing SQL, because each
one is already checked against the real schema.
| Key | Question | Argument |
|---|---|---|
latest_smx_standings | Latest SMX event, rider standings with hometown | none |
latest_smx_motos | Latest SMX event, moto-by-moto detail | none |
rider_career | One rider's career history | rider name |
roster | Competitor roster for one league | sport key |
recent_events | Recent events across all four leagues | months back |
status_vocabulary | How each sport records a non-finish | none |
freshness | Data freshness by sport | none |
audit_failures | Failing checks in the newest audit run | none |
top_by_participation | Competitors ranked by events entered | sport, optional year |
events_in_year | One sport's calendar for a single year | sport and year, such as smx 2025 |
venues | Where a sport competed | sport, optional year |
current_season | The latest season that has events | sport key |
competition_field | The field of one competition, with finish positions | sport, optional competition id |
head_to_head | Two competitors, only the competitions they both entered | smx Cooper Webb|Justin Cooper |
Read-only by design
run_sql accepts a single SELECT, WITH, SHOW, EXPLAIN or VALUES statement. DDL, DML and
multi-statement submissions are refused before anything reaches the warehouse, and the refusal comes back to the
agent as a structured error that names the rejected SQL. The guard sits below the MCP layer, so it applies no
matter what the model writes.
Set up
Get warehouse credentials
You need an AWS access key pair with read access to the warehouse through the Redshift Data API. The ALT Sports Data data team issues these. There is no database password or connection string; authentication is AWS IAM.
The launcher reads two values from the platform app's .env file (or from your normal AWS credential chain if
they are already set):
| Variable | Required | Purpose |
|---|---|---|
AWS_ACCESS_KEY_ID | Yes | IAM access key for the Redshift Data API |
AWS_SECRET_ACCESS_KEY | Yes | Matching secret |
REGION | No | Overrides the built-in warehouse region |
WORKGROUP | No | Overrides the built-in Redshift Serverless workgroup |
DATABASE | No | Overrides the built-in database name |
Keep these values in .env or your AWS profile. Never paste them into an MCP client config or a chat.
Install the engine with the MCP extra
The server ships in the platform repository as the asdcheck package. Install uv,
then from the repository root:
uv sync --project apps/asd-altsportsdata-data-product-redshift-platform.altsportsdata.com/app/clients/asd-warehouse-engine --extra mcpThe mcp extra adds fastmcp. Everything else in asdcheck runs on boto3 alone.
Register the server with your client
The launch command is asd warehouse mcp, run through the asd CLI. It bridges your AWS credentials from
.env, then starts the server over stdio. Replace /path/to/asd-cli below with the absolute path to
app/clients/asd-cli inside the platform app.
claude mcp add asdcheck-redshift -- \
uv run --project /path/to/asd-cli python -m asd warehouse mcpRun claude mcp list to confirm it shows as connected.
Add this to claude_desktop_config.json (on macOS, under ~/Library/Application Support/Claude/), then
restart Claude Desktop.
{
"mcpServers": {
"asdcheck-redshift": {
"command": "uv",
"args": ["run", "--project", "/path/to/asd-cli", "python", "-m", "asd", "warehouse", "mcp"]
}
}
}Desktop apps often start with a short PATH. If the server fails to start, set command to the absolute
path of uv (run which uv to find it).
Add this to .cursor/mcp.json in your project (or ~/.cursor/mcp.json for every project), then enable the
server under Settings → MCP.
{
"mcpServers": {
"asdcheck-redshift": {
"command": "uv",
"args": ["run", "--project", "/path/to/asd-cli", "python", "-m", "asd", "warehouse", "mcp"]
}
}
}If you only have the engine and your AWS credentials are already in your environment or AWS profile, you can
skip the asd CLI and launch the engine directly:
uv run --project /path/to/asd-warehouse-engine --extra mcp python -m asdcheck mcp.
Ask a first question
Start a new conversation and ask "Which sports can you see in the warehouse?" The agent should call
list_sports and answer with the four verticals. That call needs no warehouse round trip, so it confirms the
server is wired up. A follow-up such as "How fresh is each sport?" confirms your credentials reach the warehouse.
Example prompts
These map cleanly onto the verified questions, so the agent can answer without writing SQL of its own.
- "Show me the overall standings from the most recent Supercross event, with each rider's hometown."
The agent runs
latest_smx_standings. - "Compare Cooper Webb and Justin Cooper in every SMX race they both entered."
The agent runs
head_to_headwithsmx Cooper Webb|Justin Cooper. - "Is any sport behind on data, and did the latest audit flag anything?"
The agent combines
freshnesswithaudit_failures, and may narrow further withrun_checks.
Limits
- Credentials. The server needs AWS IAM access to the warehouse. External developers do not have this today,
so the REST API at
platform-api.altsportsleagues.airemains the supported external path. - Four verticals. Tools that take a
sportacceptsmx,wsl,maslandhlronly. Other sports in the REST catalog are not modeled by this server. - Local process. The server runs on your machine over stdio. There is no hosted endpoint for it yet.
- No key-level controls. Entitlements, credit metering and rate limits belong to the REST API. The MCP server does not apply them; the IAM identity's warehouse permissions are the only boundary.
- Row limits. Query tools return 200 rows by default.
row_countalways reports the true total, so a truncated answer is visible as truncated. - Slow checks.
run_checkswith no filters runs the full data-quality suite across all four verticals. Passsportorgroupwhen the question is specific.