Matomo JS

by mj-kiwi

9 stars
396 downloads
Not rated
GitHub

About

A modern JavaScript/TypeScript client library for Matomo Analytics.

Details

Author
mj-kiwi
GitHub stars
9
Downloads
396
Categories
Other

- Implements the Model Context Protocol specification
- Provides AI agents with direct access to Matomo data
- Easy configuration via environment variables
- Modular design mirroring the Matomo API structure
- Currently implements 4 of 47 API modules (8.5%)
- Part of a TypeScript Nx monorepo with tree-shakable design

Install the @mj-kiwi/matomo-mcp-server package (npm/yarn/pnpm) and configure it via environment variables to connect to your Matomo instance. The server provides MCP tools for the modules currently implemented (SitesManager, TagManager, Tour, UserId) and can be integrated into AI agent workflows.

Matomo JS

A modern JavaScript/TypeScript client library for Matomo Analytics.

Project Status

⚠️ This project is still under construction. APIs may change in the future as we continue to develop and refine the library. Please use with caution in production environments.

Overview

This monorepo contains JavaScript/TypeScript libraries for interacting with Matomo Analytics. Built with TypeScript and structured as an Nx monorepo for optimal development experience.

Packages

Reporting Client (@mj-kiwi/matomo-client)

A TypeScript client for the Matomo Reporting API with strongly typed interfaces. This package provides a convenient way to interact with Matomo's Reporting API endpoints.

Features

- Modern, Promise-based API
- TypeScript support with full type definitions
- Modular design for flexible usage
- Tree-shakable (import only what you need)

Available Modules

The reporting client includes modules for all major Matomo API endpoints, including:

- Core - Core reporting functionality (core)
- API - General API operations (api)
- SitesManager - Methods for managing sites (sitesManager)
- AbTesting - Methods for A/B testing features (abTesting)
- Actions - Page views, content tracking (actions)
- ActivityLog - User activity logs (activityLog)
- AdvertisingConversionExport - Advertising conversion exports (advertisingConversionExport)
- Annotations - Managing annotations (annotations)
- ConnectAccounts - Integration with other platforms (connectAccounts)
- Contents - Content interaction data (contents)
- CoreAdminHome - Administrative tasks (coreAdminHome)
- CrashAnalytics - JavaScript error tracking (crashAnalytics)
- CustomAlerts - Custom alert definitions (customAlerts)
- CustomDimensions - Custom dimensions tracking (customDimensions)
- CustomJsTracker - Custom JS tracker functionality (customJsTracker)
- CustomReports - Custom report management (customReports)
- CustomVariables - Custom variables data (customVariables)
- Dashboard - Dashboard management (dashboard)
- DevicePlugins - Browser plugin statistics (devicePlugins)
- DevicesDetection - Visitor device reports (devicesDetection)
- Events - Event tracking and analysis (events)
- Feedback - User feedback submission (feedback)
- FormAnalytics - Form interaction data (formAnalytics)
- Funnels - Conversion funnel analysis (funnels)
- Goals - Conversion goals and ecommerce (goals)
- HeatmapSessionRecording - Heatmaps and session recordings (heatmapSessionRecording)
- ImageGraph - Static PNG graph generation (imageGraph)
- Insights - Analytical insights generation (insights)
- LanguagesManager - Translations and language settings (languagesManager)
- Live - Real-time visitor data (live)
- Login - Authentication methods (login)
- MarketingCampaignsReporting - Marketing campaign data (marketingCampaignsReporting)
- MediaAnalytics - Media engagement stats (mediaAnalytics)
- MobileMessaging - Mobile messaging integration (mobileMessaging)
- MultiChannelConversionAttribution - Multi-channel attribution (multiChannelConversionAttribution)
- MultiSites - Multi-site summary data (multiSites)
- Overlay - Page overlay reports (overlay)
- PagePerformance - Page load metrics (pagePerformance)
- PrivacyManager - Data privacy management (privacyManager)
- Referrers - Traffic sources (referrers)
- Resolution - Screen resolution reports (resolution)
- RollUpReporting - Roll-up reporting features (rollUpReporting)
- ScheduledReports - Scheduled report management (scheduledReports)
- SearchEngineKeywordsPerformance - SEO keywords (searchEngineKeywordsPerformance)
- SegmentEditor - Segment management (segmentEditor)
- Seo - SEO ranking reports (seo)
- TagManager - Tag manager functionality (tagManager)
- Tour - Guided tour features (tour)
- Transitions - Visitor navigation paths (transitions)
- TwoFactorAuth - Two-factor authentication management (twoFactorAuth)
- UserCountry - Geographic data (userCountry)
- UserId - User ID tracking (userId)
- UserLanguage - Visitor language reports (userLanguage)
- UsersFlow - User flow visualization (usersFlow)
- UsersManager - User management (usersManager)
- VisitFrequency - Visitor frequency metrics (visitFrequency)
- VisitTime - Visitor time reports (visitTime)
- VisitorInterest - Engagement metrics (visitorInterest)
- VisitsSummary - Visit metrics and statistics (visitsSummary)

And many more modules for comprehensive Matomo API coverage.

MCP Server (@mj-kiwi/matomo-mcp-server)

A Model Context Protocol (MCP) server that acts as a bridge between AI agents (like large language models) and Matomo analytics. This package exposes Matomo Reporting API functionalities as MCP tools.

Features

- Implements the Model Context Protocol specification
- Provides AI agents with direct access to Matomo data
- Easy configuration via environment variables
- Modular design mirroring the Matomo API structure

Implementation Status

Currently, the MCP server has implemented 4 out of 47 Matomo API modules (8.5% complete):
- SitesManager
- TagManager
- Tour
- UserId

More modules are being actively implemented.

Getting Started

Prerequisites

- Node.js (v18 or later recommended)
- npm, yarn, or pnpm

Installation

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.