Contributing
Help build MapleStats
MapleStats is open source and grows one source at a time. You can help without writing any code: report a wrong number, suggest a source, or share how you used it. If you do write code, this page walks through the whole process, from the first issue to the live site.
Ways to help
Report a wrong or missing number
Open an issue with the question you asked, the tool call and the source URL from the result's provenance. A wrong number is the most useful bug report there is.
Suggest a source
Name the agency or portal and link to where its data live. The roadmap lists every source checked so far, including the ones that could not be added and why.
Share a demo
If you used MapleStats for real work, open an issue with the question, what the agent found and the calls it made. I add the good ones to the demos.
MapleStats is meant to work as well in French as in English. If a phrase sounds like a translation, or a French search misses what it should find, open an issue or send a fix.
How to contribute code
01
Open an issue first
Tell me what you want to add or fix before you write code. For a new source, link its API documentation or data page.
02
Set up and read AGENTS.md
Fork and clone the repository, then install it with uv. Read AGENTS.md before you start, whether you are a person or an agent. It shows how a module is laid out, what every tool returns, and three lines you should not remove.
git clone https://github.com/dsanchezp18/maplestats-mcp.git
cd maplestats-mcp
uv sync
03
Build against the real API
Start a new source from a copy of modules/_example/. Before you call it done, run every function against the live API with realistic arguments. Mocked tests only check your own assumptions: when I ran the 32 Statistics Canada tools live, I found nine bugs the mocks had missed.
04
Test it, and list it
Add mocked unit tests with pytest-httpx, and a live smoke test for every tool in scripts/smoke_test_modules.py. Add the module to SOURCES in scripts/build_site.py, and a title to FAMILIES for each sub-API folder; a test fails if one is missing. A new CKAN, ArcGIS Hub or Socrata portal is not a new module: add it to that family's PORTALS and its province to PORTAL_PLACES.
05
Run the checks
These are the four checks CI runs. All four must pass before I review a pull request.
uv run ruff check src tests scripts
uv run ruff format --check src tests scripts
uv run pyright
uv run pytest -q
06
Open a pull request
Say what changed and how you checked it against the live source. CI runs the checks on every supported Python version. Small pull requests get merged faster.
07
After the merge
When the checks pass on the main branch, the website rebuilds, so a new tool shows up on the Tools page and in the search. The demo data change only when someone runs scripts/capture_cases.py and commits the result. Every Monday, the live smoke tests run against the real APIs to catch changes at the source.
With a coding agent
The repository is set up for coding agents. Point yours at AGENTS.md first (CLAUDE.md in the repository points there too), and it follows the same process and runs the same checks.
Read AGENTS.md in this repository, then add a module for [the source] following it.Ground rules
- Contributions are released under the project's MIT licence.
- The data stay with their publishers, so do not commit copies of a source's data.
- No API keys or credentials in the code. Every source so far works without one.
- Found a security problem? Report it privately through GitHub's private vulnerability reporting, not in a public issue; see the security policy.
- English and French together: a tool without French keywords cannot be found by a French query.