Logo Umami 分析 MCP 服务器

Umami 分析 MCP 服务器

Cộng đồng
jakeyShakey

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…

Nhà phát hànhjakeyShakey
Kho mãumami_mcp_server
Ngôn ngữPython
Bản fork
6
Sao
9
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Umami 分析 MCP 服务器 cung cấp các chức năng MCP cho các ứng dụng khách AI và tác nhân AI tương thích.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Mẫu cấu hình có thể sao chép ngay

    Dùng các đoạn cấu hình mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Mức độ quan tâm của cộng đồng đến kho mã

    9 sao và 6 bản fork từ kho mã được liên kết.

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

Setup Guide

Prerequisites

  • install uv: pip install uv
  1. Claude Desktop Configuration

    Add the following to your Claude Desktop config file:

    • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%/Claude/claude_desktop_config.json
    json
    {
      "mcpServers": {
        "analytics_service": {
          "command": "uv",
          "args": [
            "--directory",
            "/path/to/analytics_service",
            "run",
            "analytics-service"
          ],
          "env": {
           "UMAMI_API_URL": "https://example.com",
           "UMAMI_USERNAME": "yourUmamiUsername",
           "UMAMI_PASSWORD": "yourUmamiPassword", 
           "UMAMI_TEAM_ID": "yourUmamiTeamId"
         }
        }
      }
    }

    Replace /path/to/analytics_service with the actual path to your analytics_service directory.

    For the UMAMI_API_URL, replace https://example.com with the URL of the version of Umami you are using (either self-hosted or hosted on Umami Cloud). For the UMAMI_USERNAME and UMAMI_PASSWORD, replace yourUmamiUsername and yourUmamiPassword with your Umami account credentials. For the UMAMI_TEAM_ID, replace yourUmamiTeamId with the ID of the team you want to analyse.

  2. Opening Claude Desktop

When you open Claude Desktop, it will automatically begin to connect to the analytics_service MCP server. Allow up to a few minutes as the server is initialised and the correct packages are installed. When the server is ready, you will see 10 MCP tools available in the bottom right of the chat window. This is signified with a small hammer icon and the number 10 next to it.

alt text

Additionally, if you haven't already, it is strongly recommended that you enable the "Analysis tool" in Feature Preview within Claude Desktop. This will allow Claude to build you dashboards as well as other visualisations for your data. To do this, in the left-hand side panel, find the "Feature Preview" tab and in it, enable the "Analysis tool". LaTeX Rendering can also be enabled in the same section.

alt text

How to Use the Server

Getting Started

The simplest way to start is to use the Create Dashboard Prompt provided by the server. This is selected by clicking the "Attach from MCP" attachment button at the bottom left of the chat window. Then selecting choose implementation and then the Create Dashboard Prompt.

alt text

This will guide you through the process of creating a dashboard for your website, asking for:

  1. The name of the website you want to analyze
  2. The start and end dates for the analysis
  3. The timezone of the website

Once you have provided this information, the server will generate a txt file instructing Claude how to build the dashboard. Press enter in the chat window and Claude will do the rest. You can then ask Claude to make any changes to the dashboard or add any other visualisations.

alt text

Natural Language Usage

For a more customisable experience, you can talk directly to Claude and specify your own requirements such as what data you want to see on the dashboard and what visualisations you want to use. Additionally you can analyse user journeys to pinpoint specific pain points and add screenshots from your site to give Claude extra context

The necessary tools to complete your request will be used by Claude automatically. Simply make your request in natural language and Claude will decide which tools to use. If you want to see a list of all the tools available, you can ask Claude to list them for you or click on the hammer icon in the bottom right of the chat window.

alt text

Create your own prompts

You can also create your own prompts for workflows that you use regularly. To do this, you will need to:

  1. Define Your Prompt Structure Create a prompt definition that includes:

    • name: A unique identifier for your prompt
    • description: A clear explanation of what the prompt does
    • arguments: List of input parameters your prompt needs

    Add this to the list_prompts() function in src/analytics_service/server.py:

    Example structure:

    python
    @app.list_prompts()
    async def list_prompts():
        return [
            # ... existing prompts ...
            {
                "name": "Your Prompt Name",
                "description": "Your prompt description",
                "arguments": [
                    {
                        "name": "Parameter Name 1",
                        "description": "Parameter description",
                        "required": True/False
                    },
                    {
                        "name": "Parameter Name 2",
                        "description": "Parameter description",
                        "required": True/False
                    }
                ]
            }
        ]
  2. Implement the Prompt Add your prompt handling logic in the get_prompt() function in src/analytics_service/server.py:

    python
    @app.get_prompt()
    async def get_prompt(name: str, arguments: Any):
     # ... existing prompts ...
        if name == "Your Prompt Name":
            return {
                "messages": [
                    {
                        "role": "user",
                        "content": {
                            "type": "text",
                            "text": f"Your prompt template with {arguments['Parameter Name']}"
                        }
                    }
                ]
            }

    When defining messages in your prompt, the role field is crucial for structuring the conversation:

    • Use "role": "user" for messages that simulate user input or questions
    • Use "role": "assistant" for messages that represent Claude's responses or instructions
    • Use "role": "system" for messages that set context or provide high-level instructions

    The content field in each message must specify a type. Available types are:

    • "type": "text" - For plain text content
    • "type": "resource" - For including external resources like files, logs, or other data. Must include a resource object with:
      • uri: The resource identifier
      • text: The actual content
      • mimeType: The MIME type of the content (e.g., "text/plain", "text/x-python")

    While resources do include their content in the text field, using the resource type provides several important benefits:

    1. Content Type Awareness: The mimeType field tells Claude how to interpret the content (e.g., as Python code, plain text, or other formats)
    2. Source Tracking: The uri field maintains a reference to where the content came from, which can be useful for:
      • Tracking the origin of data
      • Enabling updates if the source changes
      • Providing context about the resource's location and purpose
    3. Structured Data Handling: The resource format allows for consistent handling of different types of content while maintaining metadata about each resource

    Here's an example showing different roles and content types:

    python
    "messages": [
        {
            "role": "system",
            "content": {
                "type": "text",
                "text": "Analyze the following log file and code for potential issues."
            }
        },
        {
            "role": "user",
            "content": {
                "type": "resource",
                "resource": {
                    "uri": "logs://recent",
                    "text": "[2024-03-14 15:32:11] ERROR: Connection timeout",
                    "mimeType": "text/plain"
                }
            }
        },
        {
            "role": "assistant",
            "content": {
                "type": "text",
                "text": "I notice a connection timeout error. Let me examine the related code."
            }
        },
        {
            "role": "user",
            "content": {
                "type": "resource",
                "resource": {
                    "uri": "file:///code.py",
                    "text": "def example():\n    pass",
                    "mimeType": "text/x-python"
                }
            }
        }
    ]

    For most prompts, the text type with user role is more than sufficient and allows Claude more control and creativity in its responses. For more complex workflows however, multiple messages with different roles and types allow for a more structured conversation flow and more user control over the response.

  3. Best Practices for Creating Prompts

    • Make your prompts focused and specific

    • Include clear validation requirements for arguments

    • Use descriptive names for parameters

    • Include example values in parameter descriptions

    • Structure the prompt template to guide Claude effectively

    • Consider error handling and edge cases

    • Test the prompt with various inputs

Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "jakeyshakey-umami_mcp_server": {
      "command": "uvx",
      "args": [
        "analytics-service"
      ]
    }
  }
}

Dùng MCP Umami 分析 MCP 服务器 với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Umami 分析 MCP 服务器, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Thiết lập trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Thiết lập trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh thiết lập trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Để tiến trình tiếp tục chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Để tiến trình tiếp tục chạy trong cửa sổ Terminal khi bạn dùng các công cụ MCP.
3

Thêm Umami 分析 MCP 服务器 làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Umami 分析 MCP 服务器.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "jakeyshakey-umami_mcp_server": {
      "command": "npx",
      "args": [
        "-y",
        "analytics-service"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Umami 分析 MCP 服务器, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Umami 分析 MCP 服务器.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện trên TypingMind dùng các công cụ MCP đã bật với mô hình AI đã chọn
Bạn có thể dùng Umami 分析 MCP 服务器 giúp tôi làm việc này không?
Umami 分析 MCP 服务器
Được. Tôi đọc rồi.
Đây là kết quả tôi tìm được bằng Umami 分析 MCP 服务器.

Câu hỏi thường gặp

Máy chủ MCP Umami 分析 MCP 服务器 dùng để làm gì?

Umami 分析 MCP 服务器 là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Umami 分析 MCP 服务器 với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Umami 分析 MCP 服务器 với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Umami 分析 MCP 服务器 với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Umami 分析 MCP 服务器, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Umami 分析 MCP 服务器 với TypingMind?

Umami 分析 MCP 服务器 hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Umami 分析 MCP 服务器 cung cấp những công cụ nào trong TypingMind?

Umami 分析 MCP 服务器 cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Umami 分析 MCP 服务器 không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Umami 分析 MCP 服务器 yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇