Skip to main content
Glama
thichcode

Matomo MCP Server

by thichcode

matomo_add_site

Add a new site to Matomo Analytics for tracking and monitoring website performance data through the Matomo MCP Server.

Instructions

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

Input Schema

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

Implementation Reference

  • Core implementation of the matomo_add_site tool: calls Matomo SitesManager.addSite API via makeRequest helper.
    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 wrapper for matomo_add_site: checks connection and delegates to MatomoApiService.addSite.
    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 (required), and optional timezone.
    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:79-102 (registration)
    Tool registration in ListToolsResponse: defines name, description, and inputSchema for matomo_add_site.
    { 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-263 (registration)
    Dispatch registration in CallToolRequestSchema switch statement.
    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