Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available: 6.11.0
metadata
title: MCP
emoji: 📈
colorFrom: green
colorTo: pink
sdk: gradio
sdk_version: 5.27.0
app_file: app.py
pinned: false
short_description: MCP Data Analyst Duo
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
- Typed messages (
ComputeAgent
- Handlers for
request_data_load,request_statistics,request_correlation - Emits
data_load_result,statistics_result,correlation_result
- Handlers for
InterpretAgent
- Receives compute results, replies with
ack - Runs
interpret_statistics&interpret_correlationtools - Emits
statistics_interpretation,correlation_interpretation - On
request_report, emitsreport_resultwith assembled Markdown
- Receives compute results, replies with
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.