StatSource Analytics MCP server

Integrates with statistical and machine learning tools to perform data analysis, calculations, and time-series forecasting on user data from various sources including CSV files and databases.
Back to servers
Setup instructions
Provider
Jamie
Release date
Mar 16, 2025
Language
Python
Stats
1 star

The Statsource MCP Server provides statistical analysis capabilities for language models, enabling them to analyze data from various sources, calculate statistics, and generate predictions. This Model Context Protocol server connects to the analytics API, allowing AI models to perform statistical analysis and generate ML predictions based on user data from PostgreSQL databases or CSV files.

Available Tools

get_statistics

This tool analyzes data and calculates statistics or generates ML predictions based on provided parameters.

Arguments:

  • columns (list of strings, required): List of column names to analyze or predict (Ask user for exact column names).
  • data_source (string, optional): Path to data file (uploaded to statsource.me), database connection string, or API endpoint. Uses DB_CONNECTION_STRING from env config if not provided.
  • source_type (string, optional): Type of data source ("csv", "database", or "api"). Uses DB_SOURCE_TYPE from env config if not provided.
  • table_name (string, optional but required if source_type is "database"): Name of the database table to use.
  • statistics (list of strings, optional): List of statistics to calculate. Valid options include: 'mean', 'median', 'std', 'sum', 'count', 'min', 'max', 'describe', 'correlation', 'missing', 'unique', 'boxplot'.
  • query_type (string, optional, default="statistics"): Type of query ("statistics" or "ml_prediction").
  • periods (integer, optional): Number of future periods to predict (required for query_type="ml_prediction").
  • filters (dict, optional): Dictionary of column-value pairs to filter data.
  • groupby (list of strings, optional): List of column names to group data by before calculating statistics.
  • options (dict, optional): Dictionary of additional options for specific operations.
  • date_column (string, optional): Column name containing date/timestamp information for filtering and time-series analysis.
  • start_date (string or datetime, optional): Inclusive start date for filtering (ISO 8601 format).
  • end_date (string or datetime, optional): Inclusive end date for filtering (ISO 8601 format).

Key Usage Notes:

  • Data Sources: For CSV, the user must upload the file to statsource.me first and provide the filename. For databases, ask for the exact connection string and table name.
  • Configuration: The tool will use environment variables if specific parameters aren't provided.
  • Filtering/Grouping: Use filters, groupby, date_column, start_date, and end_date to analyze specific subsets of data.

suggest_feature

This tool suggests a new feature or improvement for the StatSource analytics platform.

Arguments:

  • description (string, required): A clear, detailed description of the suggested feature
  • use_case (string, required): Explanation of how and why users would use this feature
  • priority (string, optional): Suggested priority level ("low", "medium", "high")

Installation

Using uv (recommended)

When using uv, no specific installation is needed. Simply use uvx to directly run mcp-server-stats.

Docker Support

A pre-built Docker image is available on Docker Hub:

docker pull jamie78933/statsource-mcp

To run the server using the Docker image:

docker run -i --rm jamie78933/statsource-mcp

Using PIP

You can install mcp-server-stats via pip:

pip install mcp-server-stats

After installation, run it as a script:

python -m mcp_server_stats

Or use the console script:

mcp-server-stats

Configuration

Configure for Claude.app

Add to your Claude settings:

Using uvx

"mcpServers": {
  "statsource": {
    "command": "uvx",
    "args": ["mcp-server-stats"]
  }
}

Using docker

{
  "mcpServers": {
    "statsource": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "API_KEY=YOUR_STATSOURCE_API_KEY",
        "-e",
        "DB_CONNECTION_STRING=postgresql://your_db_user:your_db_password@your_db_host:5432/your_db_name",
        "-e",
        "DB_SOURCE_TYPE=database",
        "jamie78933/statsource-mcp"
      ],
      "protocolVersion": "2024-11-05"
    }
  }
}

Using pip installation

"mcpServers": {
  "statsource": {
    "command": "python",
    "args": ["-m", "mcp_server_stats"]
  }
}

Environment Variables

Configure the server using environment variables in your Claude.app configuration:

"mcpServers": {
  "statsource": {
    "command": "python",
    "args": ["-m", "mcp_server_stats"],
    "env": {
      "API_KEY": "your_api_key",
      "DB_CONNECTION_STRING": "postgresql://username:password@localhost:5432/your_db",
      "DB_SOURCE_TYPE": "database"
    }
  }
}

Available environment variables:

  • API_KEY: Your API key for authentication with statsource.me
  • DB_CONNECTION_STRING: Default database connection string
  • DB_SOURCE_TYPE: Default data source type (usually "database")

Debugging

You can use the MCP inspector to debug the server:

npx @modelcontextprotocol/inspector uvx mcp-server-stats

Or if you've installed the package in a specific directory:

cd path/to/servers/
npx @modelcontextprotocol/inspector python -m mcp_server_stats

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "statsource" '{"command":"uvx","args":["mcp-server-stats"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "statsource": {
            "command": "uvx",
            "args": [
                "mcp-server-stats"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "statsource": {
            "command": "uvx",
            "args": [
                "mcp-server-stats"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later