Content
# DataMaster MCP Server
## Project Introduction
**DataMaster MCP Server** is a powerful data analysis management server built on the **Model Context Protocol (MCP)**. This project originates from several core pain points encountered in modern data analysis work:
- **Data Source Fragmentation**: Enterprise data is scattered across different systems such as databases, APIs, and files, making integration difficult.
- **Complex Analysis Processes**: Multiple tool switches are required from data acquisition to analysis results, leading to inefficiency.
- **Collaboration Challenges**: There is a lack of a unified interaction interface among data analysts, developers, and business personnel.
- **Redundant Work**: Each analysis requires rewriting code for data connections, cleaning, and transformation.
To address these issues, we developed this **one-stop data management and analysis platform**, integrating database operations, API integration, data processing, and analytical computations into a unified MCP server. Users can complete complex data analysis tasks simply by using straightforward natural language commands.
### Core Features
🔍 **Multi-Data Source Integration**
- Supports mainstream databases such as SQLite, MySQL, PostgreSQL
- Integrates RESTful API data retrieval
- Unified data source management interface
📊 **Intelligent Data Processing**
- Data cleaning (deduplication, missing value handling, type conversion)
- Data transformation (column renaming, normalization, calculating new columns)
- Data filtering (conditional filtering, sampling, column selection)
📈 **Advanced Analytical Capabilities**
- Descriptive statistical analysis
- Trend analysis and forecasting
- Data visualization preview
💾 **Flexible Data Export**
- Supports various formats such as Excel, CSV, JSON
- Automatically generates standardized reports
- One-click sharing of analysis results
## Deployment Guide
### Environment Requirements
- **Python**: 3.8 or higher
- **Operating System**: Windows 10/11, macOS 10.15+, Ubuntu 18.04+
- **Memory**: At least 4GB RAM (8GB or more recommended)
- **Storage**: At least 1GB of available space
#### 2. Install Dependencies
```bash
pip install datamaster-mcp
```
#### 3. Configuration File Settings
Create the configuration file `config/mcp_config.json`:
```json
{
"mcpServers": {
"datamaster-mcp": {
"command": "uvx",
"args": [
"datamaster-mcp"
]
}
}
}
```
## Usage Example
### Example 1: Connect to Database and Query Data
**User Input:**
```
Connect to the local sales database and query the sales data for 2024
```
**System Response:**
```
✅ Database connection successful!
📊 Query Result: Found 15,847 sales records for 2024
Data Overview:
├─ Total Sales: ¥2,847,392.50
├─ Number of Orders: 15,847
├─ Average Order Amount: ¥179.68
└─ Data Time Range: 2024-01-01 to 2024-12-31
Data has been saved to table: sales_2024_analysis
```
### Example 2: API Data Retrieval and Analysis
**User Input:**
```
Retrieve the weather data for Beijing for the last 7 days from the weather API and analyze the temperature trend.
```
**System Response:**
```
🌤️ Weather data retrieval successful!
📈 Temperature trend analysis completed
7-day temperature statistics:
├─ Highest temperature: 28.5°C (October 15)
├─ Lowest temperature: 12.3°C (October 12)
├─ Average temperature: 20.8°C
└─ Temperature change: Overall declining trend (-3.2°C)
📊 Data visualization has been generated: exports/weather_trend_20241015_143022.png
```
### Example 3: Data Cleaning and Export
**User Input:**
```
Clean the user data table, remove duplicate emails, fill in missing phone numbers
```
**System Response:**
```
🧹 Data cleaning completed!
Cleaning result statistics:
├─ Original records: 8,432
├─ Duplicate emails: 127 (deleted)
├─ Missing phones: 2,156 (filled with default values)
├─ Data type conversion: 3 columns
└─ Records after cleaning: 8,305
📤 Cleaning results exported: exports/cleaned_users_20241015_144512.xlsx
```
### Example 4: Complex SQL Queries and Visualization
**User Input:**
```
Query the monthly sales for each product category, sorted by sales in descending order
```
**System Response:**
```
📊 Query executed successfully!
Monthly Sales Ranking:
├─ Electronics: ¥847,392.00 (29.7%)
├─ Apparel & Accessories: ¥624,193.50 (21.9%)
├─ Home Goods: ¥518,472.30 (18.2%)
├─ Books & Stationery: ¥392,847.20 (13.8%)
└─ Sports & Outdoors: ¥347,392.00 (12.2%)
📈 Visualization charts have been generated:
├─ Bar Chart: exports/category_sales_bar_20241015_145533.png
├─ Pie Chart: exports/category_sales_pie_20241015_145533.png
└─ Data Table: exports/category_monthly_sales.xlsx
```
### Actual Usage Screenshot Display
#### Main Interface Display
```
┌─────────────────────────────────────────────────────────────┐
│ DataMaster MCP Server │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ 🔍 Data Source Management 📊 Data Analysis ⚙️ Data Processing 🌐 API │ │
│ └─────────────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Connected Data Sources: │ │
│ │ 📊 SQLite Database: analysis.db (Connected) │ │
│ │ 🌐 Weather API: api.weather.com (Configured) │ │
│ │ 📈 Stock API: api.stocks.com (Configured) │ │
│ └─────────────────────────────────────────────────────┘ │
│ [Input Command] > Connect to sales database, query 2024 sales data... │
└─────────────────────────────────────────────────────────────┘
```
#### Database Connection Configuration
```
┌─────────────────────────────────────────┐
│ Database Connection Configuration │
├─────────────────────────────────────────┤
│ Database Type: SQLite │
│ Database Path: ./data/sales.db │
│ Connection Status: ✅ Connected │
│ Number of Tables: 12 │
│ Total Record Count: 125,847 │
├─────────────────────────────────────────┤
│ Available Tables: │
│ • customers (8,432 records) │
│ • orders (15,847 records) │
│ • products (342 records) │
│ • sales_records (45,293 records) │
└─────────────────────────────────────────┘
```
#### Data Query Results
```
┌─────────────────────────────────────────────┐
│ SQL Query Results │
├─────────────────────────────────────────────┤
│ Query: SELECT * FROM sales WHERE year=2024 │
│ Execution Time: 0.23 seconds │
│ Records Returned: 15,847 │
├─────────────────────────────────────────────┤
│ Data Overview: │
│ ├─ Total Sales: ¥2,847,392.50 │
│ ├─ Average Order: ¥179.68 │
│ ├─ Highest Single Transaction: ¥12,450.00 │
│ └─ Data Range: 2024-01-01 ~ 2024-12-31 │
└─────────────────────────────────────────────┘
```
#### API Data Retrieval
```
┌─────────────────────────────────────────────┐
│ API Data Retrieval │
├─────────────────────────────────────────────┤
│ API Name: Weather Data API │
│ Request URL: api.weather.com/v1/forecast │
│ Response Status: ✅ 200 OK │
│ Data Size: 45.2 KB │
├─────────────────────────────────────────────┤
│ Data Preview: │
│ Date Temperature Humidity Weather │
│ 2024-10-15 28.5°C 65% Sunny │
│ 2024-10-14 26.2°C 70% Cloudy │
│ 2024-10-13 24.8°C 72% Overcast │
└─────────────────────────────────────────────┘
```
#### Data Cleaning Tool
```
┌─────────────────────────────────────────────┐
│ Data Cleaning Results │
├─────────────────────────────────────────────┤
│ Records Before Cleaning: 8,432 │
│ Records After Cleaning: 8,305 │
│ Duplicates Removed: 127 │
│ Missing Values Filled: 2,156 │
├─────────────────────────────────────────────┤
│ Cleaning Operations: │
│ ✓ Removed duplicate email addresses │
│ ✓ Filled missing phone numbers │
│ ✓ Standardized date formats │
│ ✓ Validated email formats │
└─────────────────────────────────────────────┘
```
#### Analysis Result Export
```
┌─────────────────────────────────────────────┐
│ Export Result │
├─────────────────────────────────────────────┤
│ Export Format: Excel (.xlsx) │
│ File Path: exports/sales_analysis.xlsx │
│ File Size: 2.34 MB │
│ Number of Worksheets: 3 │
├─────────────────────────────────────────────┤
│ Worksheet Contents: │
│ • Sales Overview │
│ • Monthly Trends │
│ • Product Analysis │
└─────────────────────────────────────────────┘
```
### Advanced Usage Tips
#### Batch Processing
```bash
```
# Batch Processing Multiple Data Tables
```bash
python -m datamaster_mcp.main --batch-process tables.txt --config batch_config.json
```
#### Scheduled Tasks
```bash
# Set Up Scheduled Data Updates
```bash
python -m datamaster_mcp.main --schedule "0 9 * * *" --task daily_report
```
#### Custom Analysis Template
```json
{
"template_name": "monthly_sales_analysis",
"steps": [
{"action": "query", "sql": "SELECT * FROM sales WHERE date >= ?"},
{"action": "clean", "config": {"remove_duplicates": true}},
{"action": "analyze", "type": "trend"},
{"action": "export", "format": "excel"}
]
}
```
## Troubleshooting
### Frequently Asked Questions
**Q: Failed to connect to the database**
A: Check the database configuration and network connection, and ensure that the database service is running.
**Q: API request timed out**
A: Increase the API timeout settings and check the stability of the network connection.
**Q: Out of memory error**
A: Reduce the amount of data processed at one time, or increase the system memory.
### Log Viewing
```bash
```
# View Real-time Logs
tail -f logs/datamaster.log
# View Error Logs
grep ERROR logs/datamaster.log
```
## Technical Support
- **GitHub Issues**: [Submit an Issue](https://github.com/your-username/DataMaster-MCP/issues)
- **Documentation**: [Full Documentation](https://datamaster-mcp.readthedocs.io)
- **Community**: [Discussion Forum](https://github.com/your-username/DataMaster-MCP/discussions)
---
**DataMaster MCP Server** - Making data analysis simple and powerful!
Connection Info
You Might Also Like
MarkItDown MCP
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
Sequential Thinking
A structured MCP server for dynamic problem-solving and reflective thinking.
asyncmcp
asyncmcp is an asynchronous transport layer for MCP servers using queues.
mcpproxy-go
MCPProxy is an open-source proxy that enhances AI agents with tool discovery...
DINO-X-MCP
Official DINO-X Model Context Protocol (MCP) server that empowers LLMs with...