Imported from futureweb/intervals-mcp-server (
AGENTS.md). Install upstream withnpx skills add futureweb/intervals-mcp-server. Copyright stays with the author.
Contributor Guide
This project is a Python 3.12 backend service built with FastMCP and httpx. All source code lives under src/intervals_mcp_server and tests live under tests.
Development Environment
- Use uv to create and manage the virtual environment.
uv venv --python 3.12source .venv/bin/activate
- Sync dependencies including dev extras with
uv sync --all-extras. - When editing or running the server manually use
uv run futureweb-intervals-mcp(--doctorchecks the configuration).
Testing Instructions
- Run unit tests with
pytestfrom the repository root. - Ensure linting passes with
uv run --locked ruff check .. - Run static type checks using
uv run --locked mypy src tests. - Pylint (
pylint --disable=C0301 $(git ls-files '*.py')) is advisory; keep new code free of new messages (targeted# pylint: disable=comments are accepted for long tool functions). - Every MCP tool is registered with
@tool("<permission class>")fromintervals_mcp_server.mcp_instance; tools of disabled classes are not exposed (MCP_PERMISSIONS, default read). - The docstring is the tool description: at most 900 characters, first sentence says when to use the tool, no Args section. Every parameter is
Annotated[..., Field(description=...)](shared aliases inutils/params.py), parameters with fixed values areLiteralenums; tools never take an API key. Long method explanations go intoguides/methods/<topic>.md(served asintervals://methods/<topic>and byget_guide).tests/test_catalogue.pychecks these rules and the token budget. - Tests use synthetic fixtures (see
tests/sample_data.py); never add real athlete ids, hostnames or keys. - Multi-user mode (
MCP_TENANCY=multi,tenancy.py): tools never readAPI_KEYor take credentials; the API client uses the calling connection's credential. Default athletes go throughresolve_athlete_idortenancy.default_athlete(config.athlete_id), caches throughutils.cache.cache_key;tests/test_multi_user.pychecks the isolation. - All three steps (
ruff,mypy, andpytest) should succeed before committing.
PR Instructions
- Use concise commit messages.
- Use a short imperative pull request title; mention merged upstream PRs or adopted ideas with their number and author.
- Describe any manual testing steps performed and mention whether
pytest,ruff, andmypypassed.
There is currently no frontend code in this repository. If a frontend is added in the future (for example with React or another framework), document how to run and test it within this file.
