Statsource MCP Server: AI-Powered Data Analysis & Statistical Insights
A standalone Model Context Protocol server that connects your PostgreSQL data and CSV files to AI-powered analysis and statistics – all in plain English.
The average temperature in July is 28.5°C.
Based on data from weather_data.csv (10,000 entries)
What is Statsource?
Statsource is a standalone MCP (Model Context Protocol) server designed to simplify data analysis. Acting as a middleware, it connects clients like Claude Desktop to your existing API, enabling natural language queries and advanced statistical calculations.
Whether you're pulling data from a PostgreSQL database or a CSV file, Statsource delivers actionable insights with ease. Open-source and highly configurable, it's the perfect tool for unlocking the power of your data.
Available Tools
get_statistics
Analyze data and calculate statistics or generate 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 (ask user for exact string), or API endpoint. Defaults to `DB_CONNECTION_STRING` env var if set.
- source_type (string, optional): Type of data source ("csv", "database", or "api"). Defaults to `DB_SOURCE_TYPE` env var if set.
- table_name (string, optional but **required** if `source_type` is "database"): Name of the database table to use (Ask user for exact table name).
- statistics (list of strings, optional): List of statistics to calculate (required for `query_type="statistics"`). 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 (e.g., `"status": "completed", "region": ["North", "East"]`).
- groupby (list of strings, optional): List of column names to group data by before calculating statistics (e.g., `["region", "product_category"]`).
- 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, e.g., "2023-01-01").
- end_date (string or datetime, optional): Inclusive end date for filtering (ISO 8601 format, e.g., "2023-12-31").
Note: For CSV, upload files to statsource.me first. For databases, always ask the user for the exact connection string and table name. Do not guess connection details. If `data_source` and `source_type` are omitted, environment variables (`DB_CONNECTION_STRING`, `DB_SOURCE_TYPE`) will be used if configured.
suggest_feature
Suggest 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")
Why Statsource Stands Out
Natural Language Queries
Ask questions like 'What's the average sales in my food_sales table?' and get instant answers.
Statistical Analysis
Calculate means, medians, standard deviations, and more with built-in tools.
Flexible Data Sources
Works with databases, CSV files, or API data – your choice.
AI-Powered Insights
Predict trends or analyze data with advanced AI processing.
Analyze Data in Three Simple Steps
Connect Your Data
Link Statsource to your database, CSV, or API.
Ask a Question
Use plain English, like "Predict sales for next month."
Get Insights
Receive accurate statistics or predictions instantly.
Example
I'll use the get_statistics tool to predict the next 5 periods of sales from your data.
Forecast values:
- Period 1: 191.02
- Period 2: 191.38
- Period 3: 191.74
- Period 4: 192.10
- Period 5: 192.46
Analysis:
- Increasing trend direction
- Strong model fit (R-squared: 0.9999)
- Positive slope of 0.36 per period
These predictions show a steady upward trend in your sales. The high R-squared value indicates the model has found a highly predictable pattern in your historical data.
Unlock the Value of Your Data
Statsource saves time, reduces errors, and empowers data-driven decisions. Ideal for data analysts, developers, and businesses, it turns complex data into simple insights – no coding required.
Start Using Statsource Today
Ready to explore your data? Install the Statsource MCP server in minutes with our open-source package and connect it to your AI agent. Try it free and see the difference.
Installation with uv (Recommended)
Using uv requires no explicit installation step. Use `uvx` to run directly:
Configure for Claude.app:
"mcpServers": {
"statsource": {
"command": "uvx",
"args": ["mcp-server-stats"]
}
}
Installation with PIP
Alternatively, install using pip:
pip install mcp-server-stats
Run via module or console script:
python -m mcp_server_stats mcp-server-stats
Configure for Claude.app:
"mcpServers": {
"statsource": {
"command": "python",
"args": ["-m", "mcp_server_stats"]
}
}
Installation with Docker
Use the official Docker image:
Configure for Claude.app:
"mcpServers": {
"statsource": {
"command": "docker",
"args": ["run", "-i", "--rm", "statsource/mcp"]
}
}
Configuration via Environment Variables
Configure defaults and API keys in your Claude.app settings:
"mcpServers": {
"statsource": {
"command": "python", // or "uvx", "docker"
"args": ["-m", "mcp_server_stats"], // Adjust based on command
"env": {
"API_KEY": "your_api_key",
"DB_CONNECTION_STRING": "postgresql://user:pass@host:port/db",
"DB_SOURCE_TYPE": "database"
}
}
}
Available Variables:
- API_KEY: Your API key for statsource.me
- DB_CONNECTION_STRING: Default database connection string
- DB_SOURCE_TYPE: Default source type (e.g., "database")
Debugging
Use the MCP Inspector to debug:
npx @modelcontextprotocol/inspector uvx mcp-server-stats
Or, if installed locally:
npx @modelcontextprotocol/inspector python -m mcp_server_stats