Labsco
jakeyShakey logo

Umami Analytics

β˜… 8

from jakeyShakey

Access website analytics data from your Umami instance.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

Umami Analytics MCP Server

A Model Context Protocol (MCP) server that enhances Claude's capabilities by providing access to website analytics data from Umami. This server allows Claude to analyze user behavior, track website performance, and provide data-driven insights.

The codebase has been generated from start to finish using Claude Sonnet 3.5 and Cursor.

alt text

What It Does

This server connects Claude to your Umami analytics platform, enabling it to:

  • Analyze user journeys and behavior patterns
  • Track website performance metrics
  • Monitor real-time visitor activity
  • Capture and analyze webpage content
  • Generate insights from historical analytics data

How It Works

The server provides the following tools to Claude to analyze website data:

Available Tools

  • get_websites: Retrieve a list of websites and their IDs in your Umami account
  • get_website_stats: Get key metrics like pageviews, visitors, bounce rate for a website
  • get_website_metrics: Analyze specific metrics like URLs, referrers, browsers, countries
  • get_pageview_series: Get time-series pageview data with customizable intervals
  • get_active_visitors: Monitor current number of active visitors on a website
  • get_session_ids: Retrieve session IDs for specific events or time periods
  • get_tracking_data: Get detailed activity data for a specific session ID
  • get_docs: Perform semantic search on many user journeys, returning the most relevant chunks for a given question
  • get_screenshot: Capture visual snapshots of webpages
  • get_html: Retrieve and analyze webpage HTML source code

Each tool has a description and a list of arguments that can be passed to it. These are used to provide context and information to allow Claude to effectively select the right tool/s for the job, and provide the correct paremeters.

Most of these tools pull data directly from the Umami API into Claude Desktop, however get_docs adds in a semantic search step to avoid context window issues with Claude as well as saving on token usage. All of the user journeys for a given event are retrieved using the Umami API and then these are chunked into smaller sections and embedded using an open soruce sentence transformer model from hugging face. Then, based on the question, the most relevant chunks are retrieved and returned to Claude, allowing for analysis of specific actions and behaviours performed by users on the website, something hard to replicate with traditional data visualisation tools. The implementation of this embedding and semantic search is in the src/analytics_service/embeddings.py file.

Additoanlly, the get_screenshot and get_html tools use the open source Crawl4AI web crawler to retrieve the HTML source code and screenshot of a given website. The screenshots have to be downsampled to reduce their size to avoid context window issues with Claude. This allows you to provide context to Claude about how the website is structured and how it looks, allowing for more accurate and relevant recomendations on improving site performance. The implementation of the web crawler is in the src/analytics_service/crawler.py file.

alt text