Matomo-MCP
This server provides read-only analytics tools for Matomo, letting AI assistants query traffic, pages, referrers, events, goals, e-commerce, geo, devices, visit times, site search, real-time visitors, page performance, annotations, and any Matomo Reporting API method.
Site discovery:
matomo_list_siteslists accessible sites with IDs and URLs.Traffic summaries:
matomo_visits_summaryreturns visits, unique visitors, actions, bounce rate, actions per visit, and average duration.Page analytics:
matomo_pagescovers top URLs/titles, entry/exit pages, downloads, and outlinks.Referrer analysis:
matomo_referrersbreaks down channels, websites, search engines/keywords, social networks, campaigns, and AI assistants.Event tracking:
matomo_eventsgroups custom events by category, action, or name.Goal conversions:
matomo_goalslists configured goals and reports conversion counts, rates, and revenue.E-commerce insights:
matomo_ecommerceprovides revenue/order overviews and best sellers by product, SKU, or category.Geographic breakdowns:
matomo_georeports visits by country, continent, region, or city.Device/tech reports:
matomo_devicescovers device types, brands, models, browsers, OS, and resolutions.Visit timing:
matomo_visit_timesshows traffic by day of week or hour (server or local time).Site search analytics:
matomo_site_searchsurfaces keywords, no-result searches, and categories.Real-time monitoring:
matomo_realtimeoffers live counters and recent visit logs.Performance metrics:
matomo_page_performancereturns average network, server, transfer, DOM processing, and rendering times.Annotation correlation:
matomo_annotationsfetches timeline annotations to correlate with traffic changes.Full API access:
matomo_apiis an escape hatch to call any Matomo Reporting API method with native parameters (e.g., funnels, heatmaps, custom dimensions).
Allows AI agents to query Matomo analytics data, retrieving reports on visits, pages, referrers, goals, ecommerce, real-time visitors, and more via the Matomo Reporting API.
matomo-mcp
Talk to your Matomo Analytics. From Claude, Cursor, VS Code, or any MCP client.
15 curated, read-only analytics tools + a full-API escape hatch. Single binary, instant startup, context-friendly.
Quickstart · Clients · Tools · Configuration · FAQ
You ▸ How was traffic yesterday, and where did it come from?
Claude ▸ Yesterday you had 14,472 visits (11,416 unique visitors, 66% bounce rate).
Top acquisition channels:
1. Organic search — 6,120 visits (Google 92%)
2. Direct — 4,890 visits
3. AI assistants — 1,204 visits (↑ 31% vs. last week)
Want me to break down which landing pages converted best?Every question your Matomo dashboard can answer, your AI assistant can now answer too — including follow-ups, comparisons, and "why?".
✨ Why matomo-mcp?
🎯 Curated, not generated | 15 hand-crafted tools modeled on real analytics questions — not 70+ auto-generated API mirrors that flood the model's context and degrade tool selection. |
⚡ Instant startup | No introspection round-trips. One static binary, no Node, no Python, no runtime. Starts in milliseconds. |
🔒 Safe by default | Read-only reporting tools. Token sent via POST only (never in URLs/logs), redacted from every error. TLS verification on by default. |
🧠 Context-friendly | Row limits on every report and a hard response budget with actionable guidance — one tool call can never blow up the context window. |
📡 Real-time included | Live visitor counters and a visit log ( |
🧰 Never a cage |
|
🔁 Resilient | Automatic retries with backoff on 429/5xx/network hiccups. Helpful, hint-annotated error messages the model can act on. |
Related MCP server: mcp-server-wazuh
🚀 Quickstart
1. Install
Prebuilt binary (Linux, macOS, Windows) — grab it from Releases, or:
# Cargo
cargo install matomo-mcp
# From source
cargo install --git https://github.com/Liohtml/matomo-mcp
# Docker
docker pull ghcr.io/liohtml/matomo-mcp2. Get a Matomo API token
Matomo → Settings (⚙) → Personal → Security → Auth tokens → Create new token. View-only permissions are all it needs.
3. Verify the connection
matomo-mcp --url https://your-matomo.example.com --token YOUR_TOKEN --check✓ Connected — Matomo version 5.2.1
✓ Token grants access to 3 site(s):
#1 My Shop (https://shop.example.com)
#2 Blog (https://blog.example.com)
#3 Docs (https://docs.example.com)4. Connect your client ⬇
🔌 Connect your client
claude mcp add matomo \
--env MATOMO_URL=https://your-matomo.example.com \
--env MATOMO_TOKEN=YOUR_TOKEN \
--env MATOMO_DEFAULT_SITE_ID=1 \
-- matomo-mcpAdd to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\):
{
"mcpServers": {
"matomo": {
"command": "matomo-mcp",
"env": {
"MATOMO_URL": "https://your-matomo.example.com",
"MATOMO_TOKEN": "YOUR_TOKEN",
"MATOMO_DEFAULT_SITE_ID": "1"
}
}
}
}.cursor/mcp.json (project) or ~/.cursor/mcp.json (global):
{
"mcpServers": {
"matomo": {
"command": "matomo-mcp",
"env": {
"MATOMO_URL": "https://your-matomo.example.com",
"MATOMO_TOKEN": "YOUR_TOKEN",
"MATOMO_DEFAULT_SITE_ID": "1"
}
}
}
}.vscode/mcp.json:
{
"servers": {
"matomo": {
"type": "stdio",
"command": "matomo-mcp",
"env": {
"MATOMO_URL": "https://your-matomo.example.com",
"MATOMO_TOKEN": "${input:matomo-token}",
"MATOMO_DEFAULT_SITE_ID": "1"
}
}
},
"inputs": [
{
"id": "matomo-token",
"type": "promptString",
"description": "Matomo API token",
"password": true
}
]
}Any client that speaks MCP over stdio works with the generic shape:
{
"command": "matomo-mcp",
"args": [],
"env": {
"MATOMO_URL": "https://your-matomo.example.com",
"MATOMO_TOKEN": "YOUR_TOKEN",
"MATOMO_DEFAULT_SITE_ID": "1"
}
}{
"mcpServers": {
"matomo": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MATOMO_URL", "-e", "MATOMO_TOKEN", "-e", "MATOMO_DEFAULT_SITE_ID",
"ghcr.io/liohtml/matomo-mcp"
],
"env": {
"MATOMO_URL": "https://your-matomo.example.com",
"MATOMO_TOKEN": "YOUR_TOKEN",
"MATOMO_DEFAULT_SITE_ID": "1"
}
}
}
}Run the server once (on a workstation, LAN box, or container) and point any number of MCP clients at it:
matomo-mcp --url https://your-matomo.example.com --token YOUR_TOKEN --http 127.0.0.1:8080Clients connect to http://127.0.0.1:8080/mcp with the streamable HTTP
transport, e.g.:
claude mcp add --transport http matomo http://127.0.0.1:8080/mcpThe HTTP endpoint has no built-in authentication. Keep it bound to127.0.0.1, or put a reverse proxy with auth (or a firewall) in front
before exposing it beyond localhost.
SetMATOMO_DEFAULT_SITE_ID and the model never has to ask which site you mean.
No token at hand? Try it against the public demo: --url https://demo.matomo.cloud --default-site-id 1 (no token needed).
🧭 Tools
Tool | Answers questions like |
| "Which sites do we track?" |
| "How much traffic did we get last week?" |
| "What are our top pages? Where do people exit?" |
| "Where do visitors come from? Which campaigns work? What do AI assistants send us?" |
| "How often was the configurator opened?" |
| "What's our conversion rate per goal?" |
| "Revenue this month? Best-selling products?" |
| "Which countries/cities do visitors come from?" |
| "Mobile vs. desktop? Which browsers?" |
| "When during the day/week do people visit?" |
| "What do people search for on our site — and find nothing?" |
| "Who's on the site right now?" |
| "Which pages load slowly?" |
| "Which deploys or campaign launches line up with that traffic spike?" |
| Everything else — funnels, heatmaps, custom dimensions, any |
All tools accept site_id, period (day/week/month/year/range), date
(today, yesterday, 2026-07-01, last30, or start,end ranges), an optional
segment (e.g. deviceType==mobile;country==DE), and a row limit.
Prompts to try
"Compare this week's traffic with last week — what changed and why?"
"Top 10 landing pages by conversions this month, with bounce rates."
"Are we getting traffic from ChatGPT or Perplexity? Trend over 3 months."
"Which internal searches return no results? Suggest content we should create."
"Anything unusual in the visitor log right now?"
⚙️ Configuration
Flag | Env | Default | Description |
|
| — | Matomo instance URL (sub-directory installs like |
|
| — | API token ( |
|
| — | Site used when the model doesn't specify one |
|
| — | Extra HTTP headers ( |
|
|
| Per-request timeout |
|
|
| Response budget before truncation |
|
| — | Serve MCP over streamable HTTP on this address instead of stdio (endpoint: |
|
|
| Accept self-signed TLS certificates (explicit opt-in) |
| — | — | Verify URL + token + site access, then exit |
🆚 How is this different from FGRibreau/mcp-matomo?
mcp-matomo (which inspired this project — thanks! 🙏) introspects your Matomo instance at startup and generates one MCP tool per API method. matomo-mcp takes the opposite approach:
matomo-mcp | mcp-matomo | |
Tool set | 15 curated tools + escape hatch | ~70+ generated tools |
Model context cost | Small, stable | Large, instance-dependent |
Parameter types | Exact, hand-written enums/defaults | Inferred from parameter names |
Startup | Instant (no network I/O) | Introspection round-trips (or cached spec file) |
TLS verification | On by default | Disabled for introspection |
Sub-directory installs | ✅ | Path is overwritten |
Response size guard | Row limits + hard budget | — |
Retries on transient errors | ✅ | — |
Real-time (Live) tools | ✅ | — (not part of report metadata) |
If you want every API method as its own tool, use mcp-matomo. If you want the model to reliably pick the right tool and never flood its context, use matomo-mcp.
🩺 Troubleshooting
Either pass --default-site-id 1 (recommended) or let the model call matomo_list_sites first.
Run matomo-mcp --url ... --token ... --check. If it fails: regenerate the token (Settings → Personal → Security), make sure it has at least view access to the site.
MATOMO_URL must point at the Matomo root — the folder containing index.php. For https://example.com/matomo/index.php, use https://example.com/matomo/.
Inject the bypass headers: --header "CF-Access-Client-Id:..." --header "CF-Access-Client-Secret:..." (or via MATOMO_EXTRA_HEADERS).
That's the context guard doing its job. Ask for fewer rows, a shorter date range, or raise --max-response-chars.
🗺️ Roadmap
Streamable HTTP transport (
--http, host it once, connect many clients)matomo_annotations— read & correlate deploy markers with trafficMulti-instance support (one server, several Matomo installations)
Homebrew tap & winget manifest
MCP registry listing (official registry via
server.json, Glama)
Want one of these sooner? Open an issue — or a PR, see CONTRIBUTING.md.
🛠️ Development
cargo test # 37 tests, fully offline (wiremock)
cargo clippy --all-targets -- -D warnings
cargo run -- --url https://demo.matomo.cloud --default-site-id 1 --checkArchitecture and design decisions: docs/ARCHITECTURE.md.
📄 License & Credits
MIT. Not affiliated with or endorsed by Matomo — Matomo is a registered trademark of InnoCraft Ltd.
Built with rmcp, the official Rust MCP SDK. Inspired by FGRibreau/mcp-matomo.
MCP Registry name:
mcp-name: io.github.Liohtml/matomo-mcp
If matomo-mcp saves you a dashboard visit, a ⭐ helps others find it.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceMCP Server for Nutanix Prism Central14MIT
- MIT
- AlicenseBqualityBmaintenanceMCP Server for Apache Pinot1417Apache 2.0
- -licenseNot gradedqualityNot gradedmaintenanceEnables AI models to interact with Matomo analytics through a complete MCP server implementation. Provides tools for retrieving analytics data, managing sites, and generating reports with zero configuration setup.
Related MCP Connectors
MCP server for Tinify image optimization — one tool, max optimization
MCP Server for agents to onboard, pay, and provision services autonomously with InFlow
MCP server for Blockscout
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Liohtml/matomo-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server