Neha-Rudraraju/MCP
0
MCP: Data Analyst Duo
A lightweight two-agent pipeline using the Model Context Protocol (MCP) to load a CSV, compute statistics & correlations, interpret results with simple rule-based insights, and assemble a Markdown report—all powered by a Gradio interface.
Features
- ComputeAgent
- Loads any publicly-accessible CSV into a pandas DataFrame
- Computes descriptive statistics (count, mean, std, min, quartiles, max)
- Computes a Pearson correlation matrix for all numeric columns
- InterpretAgent
- Acknowledges each compute result
- Picks top 3 columns by range and top 3 strongest correlations
- Formats human-readable insights and a concise summary
- Assembles a final Markdown report combining preview, metrics, and insights
- Gradio UI
- Input: Paste your CSV URL
- Outputs (in order):
- First five rows preview
- JSON statistics
- JSON correlation matrix
- ComputeAgent message history
- InterpretAgent message history
- Final Markdown report
Architecture
- MCPMessage
- Typed messages (
request_*,*_result,ack,*_interpretation,report_result) - Ensures strict request–response semantics
- ComputeAgent
- Handlers for
request_data_load,request_statistics,request_correlation - Emits
data_load_result,statistics_result,correlation_result
- InterpretAgent
- Receives compute results, replies with
ack - Runs
interpret_statistics&interpret_correlationtools - Emits
statistics_interpretation,correlation_interpretation - On
request_report, emitsreport_resultwith assembled Markdown
Usage
- Clone or fork this Space.
- Ensure your CSV is publicly accessible (e.g., hosted on GitHub, S3, etc.).
- In the Gradio UI, paste the CSV URL and click Run.
- Inspect each output panel—preview, raw metrics, histories, then read the final report summary.
