Connect
Connect MapleStats to your agent
The easiest way is the hosted server: point your client at one address, or paste one prompt and let your agent do it. Nothing to install, no account, no API key. If you would rather keep everything on your machine, or need the microdata tabulation tool, run it locally instead.
The easiest way: ask your agent The agent reads the setup steps from the repository, adds the hosted server to its own settings and tells you when to restart.
Connect the MapleStats MCP server to this agent. Follow the setup steps in https://github.com/dsanchezp18/maplestats-mcp- Copy the prompt.
- Paste it into Claude Code, Codex, Cursor or any agent that can run commands on your computer.
- Restart the agent when it says so, then ask for data.
Recommended: no install
Use the hosted server
A public copy runs at https://maplestats-mcp.onrender.com/mcp. It needs no account, no token and no install: point any client that supports remote (HTTP) MCP servers at that address.
It runs on a free host, so expect limits: a ping every 10 minutes keeps it awake, so cold starts are rare, but the first request after an idle spell can take up to a minute; each client is limited to 60 requests a minute; and the microdata tabulation tool (statcan_pumf_tabulate) is switched off, while PUMF search, file listings and codebooks work. For heavier use, or for microdata tables, install it locally below. Your agent's tool calls, such as a search phrase or a table number, reach the server and its host; the code stores none of them (see the FAQ), and the host, Render, has its own logs, so check Render's terms and privacy policy. For full privacy, install it locally below.
claude mcp add --transport http --scope user maplestats https://maplestats-mcp.onrender.com/mcp
codex mcp add maplestats --url https://maplestats-mcp.onrender.com/mcp
{
"mcpServers": {
"maplestats": {
"url": "https://maplestats-mcp.onrender.com/mcp"
}
}
}
VS Code uses "servers" in place of "mcpServers" and needs "type": "http". Check it is up with curl https://maplestats-mcp.onrender.com/health.
claude.ai and the Claude phone app: on the web, open Settings, Connectors, Add custom connector, and enter the same address, if your plan offers connectors. Then switch it on from the tools menu in a chat, on the web or in the phone app. Claude asks for approval before each tool call by default; every MapleStats tool is read-only, so you can set them to always allow in the connector's tool permissions. ChatGPT (web): turn on Developer mode under Settings, Security and login, then create a developer-mode app for a remote MCP server with the same address and no authentication. Opening the address in a browser shows a "Missing session ID" error; that is expected, since only MCP clients can use it.
For a whole organization: on Claude Team or Enterprise, an Owner opens Organization settings, Connectors, Add custom connector and enters the same address once; each member then connects it from their own Connectors settings. On ChatGPT Business, Enterprise or Edu (web), a workspace admin first turns on Developer mode under Workspace Settings, Permissions & Roles, Connected Data, then creates the app with no authentication and publishes it under Workspace settings, Apps, Drafts, Publish. The hosted server is a shared free instance limited to 60 requests a minute per client address, so a large organization should run its own copy.
Or run it on your machine
01
Install uv
uv runs Python tools without a separate install step. Skip this if uv --version already works.
curl -LsSf https://astral.sh/uv/install.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
02
Add the server to your client
Pick your client. Each entry runs uvx maplestats-mcp, which downloads the server the first time and reuses it afterwards.
Claude Code
Run this once in a terminal. --scope user makes the server available in every project; leave it out to add it to the current project only.
claude mcp add --scope user maplestats -- uvx maplestats-mcp
Claude Desktop
In Claude Desktop, open Settings, then Developer, then Edit Config. Add the server to the file that opens, save it and restart Claude.
{
"mcpServers": {
"maplestats": {
"command": "uvx",
"args": ["maplestats-mcp"]
}
}
}
The file lives at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS and %APPDATA%\Claude\claude_desktop_config.json on Windows.
Cursor
The link opens Cursor with the entry filled in. To add it by hand, put it in ~/.cursor/mcp.json for every project, or in .cursor/mcp.json for one project.
{
"mcpServers": {
"maplestats": {
"command": "uvx",
"args": ["maplestats-mcp"]
}
}
}
VS Code
To add it by hand, note that VS Code uses a servers key, not mcpServers. Put this in .vscode/mcp.json in a workspace, or run MCP: Open User Configuration from the Command Palette to add it for every workspace.
{
"servers": {
"maplestats": {
"type": "stdio",
"command": "uvx",
"args": ["maplestats-mcp"]
}
}
}
Codex CLI
Add it from the terminal, or write the same entry into ~/.codex/config.toml yourself.
codex mcp add maplestats -- uvx maplestats-mcp
[mcp_servers.maplestats]
command = "uvx"
args = ["maplestats-mcp"]
Gemini CLI
Add it from the terminal (-s user for every project), or write the entry into ~/.gemini/settings.json next to any settings already there.
gemini mcp add -s user maplestats uvx maplestats-mcp
{
"mcpServers": {
"maplestats": {
"command": "uvx",
"args": ["maplestats-mcp"]
}
}
}
Other clients
Most MCP clients accept this mcpServers entry. If you installed the command with uv tool install or pip, use "command": "maplestats-mcp" and drop args.
{
"mcpServers": {
"maplestats": {
"command": "uvx",
"args": ["maplestats-mcp"]
}
}
}
03
Ask a question
Restart the client if it was open, then ask for data. Naming the source is optional; asking for citations makes the agent quote each provenance block. For nine worked examples, from census microdata to credit-card pricing, see the demos.
- What was the year-over-year change in Canada's consumer price index last month? Cite the table.
- Compare the average rent of a two-bedroom apartment in Calgary and Edmonton since 2020, using CMHC data.
- Using the Labour Force Survey public use microdata, estimate the employment rate by province, with its survey weights.
- Quel est le taux directeur de la Banque du Canada, et depuis quand est-il à ce niveau ?
Other ways to install
Install the command once
If you prefer a fixed install to uvx, install the command and point your client at maplestats-mcp directly.
# with uv (upgrade later with: uv tool upgrade maplestats-mcp)
uv tool install maplestats-mcp
# or with pip
pip install maplestats-mcp
# or the development version, from GitHub
uv tool install git+https://github.com/dsanchezp18/maplestats-mcp.git
Hosting
Run it as an HTTP server
For a shared deployment, set the transport to HTTP. If the server is reachable beyond your machine, set a bearer token and require it. GET /health reports uptime and version and skips authentication.
MAPLE_TRANSPORT=http MAPLE_HOST=0.0.0.0 MAPLE_PORT=8000 \
MAPLE_AUTH_TOKEN="$(openssl rand -hex 32)" MAPLE_REQUIRE_AUTH=1 \
uvx maplestats-mcp
| Variable | Default | Purpose |
|---|---|---|
MAPLE_TRANSPORT | stdio | stdio for local clients, http for hosting |
MAPLE_HOST, MAPLE_PORT | 127.0.0.1, 8000 | HTTP bind address |
MAPLE_AUTH_TOKEN | unset | Bearer token required on /mcp when set |
MAPLE_REQUIRE_AUTH | 0 | Refuse to start without a token when 1 |
MAPLE_RATE_LIMIT_REQUESTS, MAPLE_RATE_LIMIT_WINDOW_SECONDS | 120, 60 | Per-client sliding-window rate limit |
MAPLE_MAX_CONCURRENT_REQUESTS | 8 | In-flight MCP requests; extra requests wait up to 5 s, then get HTTP 503 |
MAPLE_TOOL_TIMEOUT_SECONDS | 120 | Longest a tool call may run before it fails with a named error |
MAPLE_ALLOWED_ORIGINS | project website, localhost | Browser origins allowed on /mcp, comma-separated (https://*.office.com for an Office add-in); other origins get HTTP 403, clients that send no origin are allowed |
MAPLE_CACHE_MAX_ENTRIES | 2000 | Entries per cache bucket in memory |
MAPLE_CACHE_MAX_MB | 128 | Estimated memory cap for the whole cache |
MAPLE_PARSE_WORKERS, MAPLE_PARSE_TIMEOUT_SECONDS | 4, 60 | Threads that read Excel and CSV files, and the longest one file may take |
MAPLE_PUMF_CACHE_DIR, MAPLE_PUMF_CACHE_MAX_GB | system temp, 5 | Where downloaded microdata is kept, and its size cap |
MAPLE_PUMF_TABULATE | 1 | 0 switches off statcan_pumf_tabulate, which downloads whole microdata files; search, file lists and codebooks stay |
MAPLE_LODE_CACHE_DIR, MAPLE_LODE_CACHE_MAX_GB | system temp, 3 | Where StatCan open-database (LODE) files are unpacked, and the size cap |
MAPLE_LODE_MAX_DOWNLOAD_MB | 300 | Largest open-database archive one call may download; 0 turns downloads off |
MAPLE_IP_HORIZONS_CACHE_DIR, MAPLE_IP_HORIZONS_CACHE_MAX_GB | system temp, 3 | Where CIPO patent tables are kept as Parquet, and the size cap |
MAPLE_EXPORT_DIR | Downloads folder | Where reproduce_workbook saves Excel workbooks on a local server |
MAPLE_USAGE_STATS | 1 | Counts calls per tool name at /stats, in memory; 0 turns the counts off |
MAPLE_SSL_CERTFILE, MAPLE_SSL_KEYFILE | unset | Terminate TLS in the server process |
MAPLE_TRUST_PROXY_HEADERS | 0 | Key rate limits on X-Forwarded-For; enable only behind a proxy that sets it |
Hosting
Run it with Docker
The repository ships a Dockerfile and a docker-compose.yml that serve HTTP on port 8000. The compose file sets MAPLE_REQUIRE_AUTH=1, so the container refuses to start until MAPLE_AUTH_TOKEN is set. Keep the token: clients send it as Authorization: Bearer to http://localhost:8000/mcp.
Two named volumes keep downloaded microdata and patent tables across restarts. The variables in the table above can be set the same way as the token.
git clone https://github.com/dsanchezp18/maplestats-mcp
cd maplestats-mcp
export MAPLE_AUTH_TOKEN="$(openssl rand -hex 32)"
echo "$MAPLE_AUTH_TOKEN"
docker compose up -d --build
curl http://localhost:8000/health
Troubleshooting
When something does not connect
- The client cannot find
uvx - Desktop apps do not always read your shell's
PATH. Use the full path fromwhich uvx(macOS, Linux) orwhere uvx(Windows) as the command, then restart the client. - A microdata or patent call times out
- The first
statcan_pumf_tabulatecall on a file downloads it, which can take a minute or two; later calls use the cache. RaiseMAPLE_TOOL_TIMEOUT_SECONDSif your connection is slow. - The agent does not use the tools
- Check that the client lists three MapleStats tools: plan_query, search_tools and call_tool. The rest are found through search, so they do not appear in the client's tool list.