Goatcounter MCP Server logo

Goatcounter MCP Server

by rafaljanicki

This project provides a Model Context Protocol (MCP) server for interacting with the Goatcounter web analytics API. It allows language models or other MCP clients to easily query Goatcounter statistics and information using a standardized tool interface.

View on GitHub

Last updated: N/A

What is Goatcounter MCP Server?

The Goatcounter MCP Server is a Python-based server that acts as an intermediary between language models (or other MCP clients) and the Goatcounter web analytics API. It provides a standardized interface for querying Goatcounter statistics.

How to use Goatcounter MCP Server?

To use the server, you need to install it using pip or from source, configure the required environment variables (GOATCOUNTER_CODE and GOATCOUNTER_API_KEY), and then run the server using the provided CLI script or FastMCP directly. You can then configure Claude Desktop to connect to the server and access the available tools.

Key features of Goatcounter MCP Server

  • Provides tools for most Goatcounter API endpoints

  • Handles API key and site code configuration via environment variables

  • Lazy initialization of the API client

  • Automatic retries with backoff when encountering API rate limits

Use cases of Goatcounter MCP Server

  • Querying total pageviews and unique visitors for a website.

  • Listing the most popular pages on a website.

  • Identifying the top referrers to a website.

  • Analyzing browser and operating system usage on a website.

FAQ from Goatcounter MCP Server

What is Goatcounter?

Goatcounter is a privacy-friendly web analytics platform.

What is MCP?

MCP stands for Model Context Protocol, a standard for interacting with language models.

How do I get my Goatcounter API key?

You can generate an API key in your Goatcounter site under Settings -> API tokens.

What environment variables are required?

The server requires GOATCOUNTER_CODE (your site code) and GOATCOUNTER_API_KEY (your API token).

How do I install the server?

You can install it via PyPI using pip install goatcounter-mcp-server or from source by cloning the repository and installing the dependencies.