mcp-server-espn 2.3.2__tar.gz → 2.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/.github/workflows/ci.yml +64 -1
  2. mcp_server_espn-2.4.0/AGENTS.md +128 -0
  3. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/Dockerfile +2 -2
  4. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/PKG-INFO +27 -6
  5. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/README.md +25 -4
  6. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/docker/pip-bootstrap.txt +2 -2
  7. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/docker/uv-bootstrap.txt +1 -1
  8. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/fastmcp.json +1 -1
  9. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/pyproject.toml +1 -1
  10. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/scripts/check_openapi_drift.py +357 -14
  11. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/scripts/check_tool_contract.py +21 -2
  12. mcp_server_espn-2.4.0/scripts/espn_routes_snapshot.tsv +516 -0
  13. mcp_server_espn-2.4.0/scripts/espn_site_routes.txt +28 -0
  14. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/src/espn_mcp/client.py +444 -0
  15. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/src/espn_mcp/server.py +38 -0
  16. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/src/espn_mcp/tools/__init__.py +38 -0
  17. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/src/espn_mcp/tools/games.py +206 -0
  18. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/src/espn_mcp/tools/news.py +3 -1
  19. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/src/espn_mcp/tools/params.py +15 -0
  20. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/src/espn_mcp/tools/teams.py +155 -1
  21. mcp_server_espn-2.4.0/tests/fixtures/coverage/award.json +19 -0
  22. mcp_server_espn-2.4.0/tests/fixtures/coverage/awards.json +14 -0
  23. mcp_server_espn-2.4.0/tests/fixtures/coverage/bet_type.json +4 -0
  24. mcp_server_espn-2.4.0/tests/fixtures/coverage/bets_featured.json +4 -0
  25. mcp_server_espn-2.4.0/tests/fixtures/coverage/bets_trending.json +22 -0
  26. mcp_server_espn-2.4.0/tests/fixtures/coverage/coach.json +23 -0
  27. mcp_server_espn-2.4.0/tests/fixtures/coverage/coaches.json +13 -0
  28. mcp_server_espn-2.4.0/tests/fixtures/coverage/drive_plays.json +33 -0
  29. mcp_server_espn-2.4.0/tests/fixtures/coverage/drives.json +51 -0
  30. mcp_server_espn-2.4.0/tests/fixtures/coverage/franchise.json +21 -0
  31. mcp_server_espn-2.4.0/tests/fixtures/coverage/franchises.json +14 -0
  32. mcp_server_espn-2.4.0/tests/fixtures/coverage/golf_tournament.json +8 -0
  33. mcp_server_espn-2.4.0/tests/fixtures/coverage/golf_tournaments.json +11 -0
  34. mcp_server_espn-2.4.0/tests/fixtures/coverage/history.json +30 -0
  35. mcp_server_espn-2.4.0/tests/fixtures/coverage/history_nfl_error.json +1 -0
  36. mcp_server_espn-2.4.0/tests/fixtures/coverage/injuries.json +33 -0
  37. mcp_server_espn-2.4.0/tests/fixtures/coverage/league.json +5 -0
  38. mcp_server_espn-2.4.0/tests/fixtures/coverage/not_found_error.json +1 -0
  39. mcp_server_espn-2.4.0/tests/fixtures/coverage/qbr.json +21 -0
  40. mcp_server_espn-2.4.0/tests/fixtures/coverage/qbr_week.json +50 -0
  41. mcp_server_espn-2.4.0/tests/fixtures/coverage/rankings.json +11 -0
  42. mcp_server_espn-2.4.0/tests/fixtures/coverage/recruits.json +11 -0
  43. mcp_server_espn-2.4.0/tests/fixtures/coverage/venue.json +12 -0
  44. mcp_server_espn-2.4.0/tests/fixtures/coverage/venues.json +11 -0
  45. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_ci_workflow.py +20 -0
  46. mcp_server_espn-2.4.0/tests/test_coverage_routes.py +390 -0
  47. mcp_server_espn-2.4.0/tests/test_drift.py +625 -0
  48. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_layered.py +4 -4
  49. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_live.py +33 -0
  50. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_protocol.py +3 -3
  51. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/uv.lock +7 -7
  52. mcp_server_espn-2.3.2/AGENTS.md +0 -150
  53. mcp_server_espn-2.3.2/tests/test_drift.py +0 -255
  54. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/.github/CODEOWNERS +0 -0
  55. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/.github/dependabot.yml +0 -0
  56. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/.github/workflows/dependabot-automerge.yml +0 -0
  57. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/.github/workflows/release.yml +0 -0
  58. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/.gitignore +0 -0
  59. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/CHANGELOG.md +0 -0
  60. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/CODE_OF_CONDUCT.md +0 -0
  61. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/CONTRIBUTING.md +0 -0
  62. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/LICENSE +0 -0
  63. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/SECURITY.md +0 -0
  64. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/conformance-baseline.yml +0 -0
  65. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/docker/build-backend.txt +0 -0
  66. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/scripts/check_conformance.sh +0 -0
  67. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/scripts/check_version.py +0 -0
  68. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/scripts/gen_build_backend.py +0 -0
  69. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/scripts/release_notes.py +0 -0
  70. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/scripts/setup_repo_governance.sh +0 -0
  71. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/server.json +0 -0
  72. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/src/espn_mcp/__init__.py +0 -0
  73. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/src/espn_mcp/auth.py +0 -0
  74. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/src/espn_mcp/config.py +0 -0
  75. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/src/espn_mcp/errors.py +0 -0
  76. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/src/espn_mcp/middleware.py +0 -0
  77. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/conftest.py +0 -0
  78. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/fake_network.py +0 -0
  79. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/fixtures/mlb_yankees_schedule_2023.json +0 -0
  80. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_build_backend_lock.py +0 -0
  81. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_check_version.py +0 -0
  82. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_client.py +0 -0
  83. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_config.py +0 -0
  84. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_conftest_live_gate.py +0 -0
  85. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_dockerfile.py +0 -0
  86. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_e2e_isolation.py +0 -0
  87. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_errors.py +0 -0
  88. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_eval_search_fixes.py +0 -0
  89. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_fastmcp_json_floor.py +0 -0
  90. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_http_auth.py +0 -0
  91. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_league_events_dates.py +0 -0
  92. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_otel_spans.py +0 -0
  93. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_redaction.py +0 -0
  94. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_redaction_linear.py +0 -0
  95. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_redaction_probes.py +0 -0
  96. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_redaction_python_repr.py +0 -0
  97. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_release_notes.py +0 -0
  98. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_release_workflow.py +0 -0
  99. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_retry_after.py +0 -0
  100. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_scoreboard_date_ranges.py +0 -0
  101. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_server.py +0 -0
  102. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_upstream_http_errors.py +0 -0
  103. {mcp_server_espn-2.3.2 → mcp_server_espn-2.4.0}/tests/test_version.py +0 -0
@@ -326,8 +326,10 @@ jobs:
326
326
  name: Check API Drift
327
327
  # Scheduled and manual runs only; pushes and pull requests skip it.
328
328
  if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
329
+ # Only this job can open issues, and only when the scheduled scan reports drift or fails.
329
330
  permissions:
330
331
  contents: read
332
+ issues: write
331
333
  runs-on: ubuntu-latest
332
334
  steps:
333
335
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -352,4 +354,65 @@ jobs:
352
354
  run: uv sync --locked --extra dev --python 3.11
353
355
 
354
356
  - name: Run OpenAPI drift detection
355
- run: uv run python scripts/check_openapi_drift.py
357
+ id: drift-check
358
+ run: |
359
+ # Capture the exit code explicitly: under the default `bash -e` a failing
360
+ # command would end the step before DRIFT_STATUS is written.
361
+ set +e
362
+ uv run python scripts/check_openapi_drift.py --fail-on-new-uncovered > drift_results.txt 2>&1
363
+ status=$?
364
+ set -e
365
+ echo "DRIFT_STATUS=${status}" >> "$GITHUB_ENV"
366
+ cat drift_results.txt
367
+
368
+ - name: Create Issue on Failure
369
+ if: env.DRIFT_STATUS != '0' && github.ref == 'refs/heads/main'
370
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
371
+ with:
372
+ script: |
373
+ const fs = require('fs');
374
+ let driftOutput = "No output captured.";
375
+ try {
376
+ driftOutput = fs.readFileSync('drift_results.txt', 'utf8');
377
+ } catch (err) {
378
+ console.error(err);
379
+ }
380
+
381
+ const status = process.env.DRIFT_STATUS;
382
+ const uncovered = driftOutput.includes('❌ New uncovered');
383
+ const dead = driftOutput.includes('❌ Dead site route');
384
+ let issueTitle;
385
+ let summary;
386
+ if (status === '1' && uncovered && dead) {
387
+ issueTitle = "ESPN drift: new uncovered routes and a dead site route";
388
+ summary = "The drift scan found new uncovered ESPN routes and a site route that is no longer live.";
389
+ } else if (status === '1' && uncovered) {
390
+ issueTitle = "ESPN drift: new uncovered routes";
391
+ summary = "The drift scan found ESPN routes that are not covered and not in the baseline.";
392
+ } else if (status === '1' && dead) {
393
+ issueTitle = "ESPN drift: dead site route";
394
+ summary = "The drift scan found a site route that did not answer 200.";
395
+ } else {
396
+ issueTitle = `espn drift monitor failed (exit ${status})`;
397
+ summary = `The drift scan exited ${status}.`;
398
+ }
399
+ const issueBody = [
400
+ "### ESPN Drift Monitor",
401
+ "",
402
+ summary,
403
+ "",
404
+ "#### Scan Output",
405
+ "```text",
406
+ driftOutput,
407
+ "```",
408
+ "",
409
+ "Inspect the output. New core routes belong in scripts/espn_routes_snapshot.tsv as covered, gap, or excluded. A dead site sample belongs in scripts/espn_site_routes.txt.",
410
+ ].join("\n");
411
+
412
+ await github.rest.issues.create({
413
+ owner: context.repo.owner,
414
+ repo: context.repo.repo,
415
+ title: issueTitle,
416
+ body: issueBody,
417
+ labels: ['forge-todo']
418
+ });
@@ -0,0 +1,128 @@
1
+ # AGENTS.md
2
+
3
+ Instructions for AI coding agents working on `mcp-server-espn`.
4
+
5
+ ---
6
+
7
+ ## 🎯 Project Overview
8
+
9
+ `mcp-server-espn` is an enterprise Model Context Protocol (MCP) server exposing real-time scores, play-by-play data, rosters, player statistics, betting odds, and prediction market resolution data from ESPN's public APIs. Built on FastMCP 4 Server Composition over stdio and Streamable HTTP (`scripts/check_tool_contract.py` defines expected tools).
10
+
11
+ ---
12
+
13
+ ## 📚 Canonical Documentation & Live Doc MCPs
14
+
15
+ Always consult the official machine-readable indexes and live documentation MCP servers before designing or changing tools:
16
+
17
+ | Resource | `llms.txt` index | Focus |
18
+ | :--- | :--- | :--- |
19
+ | **FastMCP 4 Framework** | [`https://gofastmcp.com/llms.txt`](https://gofastmcp.com/llms.txt) | `mount`, hierarchical middleware, `ToolTransform`, `ToolSearch`, lifespans, in-memory testing |
20
+ | **Model Context Protocol (Official)** | [`https://modelcontextprotocol.io/llms.txt`](https://modelcontextprotocol.io/llms.txt) | Spec 2026-07-28, Streamable HTTP framing, annotations, elicitation, catalog caching |
21
+
22
+ Live doc MCP endpoints: `https://gofastmcp.com/mcp` (`search_fast_mcp`, `query_docs_filesystem_fast_mcp`) and `https://modelcontextprotocol.io/mcp` (`search_model_context_protocol`, `query_docs_filesystem_model_context_protocol`).
23
+
24
+ ---
25
+
26
+ ## 🏗️ Key Paths
27
+
28
+ - `src/espn_mcp/server.py` — root FastMCP server mounting `games`, `teams`, and `news` sub-servers with matching namespaces; resources, prompts.
29
+ - `src/espn_mcp/tools/{games,teams,news}.py` — domain sub-servers holding all tools; re-exported from `tools/__init__.py`.
30
+ - `src/espn_mcp/client.py` — async `ESPNClient` (pooling, retries, path encoding, league aliases).
31
+ - `src/espn_mcp/{auth,errors,middleware,config}.py` — `ESPN_MCP_AUTH_TOKEN` bearer verifier + tokenless non-localhost HTTP bind refusal, typed errors & redaction, parent/child middleware, Pydantic settings (cache TTLs, profile, ports).
32
+ - `scripts/check_tool_contract.py` — source of truth for expected tools and annotations (never hard-code counts elsewhere).
33
+ - `scripts/check_openapi_drift.py` (the PR path checks client calls against `DEFAULT_ESPN_SPEC`; `--fail-on-new-uncovered` diffs the core WADLs against `scripts/espn_routes_snapshot.tsv` and liveness-checks `scripts/espn_site_routes.txt`), `scripts/check_conformance.sh` + `conformance-baseline.yml`, `scripts/release_notes.py`, `scripts/check_version.py` (rejects `0.0.0` / `0.0.1.devN` from missing git metadata or shallow checkouts).
34
+ - `tests/` — offline unit, layered-composition, and protocol tests; live checks (`-m live`) require no credentials against ESPN's public API (`uv run pytest -m live --no-cov`).
35
+ - `.github/workflows/` — `ci.yml`, `release.yml`, `dependabot-automerge.yml`.
36
+ - `server.json`, `Dockerfile`, `fastmcp.json`, `pyproject.toml` (console scripts `mcp-server-espn` matching `server.json` identifier, and `espn-mcp` used by README configs and `Dockerfile`).
37
+
38
+ ---
39
+
40
+ ## ⚡ Canonical Workflow: Adding a Tool for an Endpoint
41
+
42
+ 1. **Client method (`src/espn_mcp/client.py`):** add strictly typed `async def` method on `ESPNClient`, normalize league/sport aliases (e.g., `nfl` → `sport="football", league="nfl"`), and sanitize URL path segments with `quote(str(seg), safe="")`.
43
+ 2. **Tool handler (`src/espn_mcp/tools/{games,teams,news}.py`):** register on domain sub-server with `@<domain>_server.tool(...)` and `@espn_tool` (`server.py` mounts with namespace); document arguments and defaults clearly.
44
+ 3. **Annotations & gating:** all ESPN tools are read-only (`readOnlyHint=True`, `destructiveHint=False`, `idempotentHint=True`, `openWorldHint=True`).
45
+ 4. **Pure offline testing (`tests/`):** add unit tests in `tests/test_server.py` and `tests/test_client.py` using `httpx.MockTransport` (**zero live calls in default suite**, **100%** statement coverage), and update `scripts/check_tool_contract.py`.
46
+
47
+ ---
48
+
49
+ ## 🛡️ Non-Negotiable Safety & Protocol Rules
50
+
51
+ 1. **Dynamic User-Agent:** client headers must dynamically resolve version: `"User-Agent": f"mcp-server-espn/{__version__}"`.
52
+ 2. **Secret Redaction:** all errors and logs pass through `_redact_secrets` / `redact_message` in `errors.py` (masking credentials, keys, tokens, PEM blocks while leaving `next_token`, `page_token`, `max_tokens` untouched; see `errors.py` for known multiline/bracket limits).
53
+ 3. **Multi-Stage Non-Root Containers (`Dockerfile`):**
54
+ - Multi-stage `python:3.12-slim-trixie AS builder` → runtime pinned by digest (both stages share the same pin; glibc is keyed by the Debian release in the tag, not the digest), non-root `USER mcp`, venv `/opt/venv`, `ENTRYPOINT ["espn-mcp"]`.
55
+ - Trust-store floor (FastMCP Oct 2026 / `DSA-6572-1`): both stages upgrade OS `ca-certificates` and enforce `ARG CA_CERTIFICATES_FLOOR` (before any pip runs in builder), builder bootstraps pip from `docker/pip-bootstrap.txt` (`--require-hashes`; Dependabot bumps it), and `certifi>=2026.10.23` is a direct dependency. Never lower `CA_CERTIFICATES_FLOOR` via `--build-arg` (the build-arg exists only so CI can raise it for the negative floor check; CI and the release workflow never pass it otherwise).
56
+ - Reproducible lock install: builder installs uv (`docker/uv-bootstrap.txt`, `--require-hashes`, outside venv; Dependabot bumps it), exports `uv export --locked --no-dev --no-emit-project --format requirements.txt` and installs that file with pip in hash-checking mode, then installs `docker/build-backend.txt` (`--require-hashes --only-binary=:all:` outside venv), and runs `PYTHONPATH=/tmp/build-backend pip install --no-deps --no-build-isolation .` (never `pip install .`). Regenerate `docker/build-backend.txt` after `uv lock` via `uv run python scripts/gen_build_backend.py` (never hand-edit; Dependabot excludes it). Enforced by `tests/test_dockerfile.py` & `tests/test_build_backend_lock.py`.
57
+ 4. **Registry Metadata (`server.json`):** root `description` **≤ 100 chars**.
58
+ 5. **Git Safety & Releases:**
59
+ - Never commit secrets or push to `main`; use feature branches and PRs.
60
+ - **Tag is version (`uv-dynamic-versioning`):** `pyproject.toml` declares `dynamic = ["version"]`, `__version__` uses `importlib.metadata`, `server.json` commits `0.0.0`. Never bump versions in PRs (`pyproject.toml`, `src/espn_mcp/__init__.py`, `server.json`, `uv.lock`, `CHANGELOG.md`). Untagged builds report `X.Y.(Z+1).devN+<sha>`; `scripts/check_version.py` rejects `0.0.0` / `0.0.1.devN`.
61
+ - **Breaking changes (`feat!` / `fix!`):** end PR body with `BREAKING CHANGE:` as the final paragraph (before `<!-- This is an auto-generated comment: release notes by coderabbit.ai -->` if present) and **must include migration steps** (no separate migration token; `scripts/release_notes.py` stops at the CodeRabbit marker). Keep PR body accurate before squash merge.
62
+ - **`CHANGELOG.md` frozen at 1.2.9:** GitHub Releases are the changelog. Leave `README.md` unpinned (`uvx --from mcp-server-espn espn-mcp`).
63
+ - **Version level:** before tagging, check the proposed version against the commit types since the last tag (`!` / `BREAKING CHANGE:` → major, `feat` → minor, otherwise patch), and that every breaking commit carries its footer with migration steps.
64
+ - **Tagging (maintainer go only, no release PR):** preview `git fetch --tags && python3 scripts/release_notes.py` on `main` and post it with the release Ask; verify version unused on git tags, PyPI (`https://pypi.org/pypi/mcp-server-espn/X.Y.Z/json`), and MCP Registry (`https://registry.modelcontextprotocol.io/v0.1/servers/io.github.christianclaudio%2Fespn/versions/X.Y.Z`). In a throwaway clone, tag the release commit locally, run `rm -rf dist && uv build`, and confirm the wheel is `mcp_server_espn-X.Y.Z-py3-none-any.whl` and `scripts/check_version.py` passes; discard the clone without pushing. PyPI rejects re-uploads: on post-PyPI failure, merge a fix and tag next patch.
65
+
66
+ ---
67
+
68
+ ## 🛠️ Development & Verification Commands
69
+
70
+ Requires `uv >= 0.13.4` (`[tool.uv] required-version` in `pyproject.toml`).
71
+
72
+ ```bash
73
+ # Install editable with dev dependencies
74
+ uv sync --locked --extra dev
75
+
76
+ # Lint and formatting
77
+ uv run ruff check . && uv run ruff format --check .
78
+
79
+ # Strict type checking
80
+ uv run mypy --strict src/
81
+
82
+ # Test suite with 100% coverage requirement
83
+ uv run pytest --cov=src/espn_mcp --cov-fail-under=100 -v
84
+
85
+ # Tool contract verification
86
+ uv run python scripts/check_tool_contract.py
87
+
88
+ # Upstream OpenAPI / route drift check (PR path: client calls vs the committed spec)
89
+ uv run python scripts/check_openapi_drift.py
90
+
91
+ # Scheduled drift gate (new uncovered core routes, and dead site samples)
92
+ uv run python scripts/check_openapi_drift.py --fail-on-new-uncovered
93
+
94
+ # Protocol integration tests (stdio handshake & stateless streamable HTTP)
95
+ uv run pytest tests/test_protocol.py
96
+
97
+ # Build version guard (reads the single wheel in dist/; rejects 0.0.0 and the untagged 0.0.1.devN)
98
+ rm -rf dist && uv build && uv run python scripts/check_version.py
99
+
100
+ # Local pre-commit CodeRabbit CLI review
101
+ coderabbit review --agent --uncommitted
102
+ ```
103
+
104
+ ---
105
+
106
+ ## 🔄 CI & Releases
107
+
108
+ - **CI (`.github/workflows/ci.yml`):** runs on `push`/`pull_request` to `main`, weekly schedule, and `workflow_dispatch` (`fetch-depth: 0` on package jobs). Jobs: Lint and types, Tests (Python 3.11–3.14, 100% cov + aggregate Tests), Tool contract assertions (+ OpenAPI drift & stdio check), Protocol conformance, Build and package check (`check_version.py` + `twine check`), Container image build (no push; verifies stripped build deps, stdio `initialize`/`tools/list`, negative `CA_CERTIFICATES_FLOOR`), and Check API Drift (`drift-check`, schedule/manual only; that job alone passes `--fail-on-new-uncovered`, has `contents: read` and `issues: write`, and opens an issue when the scan reports new uncovered routes, a dead site route, or another failure). CodeQL runs via GitHub default setup.
109
+ - **Dependabot (`.github/dependabot.yml` + `dependabot-automerge.yml`):** squash-merges minor/patch PRs after CI passes on head commit; major & docker updates wait for human review.
110
+ - **Releases (`.github/workflows/release.yml`):** triggered on `v*` tags (`fetch-depth: 0`); 5 jobs: `build` (verifies wheel & SBOM), `publish` (PyPI + GitHub Release via `release_notes.py`), `docker` (pushes GHCR image with `UV_DYNAMIC_VERSIONING_BYPASS` set to the tag version because the Docker build context has no `.git`, and without buildx provenance/SBOM), `attest` (attests `dist/*` + image digest), and `registry` (stamps tag into `server.json` & publishes to MCP Registry).
111
+
112
+ ---
113
+
114
+ ## VCS
115
+
116
+ ```yaml
117
+ vcs:
118
+ host: github
119
+ remote: origin
120
+ repository: christianclaudio/mcp-server-espn
121
+ default_branch: main
122
+ protected_branches: [main]
123
+ branch_policy: pr_only
124
+ merge_strategy: squash
125
+ delete_branch_on_merge: true
126
+ require_coderabbit: true
127
+ branch_naming: type/scope-desc
128
+ ```
@@ -42,12 +42,12 @@ COPY src/ src/
42
42
  ARG UV_DYNAMIC_VERSIONING_BYPASS
43
43
  ENV UV_DYNAMIC_VERSIONING_BYPASS=${UV_DYNAMIC_VERSIONING_BYPASS}
44
44
 
45
- # pip 26.2.2 updates the certificates pip bundles, per FastMCP's October 2026 certificate
45
+ # The pinned pip bootstrap updates the certificates pip bundles, per FastMCP's October 2026 certificate
46
46
  # authority incident notice. This image installs with pip, not uv, so pip carries the floor.
47
47
  # https://github.com/PrefectHQ/fastmcp/blob/main/SECURITY.md#certificate-authority-incident-october-2026
48
48
  # The bootstrap installs pip from a hash-pinned wheel (docker/pip-bootstrap.txt, --require-hashes),
49
49
  # so it does not depend on the TLS trust of the base image's older pip and certifi; the maintainer
50
- # who raises the pip floor updates that pin and its sha256 (Dependabot does not track the file).
50
+ # who raises the pip floor updates that pin and its sha256. Dependabot bumps docker/pip-bootstrap.txt.
51
51
  #
52
52
  # Runtime dependencies come from uv.lock, so the image runs the versions CI tests. uv, hash-pinned
53
53
  # in docker/uv-bootstrap.txt and installed to /tmp/uv outside the venv (the runtime image gets no
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: mcp-server-espn
3
- Version: 2.3.2
3
+ Version: 2.4.0
4
4
  Summary: Model Context Protocol (MCP) server for live & historical sports stats, odds, and schedules via ESPN
5
5
  Project-URL: Homepage, https://github.com/christianclaudio/mcp-server-espn
6
6
  Project-URL: Documentation, https://github.com/christianclaudio/mcp-server-espn#readme
@@ -23,7 +23,7 @@ Classifier: Programming Language :: Python :: 3.14
23
23
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
24
  Requires-Python: >=3.11
25
25
  Requires-Dist: certifi>=2026.10.23
26
- Requires-Dist: fastmcp>=4.2.0
26
+ Requires-Dist: fastmcp>=4.2.1
27
27
  Requires-Dist: httpx>=0.28.1
28
28
  Requires-Dist: mcp>=2.3.0
29
29
  Requires-Dist: pydantic-settings>=2.15.0
@@ -105,9 +105,9 @@ graph TD
105
105
  * **Parent**: `ParentAuditMiddleware` (timing logs, audit trails, and secret scrubbing) and `ReadOnlyGateMiddleware` (fail-closed read-only enforcement).
106
106
  * **Child**: `GamesDomainGuardMiddleware` (query limit validation <= 100) and `TeamsDomainGuardMiddleware` (team and athlete identifier validation).
107
107
  * **Focused Profiles**: Run lightweight surfaces via `--profile full|games|teams|news|readonly` (`ESPN_MCP_PROFILE`):
108
- * `full` (default): All 33 domain tools and resources mounted.
109
- * `games`: Scores, summaries, schedules, standings, rankings, transactions, league leaders, draft, live play-by-play, situations, odds, probabilities, predictor, calendar, futures, power index (20 tools).
110
- * `teams`: Rosters, depth charts, player stats, athlete profiles, bio, stats, gamelog, splits, search, list teams, team detail, team statistics (12 tools).
108
+ * `full` (default): All 52 domain tools and resources mounted.
109
+ * `games`: Scores, summaries, schedules, standings, rankings, transactions, league leaders, draft, live play-by-play, situations, odds, probabilities, predictor, calendar, futures, power index, injuries, drives, QBR, golf tournaments, bets, and awards (30 tools).
110
+ * `teams`: Rosters, depth charts, player stats, athlete profiles, bio, stats, gamelog, splits, search, list teams, team detail, team statistics, coaches, venues, franchises, tournament history, and recruiting (21 tools).
111
111
  * `news`: League news and reference resources (1 tool).
112
112
  * `readonly`: Read-only enforcement across all routes.
113
113
  * **Opt-In Tool Search**: Preserves standard flat `tools/list` by default for seamless client compatibility, while enabling search transforms via `--enable-tool-search` (`ESPN_MCP_ENABLE_TOOL_SEARCH`): BM25 ranking for natural-language queries by default (`search_tools` takes a `query`), or regex patterns with `--tool-search-backend regex` (`ESPN_MCP_TOOL_SEARCH_BACKEND=regex`; `search_tools` takes a `pattern`).
@@ -152,7 +152,7 @@ The server supports canonical sport/league slug pairs and auto-normalizes popula
152
152
 
153
153
  ---
154
154
 
155
- ## 📊 Tool Suite (33 Domain Tools)
155
+ ## 📊 Tool Suite (52 Domain Tools)
156
156
 
157
157
  All tools implement explicit MCP 2.0 annotations (`readOnlyHint=True`, `idempotentHint=True`):
158
158
 
@@ -178,6 +178,16 @@ All tools implement explicit MCP 2.0 annotations (`readOnlyHint=True`, `idempote
178
178
  | **Games** | `games_get_calendar` | `sport`, `league`, `dates` | League schedule calendar and active event dates across a season. |
179
179
  | **Games** | `games_get_futures` | `sport`, `league`, `season` | Season futures betting markets (championship odds, win totals). |
180
180
  | **Games** | `games_get_power_index` | `sport`, `league`, `season` | Team power index (FPI / BPI) ratings and efficiency metrics. |
181
+ | **Games** | `games_get_league_injuries` | `sport`, `league`, `page`, `limit` | Paged league injury report. Unofficial core route; no server-side team filter. |
182
+ | **Games** | `games_get_drives` | `sport`, `league`, `event_id`, `competition_id`, `page`, `limit` | Drives for one competition. NFL and college football only. `competition_id` defaults to `event_id`. |
183
+ | **Games** | `games_get_drive_plays` | `sport`, `league`, `event_id`, `drive_id`, `competition_id`, `page`, `limit` | Plays inside one drive. NFL and college football only. |
184
+ | **Games** | `games_get_qbr` | `sport`, `league`, `season`, `season_type`, `week`, `split`, `page`, `limit` | League, season, or week QBR. NFL and college football only. |
185
+ | **Games** | `games_list_golf_tournaments` | `league` | Golf tournaments for one league (pga, lpga, and others). Golf only. |
186
+ | **Games** | `games_get_golf_tournament` | `league`, `tournament_id` | One golf tournament. Golf only. |
187
+ | **Games** | `games_get_bets` | `kind`, `limit` | Featured or trending bets, trimmed to `limit`. Can return no items outside betting windows. Betting content; US availability varies. |
188
+ | **Games** | `games_get_bet_type` | `sport`, `league`, `bet_type_id` | One bet type (spread, total, moneyline). |
189
+ | **Games** | `games_get_awards` | `sport`, `league`, `season`, `page`, `limit` | Season awards as id and reference rows. |
190
+ | **Games** | `games_get_award` | `sport`, `league`, `season`, `award_id` | One season award and its winners. |
181
191
  | **Teams** | `teams_search` | `query`, `type`, `limit` | Global search for athletes and teams by name/keyword (`type="player"` or `"team"`). |
182
192
  | **Teams** | `teams_list_teams` | `sport`, `league` | Directory of all franchises/teams in a specified league with IDs, names, and logos. |
183
193
  | **Teams** | `teams_get_team` | `sport`, `league`, `team_id` | Team detail overview, venue, record, standings summary, and upcoming scheduled event. |
@@ -190,6 +200,15 @@ All tools implement explicit MCP 2.0 annotations (`readOnlyHint=True`, `idempote
190
200
  | **Teams** | `teams_get_athlete_stats` | `sport`, `league`, `athlete_id`, `season` | Full seasonal and career category statistics for an athlete. |
191
201
  | **Teams** | `teams_get_athlete_gamelog` | `sport`, `league`, `athlete_id`, `season` | Game-by-game performance log for an athlete across a season. |
192
202
  | **Teams** | `teams_get_athlete_splits` | `sport`, `league`, `athlete_id`, `season` | Situational statistical splits (home/away, turf/grass, monthly, vs opponents). |
203
+ | **Teams** | `teams_list_coaches` | `sport`, `league`, `season` | Coaches in a league, or one season when `season` is set. |
204
+ | **Teams** | `teams_get_coach` | `sport`, `league`, `coach_id`, `season` | One coach for a season, including team and experience. |
205
+ | **Teams** | `teams_list_venues` | `sport`, `league`, `page`, `limit` | Venue ids and references, one page at a time. |
206
+ | **Teams** | `teams_get_venue` | `sport`, `league`, `venue_id` | One venue: name, address, and surface. |
207
+ | **Teams** | `teams_list_franchises` | `sport`, `league`, `page`, `limit` | Franchise ids and references. |
208
+ | **Teams** | `teams_get_franchise` | `sport`, `league`, `franchise_id` | One franchise: name, colors, team, and venue. |
209
+ | **Teams** | `teams_get_team_tournament_history` | `sport`, `league`, `team_id`, `history_type` | Per-team tournament record. Tournament leagues only; ESPN answers 400 for NFL. |
210
+ | **Teams** | `teams_list_recruits` | `sport`, `league`, `year`, `page`, `limit` | Recruiting-class ids and references for one year. College only. |
211
+ | **Teams** | `teams_get_recruiting_rankings` | `sport`, `league`, `year` | Recruiting ranking references for a class year. College only. |
193
212
  | **News** | `news_get_news` | `sport`, `league`, `limit` | Recent news headlines, injury designations, and breaking roster analysis. |
194
213
 
195
214
  ---
@@ -408,6 +427,8 @@ ruff format .
408
427
  # Tool contract, drift & protocol conformance audits
409
428
  python scripts/check_tool_contract.py
410
429
  python scripts/check_openapi_drift.py
430
+ # Scheduled drift gate: new uncovered core routes and dead site samples
431
+ python scripts/check_openapi_drift.py --fail-on-new-uncovered
411
432
  ./scripts/check_conformance.sh
412
433
  ```
413
434
 
@@ -65,9 +65,9 @@ graph TD
65
65
  * **Parent**: `ParentAuditMiddleware` (timing logs, audit trails, and secret scrubbing) and `ReadOnlyGateMiddleware` (fail-closed read-only enforcement).
66
66
  * **Child**: `GamesDomainGuardMiddleware` (query limit validation <= 100) and `TeamsDomainGuardMiddleware` (team and athlete identifier validation).
67
67
  * **Focused Profiles**: Run lightweight surfaces via `--profile full|games|teams|news|readonly` (`ESPN_MCP_PROFILE`):
68
- * `full` (default): All 33 domain tools and resources mounted.
69
- * `games`: Scores, summaries, schedules, standings, rankings, transactions, league leaders, draft, live play-by-play, situations, odds, probabilities, predictor, calendar, futures, power index (20 tools).
70
- * `teams`: Rosters, depth charts, player stats, athlete profiles, bio, stats, gamelog, splits, search, list teams, team detail, team statistics (12 tools).
68
+ * `full` (default): All 52 domain tools and resources mounted.
69
+ * `games`: Scores, summaries, schedules, standings, rankings, transactions, league leaders, draft, live play-by-play, situations, odds, probabilities, predictor, calendar, futures, power index, injuries, drives, QBR, golf tournaments, bets, and awards (30 tools).
70
+ * `teams`: Rosters, depth charts, player stats, athlete profiles, bio, stats, gamelog, splits, search, list teams, team detail, team statistics, coaches, venues, franchises, tournament history, and recruiting (21 tools).
71
71
  * `news`: League news and reference resources (1 tool).
72
72
  * `readonly`: Read-only enforcement across all routes.
73
73
  * **Opt-In Tool Search**: Preserves standard flat `tools/list` by default for seamless client compatibility, while enabling search transforms via `--enable-tool-search` (`ESPN_MCP_ENABLE_TOOL_SEARCH`): BM25 ranking for natural-language queries by default (`search_tools` takes a `query`), or regex patterns with `--tool-search-backend regex` (`ESPN_MCP_TOOL_SEARCH_BACKEND=regex`; `search_tools` takes a `pattern`).
@@ -112,7 +112,7 @@ The server supports canonical sport/league slug pairs and auto-normalizes popula
112
112
 
113
113
  ---
114
114
 
115
- ## 📊 Tool Suite (33 Domain Tools)
115
+ ## 📊 Tool Suite (52 Domain Tools)
116
116
 
117
117
  All tools implement explicit MCP 2.0 annotations (`readOnlyHint=True`, `idempotentHint=True`):
118
118
 
@@ -138,6 +138,16 @@ All tools implement explicit MCP 2.0 annotations (`readOnlyHint=True`, `idempote
138
138
  | **Games** | `games_get_calendar` | `sport`, `league`, `dates` | League schedule calendar and active event dates across a season. |
139
139
  | **Games** | `games_get_futures` | `sport`, `league`, `season` | Season futures betting markets (championship odds, win totals). |
140
140
  | **Games** | `games_get_power_index` | `sport`, `league`, `season` | Team power index (FPI / BPI) ratings and efficiency metrics. |
141
+ | **Games** | `games_get_league_injuries` | `sport`, `league`, `page`, `limit` | Paged league injury report. Unofficial core route; no server-side team filter. |
142
+ | **Games** | `games_get_drives` | `sport`, `league`, `event_id`, `competition_id`, `page`, `limit` | Drives for one competition. NFL and college football only. `competition_id` defaults to `event_id`. |
143
+ | **Games** | `games_get_drive_plays` | `sport`, `league`, `event_id`, `drive_id`, `competition_id`, `page`, `limit` | Plays inside one drive. NFL and college football only. |
144
+ | **Games** | `games_get_qbr` | `sport`, `league`, `season`, `season_type`, `week`, `split`, `page`, `limit` | League, season, or week QBR. NFL and college football only. |
145
+ | **Games** | `games_list_golf_tournaments` | `league` | Golf tournaments for one league (pga, lpga, and others). Golf only. |
146
+ | **Games** | `games_get_golf_tournament` | `league`, `tournament_id` | One golf tournament. Golf only. |
147
+ | **Games** | `games_get_bets` | `kind`, `limit` | Featured or trending bets, trimmed to `limit`. Can return no items outside betting windows. Betting content; US availability varies. |
148
+ | **Games** | `games_get_bet_type` | `sport`, `league`, `bet_type_id` | One bet type (spread, total, moneyline). |
149
+ | **Games** | `games_get_awards` | `sport`, `league`, `season`, `page`, `limit` | Season awards as id and reference rows. |
150
+ | **Games** | `games_get_award` | `sport`, `league`, `season`, `award_id` | One season award and its winners. |
141
151
  | **Teams** | `teams_search` | `query`, `type`, `limit` | Global search for athletes and teams by name/keyword (`type="player"` or `"team"`). |
142
152
  | **Teams** | `teams_list_teams` | `sport`, `league` | Directory of all franchises/teams in a specified league with IDs, names, and logos. |
143
153
  | **Teams** | `teams_get_team` | `sport`, `league`, `team_id` | Team detail overview, venue, record, standings summary, and upcoming scheduled event. |
@@ -150,6 +160,15 @@ All tools implement explicit MCP 2.0 annotations (`readOnlyHint=True`, `idempote
150
160
  | **Teams** | `teams_get_athlete_stats` | `sport`, `league`, `athlete_id`, `season` | Full seasonal and career category statistics for an athlete. |
151
161
  | **Teams** | `teams_get_athlete_gamelog` | `sport`, `league`, `athlete_id`, `season` | Game-by-game performance log for an athlete across a season. |
152
162
  | **Teams** | `teams_get_athlete_splits` | `sport`, `league`, `athlete_id`, `season` | Situational statistical splits (home/away, turf/grass, monthly, vs opponents). |
163
+ | **Teams** | `teams_list_coaches` | `sport`, `league`, `season` | Coaches in a league, or one season when `season` is set. |
164
+ | **Teams** | `teams_get_coach` | `sport`, `league`, `coach_id`, `season` | One coach for a season, including team and experience. |
165
+ | **Teams** | `teams_list_venues` | `sport`, `league`, `page`, `limit` | Venue ids and references, one page at a time. |
166
+ | **Teams** | `teams_get_venue` | `sport`, `league`, `venue_id` | One venue: name, address, and surface. |
167
+ | **Teams** | `teams_list_franchises` | `sport`, `league`, `page`, `limit` | Franchise ids and references. |
168
+ | **Teams** | `teams_get_franchise` | `sport`, `league`, `franchise_id` | One franchise: name, colors, team, and venue. |
169
+ | **Teams** | `teams_get_team_tournament_history` | `sport`, `league`, `team_id`, `history_type` | Per-team tournament record. Tournament leagues only; ESPN answers 400 for NFL. |
170
+ | **Teams** | `teams_list_recruits` | `sport`, `league`, `year`, `page`, `limit` | Recruiting-class ids and references for one year. College only. |
171
+ | **Teams** | `teams_get_recruiting_rankings` | `sport`, `league`, `year` | Recruiting ranking references for a class year. College only. |
153
172
  | **News** | `news_get_news` | `sport`, `league`, `limit` | Recent news headlines, injury designations, and breaking roster analysis. |
154
173
 
155
174
  ---
@@ -368,6 +387,8 @@ ruff format .
368
387
  # Tool contract, drift & protocol conformance audits
369
388
  python scripts/check_tool_contract.py
370
389
  python scripts/check_openapi_drift.py
390
+ # Scheduled drift gate: new uncovered core routes and dead site samples
391
+ python scripts/check_openapi_drift.py --fail-on-new-uncovered
371
392
  ./scripts/check_conformance.sh
372
393
  ```
373
394
 
@@ -1,5 +1,5 @@
1
1
  # pip for the Dockerfile builder's bootstrap, installed with --require-hashes so the install
2
- # does not depend on TLS trust. Hash of pip-26.3-py3-none-any.whl from PyPI's JSON API
3
- # (digests.sha256). Bump this pin and hash together with the pip floor; Dependabot does not.
2
+ # does not depend on TLS trust. Hash of the py3-none-any wheel from PyPI's JSON API
3
+ # (digests.sha256). Bump this pin and hash together with the pip floor; Dependabot also bumps this file.
4
4
  pip==26.3 \
5
5
  --hash=sha256:f3b60b20ffaadd4415ed7957212a38ac63fa4c5fa375bd0f4a797777940fad13
@@ -3,7 +3,7 @@
3
3
  # Hashes are digests.sha256 from PyPI's JSON API (https://pypi.org/pypi/uv/<version>/json) for
4
4
  # the Linux wheels pip picks on the python:3.12-slim base: manylinux_2_17 x86_64, and
5
5
  # manylinux_2_28 and manylinux_2_17 aarch64. Keep the version within pyproject.toml's
6
- # [tool.uv] required-version, and bump the pin and hashes together; Dependabot does not track the file.
6
+ # [tool.uv] required-version, and bump the pin and hashes together; Dependabot also bumps this file.
7
7
  uv==0.13.7 \
8
8
  --hash=sha256:08f16fd463926786b702b497473511deae4b3e17a2fa6d22180950d6059a120d \
9
9
  --hash=sha256:158953b8669bee6f4bc2babdd997e34ff9f0d57170093cfe907f64448292b7c3 \
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "environment": {
8
8
  "dependencies": [
9
- "fastmcp>=4.2.0",
9
+ "fastmcp>=4.2.1",
10
10
  "certifi>=2026.10.23",
11
11
  "mcp>=2.3.0",
12
12
  "httpx>=0.28.1",
@@ -27,7 +27,7 @@ classifiers = [
27
27
  ]
28
28
  dependencies = [
29
29
  "mcp>=2.3.0",
30
- "fastmcp>=4.2.0",
30
+ "fastmcp>=4.2.1",
31
31
  # certifi floor from FastMCP's October 2026 certificate authority incident notice,
32
32
  # raised to the 2026.10.23 fleet floor. httpx verifies upstream TLS against this bundle.
33
33
  # https://github.com/PrefectHQ/fastmcp/blob/main/SECURITY.md#certificate-authority-incident-october-2026