4,500+ servers built on MCP Fusion
Vinkius
Matomo logo
Vinkius
LangChain logo

How to Use the Matomo MCP in LangChain

Connect Matomo analytics to your LangChain agents to build observable, multi-step data pipelines.

See Vinkius in Action

Works with every AI agent you already use

…and any MCP-compatible client

Matomo MCP on Cursor AI Code Editor MCP Client Matomo MCP on Claude Desktop App MCP Integration Matomo MCP on OpenAI Agents SDK MCP Compatible Matomo MCP on Visual Studio Code MCP Extension Client Matomo MCP on GitHub Copilot AI Agent MCP Integration Matomo MCP on Google Gemini AI MCP Integration Matomo MCP on Lovable AI Development MCP Client Matomo MCP on Mistral AI Agents MCP Compatible Matomo MCP on Amazon AWS Bedrock MCP Support
MCP Servers - Free for Subscribers
LangChain

Connect Matomo MCP to LangChain

Create your Vinkius account to connect Matomo to LangChain and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.

GDPR Free for Subscribers

Chain Matomo MCP Server Queries

The Matomo MCP Server feeds raw web traffic data directly into your LangChain ReAct agents. Your agent starts by calling `list_sites` to grab active property IDs, then pipes those identifiers straight into `get_visits_summary` to pull baseline traffic metrics. You build automated reporting pipelines where the output of one tool dictates the next step in the chain. You get full visibility into these sequences. LangSmith logs the exact token usage and latency for every `get_top_pages` request. If a chain fails because a specific site ID was missing, you see the exact input and output payloads. It takes the guesswork out of debugging complex analytics agents.

Track Live User Behavior

Real-time traffic monitoring requires tools like `get_live_last_visits` to feed immediate session data to your agent. LangChain processes this incoming stream, allowing your agent to react to sudden traffic spikes or cart abandonment events as they happen. You don't wait for daily batch jobs to finish. Your agent can dig deeper when it spots an anomaly. It triggers `get_visitor_profile` to pull the complete history of a specific user. The agent uses this historical context to decide if an alert warrants human intervention or if it fits a known pattern of bot traffic.

Analyze Conversion Sources

Attribution modeling gets easier when your agent can query `get_goals` alongside traffic acquisition tools. Your LangChain setup pulls goal completion data and cross-references it with `get_top_referrers` and `get_top_socials`. The agent calculates which channels actually drive meaningful actions. You can connect this data to other external APIs in the same chain. Your agent pulls the top converting domains using `get_top_websites`, formats the data, and pushes it directly into your CRM or alerting system. The logic lives entirely in your code.

Setup guide

Set up Matomo MCP in LangChain

Prerequisites

  • Python 3.10+ installed
  • langchain-mcp-adapters + langgraph packages
  • Active Vinkius subscription with a valid endpoint token
  1. 1

    Install dependencies

    Run pip install langchain-mcp-adapters langgraph langchain-openai. The MCP adapters package converts MCP tools into native LangChain BaseTool objects.

  2. 2

    Connect via HTTP transport

    Use MultiServerMCPClient with "transport": "http" pointing to your Vinkius endpoint. Replace [YOUR_TOKEN_HERE] with your token from cloud.vinkius.com.

  3. 3

    Create a ReAct agent

    Pass the discovered tools to create_react_agent() from LangGraph. The agent automatically routes Matomo tool calls through the MCP protocol.

  4. 4

    Run with any LLM

    Swap ChatOpenAI for ChatAnthropic, ChatGoogleGenerativeAI, or any LangChain-compatible model. The MCP tools work identically across all providers.

agent.py
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI

async with MultiServerMCPClient({
    "matomo-mcp": {
        "transport": "http",
        "url": "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
    }
}) as client:
    tools = client.get_tools()

    agent = create_react_agent(
        ChatOpenAI(model="gpt-4o"),
        tools,
    )
    result = await agent.ainvoke({
        "messages": "List recent Matomo transactions"
    })
    print(result["messages"][-1].content)

Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Matomo. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.

Why Choose Vinkius

Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.

Real-time monitoring

Live

visibility into every interaction

Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.

Built-in savings

60%

lower AI costs

Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.

Single dashboard

One

place for every integration

Every tool your AI connects to, managed from a single screen. One account, complete control.

Common questions about Matomo MCP in LangChain

Install `langchain-mcp-adapters` and `langgraph`. Initialize a `MultiServerMCPClient` pointing to your Vinkius endpoint, extract the tools with `client.get_tools()`, and pass them to your ReAct agent.
Yes. Your agent can call `get_goals` to pull the active goal list for any site ID. It then uses that data to run continuous performance checks on specific conversion metrics.
Dashboards are static. A LangChain agent actively queries `get_site_details` and `get_visits_summary`, analyzes the data, and takes action based on your custom logic.
It traces everything. You see the exact JSON payloads sent to `get_top_pages` and the latency of the response. This makes debugging your analytics chains straightforward.
Your visitor profiles and IP addresses remain secure within the Vinkius V8 Isolate Sandbox. The server processes `get_visitor_profile` requests ephemerally, ensuring sensitive user tracking data never leaks into persistent storage or unauthorized logs.

Start using the Matomo MCP today

We host it, we monitor it, we maintain it. You just paste one token.

Built & Managed by Vinkius 30s setup 10 tools

We've already built the connector for Matomo. Just plug in your AI agents and start using Vinkius.

No hosting. No infrastructure. No complex setup.
All 10 tools are live and waiting. You're up and running in seconds.

Claude Claude
ChatGPT ChatGPT
Cursor Cursor
Gemini Gemini
Windsurf Windsurf
VS Code VS Code
JetBrains JetBrains
Vercel Vercel
+ other MCP clients

Vinkius gives your AI agents access to the full catalog of app connectors, all fully managed, secure, and enterprise-ready. One subscription, every tool you need.

Zero hosting required Full MCP catalog included Enterprise-grade security Auto-updated by Vinkius

Built, hosted, and secured by Vinkius. You just connect and go.