Skip to main content
Glama
thichcode

Matomo MCP Server

by thichcode

matomo_get_sites

Retrieve all sites from Matomo Analytics to manage and monitor website tracking configurations through the Matomo MCP Server.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for matomo_get_sites: validates connection, calls service.getSites(), formats and returns JSON response.
    private async handleGetSites() { if (!this.matomoService) { throw new Error('Chưa kết nối đến Matomo. Vui lòng sử dụng matomo_connect trước.'); } const sites = await this.matomoService.getSites(); return { content: [ { type: 'text', text: `Danh sách sites:\n${JSON.stringify(sites, null, 2)}`, }, ], };
  • Core handler logic: makes API request to Matomo's SitesManager.getSitesFromGroup and returns sites array.
    async getSites(): Promise<MatomoSite[]> { const response = await this.makeRequest('SitesManager.getSitesFromGroup'); return Array.isArray(response) ? response : []; }
  • Tool schema definition: empty input schema as it requires no parameters.
    { name: 'matomo_get_sites', description: 'Lấy danh sách tất cả các sites trong Matomo', inputSchema: { type: 'object', properties: {}, }, },
  • src/index.ts:256-257 (registration)
    Tool registration in the CallToolRequest switch dispatcher.
    case 'matomo_get_sites': return await this.handleGetSites();
  • TypeScript interface defining the structure of MatomoSite objects returned by the tool.
    export interface MatomoSite { idsite: number; name: string; main_url: string; ts_created: string; ecommerce: number; sitesearch: number; sitesearch_keyword_parameters: string; sitesearch_category_parameters: string; timezone: string; currency: string; exclude_unknown_urls: number; excluded_ips: string; excluded_parameters: string; excluded_user_agents: string; group: string; type: string; keep_url_fragment: number; creator_login: string; timezone_name: string; currency_name: 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