Logo

AI-Powered Analytics Reports — Read Your Umami Data with MCP

Automate analytics reporting with AI using MiraScope, Ollama, and Umami. Intelligent insights from your website data with natural language queries.

Rob Helmer

Rob Helmer

6/24/2025 · 6 min read

Tags: analytics ai llm umami automation mcp


AI Analytics Dashboard — Automated Report Generation from Website Data

I’ve been running Umami Analytics for a while now, and while I love the privacy-first approach and clean data it provides, I found myself spending too much time manually digging through the dashboard to understand trends and create reports.

So I built something to let AI do the heavy lifting: an automated analytics reporting tool that connects Llama models to my Umami data using the Model Context Protocol (MCP).

🤖 What It Does

The setup combines a few powerful tools:

  • MiraScope: MCP client that orchestrates AI interactions
  • Ollama (or Cloudflare Workers): Runs Llama models locally or in the cloud
  • Umami MCP Server: Connects directly to your Umami instance to fetch analytics data

Instead of clicking through dashboards, I can now ask questions like:

  • “Show me a summary of last month’s traffic”
  • “What are my top-performing pages this week?”
  • “Generate a comprehensive quarterly report”
  • “How does this month compare to last month?”

The AI reads the raw data from Umami and generates intelligent insights in natural language.

🚀 How I Set It Up

Getting started is straightforward:

pip install uv
uv run --with-requirements requirements.txt run.py --chat

The configuration connects to your Umami instance:

UMAMI_API_URL=https://your-umami-instance.com/api
UMAMI_API_TOKEN=your-api-token
UMAMI_WEBSITE_ID=your-website-id
BACKEND=ollama  # or 'cloudflare'

For the AI backend, I’m using Ollama locally with Llama 3.1, but you can also use Cloudflare Workers for cloud-based inference.

💡 Why This Approach Works

Privacy-First: Your analytics data never leaves your control. Umami keeps visitor data anonymous, and the AI processing happens locally or in your chosen cloud environment.

Natural Language Interface: Instead of learning dashboard UIs, you ask questions in plain English and get comprehensive answers.

Automated Insights: The AI spots patterns and trends that might not be obvious from raw numbers, like seasonal traffic patterns or content performance correlations.

Flexible Reporting: Generate everything from quick summaries to detailed monthly reports, all customized to your specific needs.

Demo

Here’s a quick chat session, if the --chat is not provided then it simply produces the report and quits:

% uv run --with-requirements requirements.txt run.py --chat
🚀 Starting Analytics Dashboard
   Website: rhelmer.org
   Date Range: 2025-06-01 to 2025-07-01
   Timezone: UTC
   Chat Mode: Enabled

✅ Connected to MCP server
✅ Session initialized

📊 Getting real data for rhelmer.org...
Available MCP tools: ['get_websites', 'get_tracking_data', 
'get_website_stats', 'get_session_ids', 'get_website_metrics', 
'get_docs', 'get_screenshot', 'get_html', 'get_pageview_series', 
'get_active_visitors']
Available websites: 1 found
Found website ID for rhelmer.org: 
c7caa57d-ce17-4cd0-aeeb-6769c703ed5c
Successfully retrieved website stats
Successfully retrieved pageview series
Successfully retrieved url metrics
Successfully retrieved active visitors
📋 Available prompts: ['Create Dashboard']

🤖 Generating dashboard with AI...
Cloudflare AI failed: Missing CLOUDFLARE_ACCOUNT_ID or 
CLOUDFLARE_API_TOKEN environment variables
Falling back to Ollama...

📈 DASHBOARD ANALYSIS (OLLAMA):
========================================================================
Based on the provided data, here's a comprehensive dashboard analysis:

**Overview**

The website `rhelmer.org` has seen a steady increase in traffic over 
the past month. The metrics show that the majority of visitors come 
from within the organization, suggesting a strong internal focus.

**Traffic Trends**

| Date       | Sessions |
| ---------- | -------- |
| 2025-06-01 | 10       |
| 2025-06-02 | 12       |
| 2025-06-03 | 15       |
| ...        | ...      |
| 2025-07-01 | 30       |

The traffic trend suggests a steady increase in sessions over the past 
month, with a slight spike on July 1st. However, please note that data 
is missing for June 16th and 23rd.

**Metrics Analysis**

According to the metrics URL, the top pages are:

| Page       | Visits |
| ---------- | ------ |
| /          | 160    |
| /blog/     | 111    |
| /projects/ | 84     |

The most visited page is `/`, followed closely by `/blog/`. However, 
please note that data is missing for some pages.

**Active Visitors**

According to the active visitors metric, there is only one visitor 
currently online:

```
{
  "visitors": 1
}
```

This suggests that there may be a high level of engagement with the 
website at this moment, but it's unclear whether this will continue.

**Insights and Recommendations**

Based on the available data, here are some insights and 
recommendations:

* The website appears to have a strong internal focus, which is 
  beneficial for organizations.
* However, the lack of data for certain dates (June 16th and 23rd) 
  makes it difficult to determine the overall traffic trend accurately.
* To improve the dashboard analysis, more data would be needed to fill 
  in these gaps.
* Consider adding a "Missing Data" section to the dashboard to 
  highlight areas where data is unavailable.
* For the `active_visitors` metric, consider adding a timestamp or 
  date range to help contextualize the visitor count.

**Visualizations**

Here are some suggested visualizations based on the available data:

1. A line chart showing the traffic trend over time (excluding missing 
   dates).
2. A bar chart comparing the number of visitors to different pages.
3. A map showing the geographic distribution of visitors (if this data 
   is available).

However, please note that these visualizations will only be possible 
if more data becomes available.

**Next Steps**

To further improve the dashboard analysis, I recommend:

1. Gathering additional data for missing dates.
2. Adding a "Missing Data" section to highlight areas where data is 
   unavailable.
3. Creating a more comprehensive traffic trend visualization with line 
   chart and bar chart options.
4. Adding geographic distribution visualizations (if this data becomes 
   available).

Please note that these recommendations are based on the provided data, 
which may be subject to change or updates.
========================================================================

✅ Analysis appears to be based on real data

🤖 Entering chat mode! Ask questions about your analytics data.
Type 'quit', 'exit', or 'q' to leave chat mode.


📊 Your question:

🔄 What’s Next

I’m planning to add:

  • Scheduled report generation (weekly/monthly automated emails)
  • Custom report templates for different stakeholders
  • Integration with more analytics sources beyond Umami
  • Historical trend analysis and forecasting

The beauty of using MCP is that it’s extensible — I can easily add new data sources or AI capabilities as needed.

🔗 Try It Yourself

The project is open source and designed to work with any Umami instance. Whether you’re self-hosting or using Umami Cloud, you can connect your data and start getting AI-powered insights in minutes:

https://github.com/rhelmer/umami-mcp-llama

It’s particularly useful if you manage multiple sites or need to generate regular reports for clients or stakeholders — the AI handles the analysis while you focus on acting on the insights.