Goatcounter_get_meLABSCO SUMMARY
The rate-limit handling is why it survives a real question.
Analytics questions turn into several calls — totals, then paths, then referrers for the interesting ones — which is exactly the pattern that trips an API limit and leaves the assistant with a half-answer. Retrying on 429 while respecting the reset header means the chain finishes instead of failing midway. Goatcounter's own privacy stance is the other reason to use it: the numbers come from a service that is not tracking your visitors individually.
What it is
A client for Goatcounter, the privacy-focused web analytics service, covering most of its API. It reads totals and hit series, and breaks traffic down by referrer, browser, operating system, screen size and location. The client initialises lazily, so tools can be listed before credentials are configured.
What you get
Goatcounter_get_stats_totalandGoatcounter_get_stats_hitsreturn overall totals and the hit seriesGoatcounter_get_stats_refsbreaks traffic down by referrerGoatcounter_get_stats_browsersandGoatcounter_get_stats_systemsbreak it down by browser and operating systemGoatcounter_get_stats_sizesandGoatcounter_get_stats_locationscover screen size and geographyGoatcounter_list_pathslists the pages being counted, andGoatcounter_list_sitesthe sites on the accountGoatcounter_get_mereports the authenticated account- Automatic retries on HTTP 429, honouring
X-Rate-Limit-Resetwhen present and falling back to exponential backoff with jitter, up to 5 attempts
Requirements
A Goatcounter site and an API token generated under Settings then API tokens, with the permissions matching what you plan to call. Set GOATCOUNTER_CODE to your site code — the subdomain part — and GOATCOUNTER_API_KEY to the token. Install with pip install goatcounter-mcp-server (package goatcounter-mcp-server, version 0.2.4) and run the goatcounter-mcp-server command.
Setup effort
One command plus a key — pip install goatcounter-mcp-server, then supply credentials
USE CASES
Finding out how a post actually did
Pull the hit series for the period and the paths behind it.
Working out where the traffic came from
Break the period down by referrer.
Checking what to test your site against
Read the browser, operating system and screen-size breakdowns.
Seeing which countries your readers are in
Pull the location breakdown for the period.
10 tools
Listed in project docs. Your client may show a different list.
Goatcounter_list_sitesGoatcounter_list_pathsGoatcounter_get_stats_totalGoatcounter_get_stats_hitsGoatcounter_get_stats_refsGoatcounter_get_stats_browsersGoatcounter_get_stats_systemsGoatcounter_get_stats_sizesGoatcounter_get_stats_locationsBEFORE YOU INSTALL
What to know first
Tools you get
10 tools named in the project's documentation.
Requires
- goatcounter-mcp-server on PATH
- GOATCOUNTER_API_KEY in your environment
- GOATCOUNTER_CODE in your environment
INSTALLATION
Connect your client
Server setup
pip install goatcounter-mcp-serverMCP Clients
Claude Desktop — pip
{
"mcpServers": {
"goatcounter-mcp-server": {
"command": "goatcounter-mcp-server",
"args": [],
"env": {
"PYTHONUNBUFFERED": "1",
"GOATCOUNTER_CODE": "<YOUR_GOATCOUNTER_CODE>",
"GOATCOUNTER_API_KEY": "<YOUR_GOATCOUNTER_API_KEY>"
}
}
}
}Claude Desktop — local build
{
"mcpServers": {
"goatcounter-mcp-server": {
"command": "uv",
"args": [
"--directory",
"<YOUR_PATH_TO_GOATCOUNTER_MCP_SERVER>",
"run",
"goatcounter-mcp-server"
],
"env": {
"PYTHONUNBUFFERED": "1",
"GOATCOUNTER_CODE": "<YOUR_GOATCOUNTER_CODE>",
"GOATCOUNTER_API_KEY": "<YOUR_GOATCOUNTER_API_KEY>"
}
}
}
}FastMCP dev mode
fastmcp dev src/goatcounter_mcp_server/server.py