Matomo-MCP
matomo-mcp
Matomo Analytics に話しかけよう。 Claude、Cursor、VS Code、または任意の MCP クライアントから。
厳選された 15 の読み取り専用アナリティクスツール + 全 API への脱出ハッチ。シングルバイナリ、即起動、コンテキストに優しい。
クイックスタート · クライアント接続 · ツール · 設定 · FAQ
You ▸ How was traffic yesterday, and where did it come from?
Claude ▸ Yesterday you had 14,472 visits (11,416 unique visitors, 66% bounce rate).
Top acquisition channels:
1. Organic search — 6,120 visits (Google 92%)
2. Direct — 4,890 visits
3. AI assistants — 1,204 visits (↑ 31% vs. last week)
Want me to break down which landing pages converted best?Matomo ダッシュボードが答えられるすべての質問に、あなたの AI アシスタントも今すぐ答えられます。フォローアップ、比較、「なぜ?」も含めて。
✨ matomo-mcp の特長
🎯 厳選されたツール | 実際のアナリティクス質問に基づいて手作りされた 15 のツール。モデルのコンテキストを圧迫しツール選択を劣化させる 70 以上の自動生成 API ミラーではありません。 |
⚡ 即起動 | イントロスペクションの往復なし。静的バイナリ 1 つで、Node も Python もランタイムも不要。ミリ秒で起動します。 |
🔒 デフォルトで安全 | 読み取り専用のレポートツール。トークンは POST でのみ送信(URL/ログには決して含まれない)、すべてのエラーから編集されます。TLS 検証はデフォルトでオン。 |
🧠 コンテキストに優しい | すべてのレポートに行数制限と、実行可能なガイダンス付きの厳格なレスポンス予算。1 回のツール呼び出しでコンテキストウィンドウを吹き飛ばすことはありません。 |
📡 リアルタイム含む | ライブ訪問者カウンターと訪問ログ( |
🧰 決して閉じ込めない |
|
🔁 回復力 | 429/5xx/ネットワーク障害時のバックオフ付き自動リトライ。モデルが行動できるヒント付きの役立つエラーメッセージ。 |
Related MCP server: mcp-server-wazuh
🚀 クイックスタート
1. インストール
プリビルドバイナリ(Linux、macOS、Windows)— Releases から入手するか、次のコマンドで:
# Cargo
cargo install matomo-mcp
# From source
cargo install --git https://github.com/Liohtml/matomo-mcp
# Docker
docker pull ghcr.io/liohtml/matomo-mcp2. Matomo API トークンを取得
Matomo → 設定(⚙)→ 個人設定 → セキュリティ → 認証トークン → 新しいトークンを作成。 閲覧専用の権限で十分です。
3. 接続を確認
matomo-mcp --url https://your-matomo.example.com --token YOUR_TOKEN --check✓ Connected — Matomo version 5.2.1
✓ Token grants access to 3 site(s):
#1 My Shop (https://shop.example.com)
#2 Blog (https://blog.example.com)
#3 Docs (https://docs.example.com)4. クライアントを接続 ⬇
🔌 クライアントを接続
claude mcp add matomo \
--env MATOMO_URL=https://your-matomo.example.com \
--env MATOMO_TOKEN=YOUR_TOKEN \
--env MATOMO_DEFAULT_SITE_ID=1 \
-- matomo-mcpclaude_desktop_config.json に追加(macOS: ~/Library/Application Support/Claude/、Windows: %APPDATA%\Claude\):
{
"mcpServers": {
"matomo": {
"command": "matomo-mcp",
"env": {
"MATOMO_URL": "https://your-matomo.example.com",
"MATOMO_TOKEN": "YOUR_TOKEN",
"MATOMO_DEFAULT_SITE_ID": "1"
}
}
}
}.cursor/mcp.json(プロジェクト)または ~/.cursor/mcp.json(グローバル):
{
"mcpServers": {
"matomo": {
"command": "matomo-mcp",
"env": {
"MATOMO_URL": "https://your-matomo.example.com",
"MATOMO_TOKEN": "YOUR_TOKEN",
"MATOMO_DEFAULT_SITE_ID": "1"
}
}
}
}.vscode/mcp.json:
{
"servers": {
"matomo": {
"type": "stdio",
"command": "matomo-mcp",
"env": {
"MATOMO_URL": "https://your-matomo.example.com",
"MATOMO_TOKEN": "${input:matomo-token}",
"MATOMO_DEFAULT_SITE_ID": "1"
}
}
},
"inputs": [
{
"id": "matomo-token",
"type": "promptString",
"description": "Matomo API token",
"password": true
}
]
}stdio で MCP を話す任意のクライアントは、一般的な形で動作します:
{
"command": "matomo-mcp",
"args": [],
"env": {
"MATOMO_URL": "https://your-matomo.example.com",
"MATOMO_TOKEN": "YOUR_TOKEN",
"MATOMO_DEFAULT_SITE_ID": "1"
}
}{
"mcpServers": {
"matomo": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MATOMO_URL", "-e", "MATOMO_TOKEN", "-e", "MATOMO_DEFAULT_SITE_ID",
"ghcr.io/liohtml/matomo-mcp"
],
"env": {
"MATOMO_URL": "https://your-matomo.example.com",
"MATOMO_TOKEN": "YOUR_TOKEN",
"MATOMO_DEFAULT_SITE_ID": "1"
}
}
}
}サーバーを一度起動し(ワークステーション、LAN ボックス、またはコンテナ上)、任意の数の MCP クライアントを接続できます:
matomo-mcp --url https://your-matomo.example.com --token YOUR_TOKEN --http 127.0.0.1:8080クライアントは streamable HTTP トランスポートで http://127.0.0.1:8080/mcp に接続します。例:
claude mcp add --transport http matomo http://127.0.0.1:8080/mcp[!WARNING] HTTP エンドポイントには組み込みの認証がありません。
127.0.0.1にバインドしたままにするか、認証付きリバースプロキシ(またはファイアウォール)を前に置いてから、localhost の外に公開してください。
[!TIP]
MATOMO_DEFAULT_SITE_IDを設定すると、モデルがどのサイトを指しているか尋ねる必要がなくなります。トークンがない場合: パブリックデモで試せます:--url https://demo.matomo.cloud --default-site-id 1(トークン不要)。
🧭 ツール
ツール | 答えられる質問の例 |
| 「どのサイトを追跡していますか?」 |
| 「先週のトラフィックはどのくらいでしたか?」 |
| 「トップページは? 離脱が多いのはどこ?」 |
| 「訪問者はどこから来ますか? どのキャンペーンが効果的? AI アシスタントは何を送ってきますか?」 |
| 「コンフィギュレーターはどのくらい開かれましたか?」 |
| 「ゴールごとのコンバージョン率は?」 |
| 「今月の売上は? ベストセラー商品は?」 |
| 「訪問者はどの国/都市から来ますか?」 |
| 「モバイル vs デスクトップ? どのブラウザ?」 |
| 「1 日のうち、または 1 週間のうち、いつ訪問がありますか?」 |
| 「サイト内で何を検索していますか? 何も見つからないのは?」 |
| 「今サイトにいるのは誰?」 |
| 「どのページの読み込みが遅いですか?」 |
| 「どのデプロイやキャンペーン開始がトラフィックスパイクと一致しますか?」 |
| その他すべて — ファネル、ヒートマップ、カスタムディメンション、Reporting API の任意の |
すべてのツールは site_id、period(day/week/month/year/range)、date(today、yesterday、2026-07-01、last30、または start,end の範囲)、オプションの segment(例: deviceType==mobile;country==DE)、および行 limit を受け付けます。
試してみるプロンプト
「今週のトラフィックを先週と比較して、何が変わったか、なぜかを教えて」
「今月のコンバージョン上位 10 ランディングページを直帰率付きで」
「ChatGPT や Perplexity からのトラフィックはありますか? 3 か月のトレンド」
「結果を返さない内部検索はどれ? 作成すべきコンテンツを提案して」
「訪問者ログに今何か異常はありますか?」
⚙️ 設定
フラグ | 環境変数 | デフォルト | 説明 |
|
| — | Matomo インスタンスの URL(サブディレクトリインストール |
|
| — | API トークン( |
|
| — | モデルが指定しない場合に使用するサイト |
|
| — | 追加の HTTP ヘッダー( |
|
|
| リクエストごとのタイムアウト |
|
|
| 切り詰め前のレスポンス予算 |
|
| — | stdio の代わりにこのアドレスで streamable HTTP 経由で MCP を提供(エンドポイント: |
|
|
| 自己署名 TLS 証明書を受け入れる(明示的なオプトイン) |
| — | — | URL + トークン + サイトアクセスを検証して終了 |
🆚 FGRibreau/mcp-matomo との違いは?
mcp-matomo(このプロジェクトのインスピレーション元です。ありがとうございます!🙏)は、起動時に Matomo インスタンスをイントロスペクトし、API メソッドごとに 1 つの MCP ツールを生成します。matomo-mcp は逆のアプローチを取ります:
matomo-mcp | mcp-matomo | |
ツールセット | 厳選された 15 ツール + 脱出ハッチ | ~70 以上の生成ツール |
モデルコンテキストコスト | 小さく安定 | 大きく、インスタンス依存 |
パラメータ型 | 正確で手書きの enum/デフォルト | パラメータ名から推測 |
起動 | 即時(ネットワーク I/O なし) | イントロスペクションの往復(またはキャッシュされたスペックファイル) |
TLS 検証 | デフォルトでオン | イントロスペクションでは無効 |
サブディレクトリインストール | ✅ | パスが上書きされる |
レスポンスサイズガード | 行制限 + 厳格な予算 | — |
一時エラー時のリトライ | ✅ | — |
リアルタイム(Live)ツール | ✅ | —(レポートメタデータの一部ではない) |
すべての API メソッドを個別のツールとして使いたい場合は mcp-matomo を。モデルが正しいツールを確実に選び、コンテキストを決して溢れさせたくない場合は matomo-mcp を。
🩺 トラブルシューティング
--default-site-id 1 を渡すか(推奨)、モデルに先に matomo_list_sites を呼び出させてください。
matomo-mcp --url ... --token ... --check を実行してください。失敗する場合は、トークンを再生成し(設定 → 個人設定 → セキュリティ)、サイトに対して少なくとも閲覧権限があることを確認してください。
MATOMO_URL は Matomo のルート(index.php を含むフォルダ)を指している必要があります。https://example.com/matomo/index.php の場合は、https://example.com/matomo/ を使用してください。
バイパス用ヘッダーを注入してください: --header "CF-Access-Client-Id:..." --header "CF-Access-Client-Secret:..."(または MATOMO_EXTRA_HEADERS 経由)。
それはコンテキストガードが正常に機能しているためです。取得する行数を減らすか、日付範囲を短くするか、--max-response-chars を引き上げてください。
🗺️ ロードマップ
Streamable HTTP トランスポート(
--http、一度ホストすれば複数のクライアントが接続可能)matomo_annotations— デプロイマーカーとトラフィックの読み取り・関連付けマルチインスタンス対応(1つのサーバーで複数の Matomo インストールを管理)
Homebrew tap と winget マニフェスト
MCP レジストリ掲載(
server.jsonによる公式レジストリ、Glama)
これらの機能を早く使いたいですか? Issue を開く か、PR を送ってください。CONTRIBUTING.md を参照してください。
🛠️ 開発
cargo test # 37 tests, fully offline (wiremock)
cargo clippy --all-targets -- -D warnings
cargo run -- --url https://demo.matomo.cloud --default-site-id 1 --checkアーキテクチャと設計上の決定: docs/ARCHITECTURE.md。
📄 ライセンスとクレジット
MIT。Matomo とは提携・承認関係にありません。Matomo は InnoCraft Ltd. の登録商標です。
rmcp(公式 Rust MCP SDK)で構築されています。FGRibreau/mcp-matomo に触発されました。
MCP レジストリ名:
mcp-name: io.github.Liohtml/matomo-mcp
matomo-mcp がダッシュボードを開く手間を省いてくれたなら、⭐ が他の人の発見の助けになります。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceMCP Server for Nutanix Prism Central14MIT
- MIT
- AlicenseBqualityBmaintenanceMCP Server for Apache Pinot1417Apache 2.0
- -licenseNot gradedqualityNot gradedmaintenanceEnables 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.
Related MCP Connectors
MCP server for Tinify image optimization — one tool, max optimization
MCP Server for agents to onboard, pay, and provision services autonomously with InFlow
MCP server for Blockscout
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Liohtml/matomo-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server