Skip to main content

Umami MCP Server

MCP server exposing read-only analytics from the current Umami Cloud API and self-hosted Umami 3.x.

Support matrix

Deployment Support API root Authentication
Umami Cloud (current) Supported https://api.umami.is/v1 API key
Self-hosted Umami 3.x Supported https://host.example/api Username/password
Self-hosted Umami 2.x Not supported; any future integration will be separate — —
Umami 1.x Not supported — —

The /v1 suffix belongs to the current Cloud API URL. It does not mean that this server supports version 1 of the self-hosted Umami application.

Requirements and run command

  • Python 3.11+
  • uv

Run the published package directly:

uvx umami-mcp-server

Configuration

Environment variables:

  • UMAMI_API_KEY: Umami Cloud API key.
  • UMAMI_USERNAME: self-hosted Umami 3.x username.
  • UMAMI_PASSWORD: self-hosted Umami 3.x password.
  • UMAMI_API_BASE: optional; defaults to https://api.umami.is/v1. For self-hosted deployments, set the API root including /api.

Choose exactly one authentication mode: a Cloud API key or self-hosted username and password. Cloud API keys use the documented Authorization: Bearer scheme; standard self-hosted Umami 3.x does not support API keys.

Example MCP configuration for Cloud:

{
  "mcp": {
    "umami": {
      "type": "local",
      "command": ["uvx", "umami-mcp-server"],
      "environment": {
        "UMAMI_API_KEY": "YOUR_UMAMI_CLOUD_API_KEY",
        "UMAMI_API_BASE": "https://api.umami.is/v1"
      },
      "enabled": true
    }
  }
}

Self-hosted Umami 3.x:

{
  "mcp": {
    "umami": {
      "type": "local",
      "command": ["uvx", "umami-mcp-server"],
      "environment": {
        "UMAMI_USERNAME": "YOUR_USERNAME",
        "UMAMI_PASSWORD": "YOUR_PASSWORD",
        "UMAMI_API_BASE": "https://your-umami.example/api"
      },
      "enabled": true
    }
  }
}

Tools

  • get_websites: return one page of websites. page >= 1 and 1 <= page_size <= 100.
  • get_stats: summary pageviews, visitors, visits, bounces, total time, and comparison.
  • get_pageviews: pageview and session time series.
  • get_metrics: compact or expanded metrics. 1 <= limit <= 500 and 0 <= offset <= 10000.
  • get_active: current active visitors.

Every website_id, segment, and cohort identifier is validated as a UUID before an HTTP request is sent.

Time ranges

Datetime parameters accept ISO datetimes. Naive values are interpreted as UTC. The four range rules are:

Inputs Range
neither now minus seven days → now
only end_at seven days before end_at → end_at
only start_at start_at → now
both explicit range

The end must be later than the start. Pageview units are minute, hour, day, month, and year. Timezones must be valid IANA names such as UTC or Europe/Rome. Comparisons are prev or yoy.

Metrics and filters

Metric types:

path, fullPath, entry, exit, referrer, domain, title, query,
event, tag, hostname, utmSource, utmMedium, utmCampaign,
utmContent, utmTerm, browser, os, device, screen, language,
country, city, region, distinctId, channel

Documented Umami 3 filters:

path, referrer, title, query, browser, os, device, country,
region, city, language, hostname, tag, event, distinctId,
utmSource, utmMedium, utmCampaign, utmContent, utmTerm,
segment, cohort

Tool input uses snake_case for distinct_id and the UTM filters; the server serializes the upstream camelCase names automatically.

Reliability and safe errors

One HTTP client and connection pool is shared for the MCP server lifespan. Login-mode tokens are shared, concurrent login/refresh is synchronized, and a request can perform at most three analytics sends and one token refresh. GET requests retry only network failures, timeouts, rate limits, and transient 500, 502, 503, and 504 responses. Retry-After is honored up to 60 seconds.

Errors are exposed as controlled categories: authentication, rate limit, timeout, network, upstream failure, and invalid response. Public messages and logs exclude response bodies, credentials, headers, complete query URLs, and raw HTTP/Pydantic exception values.

Cache and observability

On the current MCP revision, the static tools/list catalog has a public five-minute cache hint. Tool order and schema content are deterministic, and the catalog contains no Umami data, website IDs, or credentials. Legacy protocol serialization remains unchanged and does not include cache fields.

MCP SDK already traces incoming MCP operations. Umami MCP Server adds a child span for each logical Umami analytics request, a child login span when needed, and metrics for duration, errors, retries, rate limits, and token refreshes. Only W3C Trace Context is propagated to Umami; MCP baggage is not forwarded.

The base package uses only the OpenTelemetry API, so instrumentation remains no-op without an SDK and exporter. Install the optional stack with umami-mcp-server[otel], configure it externally, or disable it explicitly with OTEL_SDK_DISABLED=true. See the observability guide for setup, exported names, redaction policy, and OTLP examples.

Development

uv sync --dev
uv run ruff format . --check
uv run ruff check .
uv run pyright
uv run pytest

The optional live Cloud contract test requires UMAMI_LIVE_CLOUD_API_KEY and UMAMI_LIVE_CLOUD_WEBSITE_ID; UMAMI_LIVE_CLOUD_API_BASE may override the default Cloud root.

Metadata

Release files for umami-mcp-server 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for umami-mcp-server 0.3.1
File Size Uploaded Provenance
umami_mcp_server-0.3.1.tar.gz 13.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for umami-mcp-server 0.3.1
File Interpreter ABI Platform
umami_mcp_server-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 29.7 kB

Release files / umami_mcp_server-0.3.1.tar.gz

Download URL umami_mcp_server-0.3.1.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e041a4767c33c07c7fffe8b68c3c68915e664c3c7e93db2994e5fb22ab8359e0
BLAKE2b-256 checksum
How to use checksums
20d1569ce121a52965de7e3089eeecf129d65a53685a3d43f5aebebdb67cde63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / umami_mcp_server-0.3.1-py3-none-any.whl

Download URL umami_mcp_server-0.3.1-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
debcf4662c2f55873e8f70ec8401e6ada0bb0af89aa0a0636045455ee3ffe355
BLAKE2b-256 checksum
How to use checksums
c523d28e9eac81194c6ddfdfa4f2cc349b66f0ca71c698c9c018ed0ff3f7edd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for umami-mcp-server 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page