Skip to main content
Glama
thichcode

Matomo MCP Server

by thichcode

matomo_add_site

Add a new site to Matomo Analytics with specified name, URLs, and timezone. Integrates via MCP server to streamline site management and configuration.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesTên của site
timezoneNoMúi giờ của site (mặc định: UTC)UTC
urlsYesDanh sách URLs của site

Implementation Reference

  • Core implementation of adding a site to Matomo using the SitesManager.addSite API endpoint.
    async addSite(name: string, urls: string[], timezone: string = 'UTC'): Promise<number> { const response = await this.makeRequest('SitesManager.addSite', { siteName: name, urls: urls.join(','), timezone, }); return response.value; }
  • MCP server handler for matomo_add_site tool, checks connection and delegates to MatomoApiService.
    private async handleAddSite(args: { name: string; urls: string[]; timezone?: string }) { 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 siteId = await this.matomoService.addSite(args.name, args.urls, args.timezone); return { content: [ { type: 'text', text: `Đã thêm site thành công với ID: ${siteId}`, }, ], }; }
  • Input schema definition for the matomo_add_site tool, specifying parameters name, urls, and optional timezone.
    { name: 'matomo_add_site', description: 'Thêm một site mới vào Matomo', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Tên của site', }, urls: { type: 'array', items: { type: 'string' }, description: 'Danh sách URLs của site', }, timezone: { type: 'string', description: 'Múi giờ của site (mặc định: UTC)', default: 'UTC', }, }, required: ['name', 'urls'], }, },
  • src/index.ts:262-264 (registration)
    Switch case registration mapping tool name to its handler in CallToolRequestSchema.
    case 'matomo_add_site': return await this.handleAddSite(args as { name: string; urls: string[]; timezone?: 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