Skip to main content
Glama
thichcode

Matomo MCP Server

by thichcode

matomo_connect

Establish a secure connection to a Matomo instance by providing the base URL and authentication token, enabling interaction with the Matomo Analytics API for managing sites, users, goals, segments, and accessing analytics reports.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseUrlYesURL của Matomo instance (ví dụ: https://analytics.example.com)
tokenAuthYesToken xác thực Matomo API

Implementation Reference

  • The primary handler function that implements the 'matomo_connect' tool logic. It constructs a MatomoConfig from input arguments, instantiates the MatomoApiService, tests the connection via getSites(), and responds with a success message.
    private async handleConnect(args: { baseUrl: string; tokenAuth: string }) { const config: MatomoConfig = { baseUrl: args.baseUrl, tokenAuth: args.tokenAuth, }; this.matomoService = new MatomoApiService(config); // Test connection await this.matomoService.getSites(); return { content: [ { type: 'text', text: `Đã kết nối thành công đến Matomo tại ${args.baseUrl}`, }, ], }; }
  • The schema definition for the 'matomo_connect' tool, including input parameters baseUrl and tokenAuth as required fields.
    { name: 'matomo_connect', description: 'Kết nối đến Matomo instance với URL và token xác thực', inputSchema: { type: 'object', properties: { baseUrl: { type: 'string', description: 'URL của Matomo instance (ví dụ: https://analytics.example.com)', }, tokenAuth: { type: 'string', description: 'Token xác thực Matomo API', }, }, required: ['baseUrl', 'tokenAuth'], }, },
  • src/index.ts:253-255 (registration)
    The dispatch case in the CallToolRequestHandler that registers and routes calls to the matomo_connect handler.
    case 'matomo_connect': return await this.handleConnect(args as { baseUrl: string; tokenAuth: string });

Latest Blog Posts

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/thichcode/matomo_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server