mirror of
https://github.com/Dasemu/umami-analytics-mcp.git
synced 2026-11-26 07:16:08 +00:00
Add root CLAUDE.md, docs/, LESSONS.md, .env.example, project hooks (.claude/settings.json) and CI workflows (lint/test + versioning), per the standard repo bootstrap. No lint/test tooling exists yet, so hooks and CI only run a py_compile sanity check; CI/versioning target the development/main branch convention even though development does not exist yet. Deployment stays on Nixpacks for now (flagged in LESSONS.md pending a decision on migrating to the standard LXC/VPS+systemd setup). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1.5 KiB
1.5 KiB
CLAUDE.md
Overview
MCP server exposing Umami analytics (pageviews, metrics, active visitors) as tools over streamable-HTTP, for use by MCP clients (e.g. Claude).
Commands
- Dev:
python server.py(readsUMAMI_HOST,UMAMI_USERNAME,UMAMI_PASSWORDfrom env; see.env.example) - Install:
pip install -r requirements.txt - Test: no test suite yet
- Lint: no linter configured yet
- Build: none (plain Python, run directly;
nixpacks.tomldefines the start command for Nixpacks-based hosting)
Architecture
Single-file server (server.py) built on mcp.server.mcpserver.MCPServer. Logs into the
Umami API on first request, caches the bearer token in memory, and re-authenticates once on
a 401. Each @mcp.tool() function wraps one Umami REST endpoint. See docs/ for more.
Conventions
- Keep all tools as thin wrappers around the Umami API; push validation (e.g.
metric_type) into the tool function, not into_request. - Dates/times accepted from callers are ISO strings or raw millisecond epochs (
_to_ms).
Workflow quirks
- No tests or linter are set up; CI only compiles the source as a sanity check.
Deployment
Currently started via Nixpacks (nixpacks.toml → python server.py). This does not yet
follow the standard LXC/VPS + systemd + authenticated update-endpoint setup described in the
web-deploy skill; see LESSONS.md.
Gotchas
UMAMI_HOST,UMAMI_USERNAME,UMAMI_PASSWORDare required; the process raises on import if any is missing (no defaults).