This repository contains a server implementation using the Model Context Protocol (MCP) with functionalities to handle CSV files, execute Pandas code, and generate interactive charts (bar charts and pie charts).
pip install -r requirements.txt
file_path
: Path to the CSV file.code
: String containing the Pandas code to execute.os.
, sys.
, subprocess.
, open(
, exec(
, eval(
, import os
, import sys
.categories
: List of category names for x-axisvalues
: List of numeric values for y-axistitle
: Chart title (default: "Interactive Chart"){
"categories": ["Electronics", "Clothing", "Home Goods"],
"values": [120000, 85000, 95000],
"title": "Q1 Sales by Product Category"
}
labels
: List of label names for each pie slicevalues
: List of numeric values for each slicetitle
: Chart title (default: "Interactive Pie Chart"){
"labels": ["Electronics", "Clothing", "Home Goods"],
"values": [120000, 85000, 95000],
"title": "Q1 Sales Distribution"
}
labels
: List of label names for x-axis
datasets
: List of datasets, each containing:
label
: Name of the datasetdata
: List of numeric valuestitle
: Chart title (default: "Interactive Line Chart"){
"labels": ["Jan", "Feb", "Mar"],
"datasets": [
{
"label": "Sales",
"data": [12000, 15000, 18000]
},
{
"label": "Expenses",
"data": [8000, 9000, 10000]
}
],
"title": "Monthly Performance"
}
{
"mcpServers": {
"pandas": {
"name": "pandas",
"type": "stdio",
"description": "run pandas code",
"isActive": true,
"command": "python",
"args": [
"${workspaceFolder}/server.py"
]
}
}
}
Read metadata of your CSV file:
read_metadata
with the file pathExecute Pandas operations on the loaded data:
run_pandas_code
with the appropriate Pandas operationVisualize the results using charts:
bar_chart_to_html
with the grouped data{
"status": "SUCCESS",
"filepath": "/absolute/path/to/chart_1713443200.html"
}
Seamless access to top MCP servers powering the future of AI integration.