FastMCP Data Analysis Server
A Model Context Protocol (MCP) server that provides comprehensive data analysis utilities including statistical functions, probability distributions, and data processing tools.
Features
Probability Distributions
- Poisson Probability: Calculate point, cumulative, and survival probabilities
- Normal Distribution: PDF, CDF, and survival function calculations
- Binomial Probability: Complete binomial distribution analysis
Statistical Analysis
- Descriptive Statistics: Mean, median, mode, variance, skewness, kurtosis, quartiles
- Correlation Analysis: Pearson and Spearman correlation with significance testing
- Hypothesis Testing: One-sample t-tests with detailed results
- Linear Regression: Simple linear regression with R², MSE, and equation
Data Processing
- CSV Analysis: Process CSV text data and generate comprehensive summaries
- Data Summarization: Automatic detection of numeric/categorical columns
Installation
- Initialize the project with uv:
uv init fastmcp-data-analysis-server
cd fastmcp-data-analysis-server
- Install dependencies:
uv add fastmcp numpy scipy pandas
Or install from the pyproject.toml:
uv sync
- Install development dependencies (optional):
uv add --dev pytest pytest-asyncio black isort mypy
Usage
Running the Server
# Using uv
uv run python main.py
# Or if installed
python main.py
Available Tools
1. Poisson Probability
# Point probability: P(X = k)
poisson_probability(lam=3.5, k=2, prob_type="point")
# Cumulative probability: P(X ≤ k)
poisson_probability(lam=3.5, k=5, prob_type="cumulative")
# Survival probability: P(X > k)
poisson_probability(lam=3.5, k=4, prob_type="survival")
2. Descriptive Statistics
descriptive_statistics([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
3. Normal Distribution
# Standard normal
normal_probability(x=1.96, mean=0, std_dev=1, prob_type="cumulative")
# Custom normal distribution
normal_probability(x=85, mean=100, std_dev=15, prob_type="point")
4. Correlation Analysis
correlation_analysis(
x_data=[1, 2, 3, 4, 5],
y_data=[2, 4, 6, 8, 10]
)
5. Hypothesis Testing
hypothesis_test_ttest(
sample_data=[12, 15, 18, 16, 17],
population_mean=14,
alpha=0.05
)
6. Linear Regression
linear_regression_analysis(
x_data=[1, 2, 3, 4, 5],
y_data=[2, 4, 5, 4, 5]
)
7. Binomial Probability
# Probability of exactly 3 successes in 10 trials
binomial_probability(n=10, k=3, p=0.4, prob_type="point")
8. CSV Data Analysis
csv_text = """name,age,score
Alice,25,85
Bob,30,92
Charlie,22,78"""
data_summary_from_csv_text(csv_text)
Example Responses
Poisson Probability Response
{
"probability": 0.2138,
"description": "P(X = 2)",
"lambda": 3.5,
"k": 2,
"prob_type": "point",
"mean": 3.5,
"variance": 3.5,
"std_dev": 1.8708
}
Descriptive Statistics Response
{
"count": 10,
"mean": 5.5,
"median": 5.5,
"std_dev": 3.0277,
"variance": 9.1667,
"min": 1.0,
"max": 10.0,
"skewness": 0.0,
"kurtosis": -1.2
}
Development
Code Formatting
uv run black main.py
uv run isort main.py
Type Checking
uv run mypy main.py
Testing
uv run pytest
MCP Client Integration
This server can be used with any MCP client. The tools are automatically exposed and can be called with the appropriate parameters.
Example MCP Client Usage
# Assuming you have an MCP client connected
client.call_tool("poisson_probability", {
"lam": 2.5,
"k": 3,
"prob_type": "cumulative"
})
Example MCP Server Config
{
"mcpServers": {
"analysis-mcp": {
"command": "fastmcp-data-analysis-server/.venv/bin/python",
"args": [
"fastmcp-data-analysis-server/main.py"
],
}
}
}
Error Handling
All functions include comprehensive error handling for:
- Invalid parameter values
- Empty datasets
- Mismatched data lengths
- Invalid probability types
- Mathematical domain errors
License
MIT License
Metadata
Release files for fastmcp-data-analysis-server 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fastmcp_data_analysis_server-0.1.1.tar.gz | 5.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastmcp_data_analysis_server-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.2 kB
Release files / fastmcp_data_analysis_server-0.1.1.tar.gz
| Download URL | fastmcp_data_analysis_server-0.1.1.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4dac863b1b3d8fe510e8b4723e8663d8b6a1c063bbe776f63a94e42965631edd
|
|
BLAKE2b-256 checksum How to use checksums |
5cbc18b2195c105688c51cee8cda95274048fa342132f265d448cf32ce75c6c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.17
|
Release files / fastmcp_data_analysis_server-0.1.1-py3-none-any.whl
| Download URL | fastmcp_data_analysis_server-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4aad06f9ead52d67450f441cbc1d82c9771e2982b918bba4775d33aada62d433
|
|
BLAKE2b-256 checksum How to use checksums |
d4015a2ce432783f2473deaad6361e2d5984d557ae74851c8db74cb218f97878
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.17
|
Security for fastmcp-data-analysis-server 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.