Skip to main content

MCP server for Matomo Reporting API

Project description

Matomo MCP Server

Tests Code Quality Python 3.10+ License: MIT

A Model Context Protocol (MCP) server that provides access to Matomo's Reporting API.

Features

  • Access Matomo reporting data through MCP tools
  • Query website statistics, visitor information, and analytics data
  • Support for multiple Matomo sites
  • Secure API token authentication

Installation

pip install -e .

Configuration

The server requires the following environment variables:

  • MATOMO_URL: Your Matomo instance URL (e.g., https://analytics.example.com)
  • MATOMO_TOKEN: Your Matomo API authentication token

You can obtain an API token from your Matomo instance under: Personal Settings → Security → Auth tokens

Usage with Claude Desktop

Add this to your Claude Desktop configuration:

MacOS

~/Library/Application Support/Claude/claude_desktop_config.json

Windows

%APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "matomo": {
      "command": "python",
      "args": ["-m", "matomo_mcp"],
      "env": {
        "MATOMO_URL": "https://your-matomo-instance.com",
        "MATOMO_TOKEN": "your_api_token_here"
      }
    }
  }
}

Available Tools

get_site_info

Get information about a specific Matomo site.

Parameters:

  • site_id: The ID of the site (integer)

get_visits_summary

Get a summary of visits for a site within a date range.

Parameters:

  • site_id: The ID of the site (integer)
  • period: Time period (day, week, month, year, range)
  • date: Date or date range (e.g., "2024-01-01", "last30", "today")

get_page_urls

Get the most visited page URLs for a site.

Parameters:

  • site_id: The ID of the site (integer)
  • period: Time period (day, week, month, year, range)
  • date: Date or date range
  • limit: Maximum number of results (default: 10)

get_countries

Get visitor statistics by country.

Parameters:

  • site_id: The ID of the site (integer)
  • period: Time period (day, week, month, year, range)
  • date: Date or date range
  • limit: Maximum number of results (default: 10)

get_user_settings

Get visitor browser and device information.

Parameters:

  • site_id: The ID of the site (integer)
  • period: Time period (day, week, month, year, range)
  • date: Date or date range

query_custom_report

Execute a custom Matomo API query.

Parameters:

  • method: Matomo API method (e.g., "Actions.getPageUrls")
  • site_id: The ID of the site (integer)
  • period: Time period (day, week, month, year, range)
  • date: Date or date range
  • additional_params: Optional JSON object with additional parameters

Development

Install development dependencies:

pip install -e ".[dev]"

Run tests:

pytest

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matomo_mcp-1.0.0a1.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matomo_mcp-1.0.0a1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file matomo_mcp-1.0.0a1.tar.gz.

File metadata

  • Download URL: matomo_mcp-1.0.0a1.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for matomo_mcp-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 274577ae4722f07a1d85158fea4df964d0acd229a3cf380d8ec0198603f2a201
MD5 d30196228cc704191089bfac032bed0f
BLAKE2b-256 eab65977bcc7eeb4617cd3480e616264d985d432c9e8fdd519745ed6fb26bb9a

See more details on using hashes here.

File details

Details for the file matomo_mcp-1.0.0a1-py3-none-any.whl.

File metadata

  • Download URL: matomo_mcp-1.0.0a1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for matomo_mcp-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 36b549fb9cb73f2b0d01234342abfcb7c1beb3eb662653869564974ae302241a
MD5 dc4b1092c8cda9ff87a8928b3946f775
BLAKE2b-256 e42eac90ff09689f360f33ba3f26d6b829ca28cf75b5ad049dfab711a1483d98

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page