Skip to main content
Glama
Matomo MCP Server

Matomo MCP Server

by thichcode

Matomo MCP Server

MCP (Model Context Protocol) server để quản trị Matomo Analytics. Server này cung cấp các công cụ để tương tác với Matomo API thông qua giao diện MCP.

Tính năng

Quản lý Sites

  • Lấy danh sách tất cả sites

  • Lấy thông tin chi tiết của một site

  • Thêm site mới

  • Cập nhật thông tin site

  • Xóa site

Quản lý Users

  • Lấy danh sách tất cả users

  • Lấy thông tin chi tiết của một user

  • Thêm user mới

  • Cập nhật thông tin user

  • Xóa user

  • Thiết lập quyền truy cập cho user

Quản lý Goals

  • Lấy danh sách goals của site

  • Thêm goal mới

  • Cập nhật goal

  • Xóa goal

Quản lý Segments

  • Lấy danh sách segments

  • Thêm segment mới

  • Cập nhật segment

  • Xóa segment

Báo cáo Analytics

  • Tổng quan lượt truy cập

  • Top pages được truy cập nhiều nhất

  • Top keywords

  • Top referrers

  • Visitor log

Quản lý Hệ thống

  • Thông tin hệ thống

  • Quản lý plugins

  • Kích hoạt/vô hiệu hóa plugins

Related MCP server: Yandex Metrika MCP

Cài đặt

  1. Clone repository:

git clone <repository-url>
cd matomo-mcp
  1. Cài đặt dependencies:

npm install
  1. Build project:

npm run build

Cấu hình

Tạo file .env trong thư mục gốc:

MATOMO_BASE_URL=https://your-matomo-instance.com
MATOMO_TOKEN_AUTH=your-api-token

Sử dụng

Chạy server:

npm start

Chạy trong chế độ development:

npm run dev

Các Tools có sẵn

1. matomo_connect

Kết nối đến Matomo instance.

Tham số:

  • baseUrl: URL của Matomo instance

  • tokenAuth: Token xác thực API

2. matomo_get_sites

Lấy danh sách tất cả sites.

3. matomo_get_site

Lấy thông tin chi tiết của một site.

Tham số:

  • siteId: ID của site

4. matomo_add_site

Thêm site mới.

Tham số:

  • name: Tên site

  • urls: Danh sách URLs

  • timezone: Múi giờ (tùy chọn, mặc định: UTC)

5. matomo_get_users

Lấy danh sách tất cả users.

6. matomo_add_user

Thêm user mới.

Tham số:

  • userLogin: Tên đăng nhập

  • email: Email

  • password: Mật khẩu

  • alias: Bí danh (tùy chọn)

7. matomo_get_goals

Lấy danh sách goals của site.

Tham số:

  • siteId: ID của site

8. matomo_add_goal

Thêm goal mới.

Tham số:

  • siteId: ID của site

  • name: Tên goal

  • description: Mô tả

  • matchAttribute: Thuộc tính khớp

  • pattern: Mẫu khớp

  • patternType: Loại mẫu

9. matomo_get_visits_summary

Lấy tổng quan lượt truy cập.

Tham số:

  • siteId: ID của site

  • date: Ngày (YYYY-MM-DD)

  • period: Chu kỳ (day, week, month, year)

10. matomo_get_top_pages

Lấy top pages.

Tham số:

  • siteId: ID của site

  • date: Ngày (YYYY-MM-DD)

  • period: Chu kỳ (tùy chọn)

  • limit: Số lượng kết quả (tùy chọn)

11. matomo_get_system_info

Lấy thông tin hệ thống.

Ví dụ sử dụng

Kết nối đến Matomo:

{
  "name": "matomo_connect",
  "arguments": {
    "baseUrl": "https://analytics.example.com",
    "tokenAuth": "your-api-token"
  }
}

Lấy danh sách sites:

{
  "name": "matomo_get_sites",
  "arguments": {}
}

Thêm site mới:

{
  "name": "matomo_add_site",
  "arguments": {
    "name": "My Website",
    "urls": ["https://example.com", "https://www.example.com"],
    "timezone": "Asia/Ho_Chi_Minh"
  }
}

Lưu ý

  • Đảm bảo bạn có quyền truy cập API với token xác thực hợp lệ

  • Một số chức năng có thể yêu cầu quyền admin

  • Luôn kiểm tra kết nối trước khi sử dụng các tools khác

Đóng góp

Mọi đóng góp đều được chào đón! Vui lòng tạo issue hoặc pull request.

License

MIT License

Available Tools

11 tools
matomo_add_goalC

Thêm một goal mới cho site

Inputs: siteId (required), name (required), description (required), matchAttribute (required), +2 more.

matomo_add_siteC

Thêm một site mới vào Matomo

Inputs: name (required), urls (required), timezone.

matomo_add_userC

Thêm một user mới vào Matomo

Inputs: userLogin (required), email (required), password (required), alias.

matomo_connectC

Kết nối đến Matomo instance với URL và token xác thực

Inputs: baseUrl (required), tokenAuth (required).

matomo_get_goalsC

Lấy danh sách goals của một site

Inputs: siteId (required).

matomo_get_siteC

Lấy thông tin chi tiết của một site

Inputs: siteId (required).

matomo_get_sitesB

Lấy danh sách tất cả các sites trong Matomo

Inputs: no named parameters.

matomo_get_system_infoC

Lấy thông tin hệ thống Matomo

Inputs: no named parameters.

matomo_get_top_pagesC

Lấy danh sách trang được truy cập nhiều nhất

Inputs: siteId (required), date (required), period, limit.

matomo_get_usersB

Lấy danh sách tất cả users trong Matomo

Inputs: no named parameters.

matomo_get_visits_summaryC

Lấy tổng quan lượt truy cập của site

Inputs: siteId (required), date (required), period.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 11 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose targeting specific resources and actions in the Matomo ecosystem. The tools are well-organized around sites, goals, users, and analytics data with no overlapping functionality that could cause confusion.

    Naming Consistency5/5

    All tools follow a perfect verb_noun pattern with consistent 'matomo_' prefix and snake_case throughout. The naming convention is predictable and systematic across all 11 tools.

    Tool Count5/5

    11 tools is an ideal number for a Matomo analytics server, providing comprehensive coverage without being overwhelming. The count aligns well with the domain scope and user needs.

    Completeness4/5

    The toolset provides excellent coverage for core Matomo operations including site management, user management, goal tracking, and analytics data retrieval. Minor gaps exist in update/delete operations for sites, goals, and users, but the surface supports most common workflows effectively.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that provides unified access to Google Analytics 4 and Google Search Console data through real-time analytics queries.
      2
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server that provides access to Yandex Metrika analytics data through various tools and functions. This server allows AI assistants and applications to retrieve comprehensive analytics data from Yandex Metrika accounts.
      1
      -
    • -
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI models to interact with Matomo analytics through a complete MCP server implementation. Provides tools for retrieving analytics data, managing sites, and generating reports with zero configuration setup.
      -
    • A
      license
      B
      quality
      C
      maintenance
      An MCP server for interacting with the Rybbit Analytics API, enabling querying analytics data, managing sites, tracking events, and more.
      57
      12 npm
      5
      MIT