
Excel MCP Server
A Model Context Protocol server that provides tools for reading, updating, filtering, and visualizing Excel data through a simple API.
README
uv init mcp-server-demo
cd mcp-server-demo
uv add "mcp[cli]" uv pip install mcp-python pandas matplotlib openpyxl fastapi uvicorn pillow uv run mcp dev server.py
uv run mcp install server.py
Excel MCP Server
This project implements a Model Context Protocol (MCP) server that provides tools and resources for working with Excel data. The server offers functionality for reading, updating, filtering, and visualizing Excel data through a simple API.
Features
- Excel Operations: Read from and write to Excel files
- Data Filtering: Filter and search data based on various criteria
- Data Analysis: Generate statistical summaries and pivot tables
- Data Visualization: Create various charts and visualizations
- Update Operations: Update cells, add rows, delete rows
- Anomaly Detection: Find outliers in numeric data
- Chart Recommendations: Automatically suggest appropriate visualizations
Installation
- Install the required dependencies:
pip install mcp-python pandas matplotlib openpyxl fastapi uvicorn pillow
- Clone this repository or download the files:
server.py
- The MCP server implementationclient.py
- Demo client to showcase the features
Usage
Starting the Server
Run the server:
python server.py
The server will start at http://localhost:8000
by default.
Using the Client Demo
The client demo script showcases various operations you can perform with the MCP server:
python client.py
This will:
- Create a sample Excel file (if it doesn't exist)
- Demonstrate basic Excel operations
- Show data filtering capabilities
- Generate visualizations
- Perform data updates
- Detect anomalies in the data
Using the API Directly
You can use the MCP server's API directly:
Tools API
Call tools using POST requests to /tools/{tool_name}
:
import requests
# Example: Read Excel file
response = requests.post(
"http://localhost:8000/tools/read_excel",
json={"filename": "example.xlsx", "sheet_name": "Sheet1"}
)
data = response.json()
Resources API
Access resources using GET or POST requests to /resources/{resource_path}
:
# Example: Get sheet list
response = requests.get("http://localhost:8000/resources/excel://example.xlsx/sheets")
sheets = response.json()
Available Tools
Excel Operations
read_excel
- Read data from an Excel filewrite_excel
- Write data to an Excel fileget_excel_sheets
- Get the list of sheets in an Excel file
Data Filtering
filter_data
- Filter Excel data based on conditionssearch_data
- Search for a term in Excel data
Data Analysis
summarize_data
- Get statistical summary of Excel datacreate_pivot_table
- Create a pivot table from Excel data
Data Visualization
visualize_chart
- Create various chart types (bar, line, scatter, pie, hist)recommend_charts
- Get chart recommendations based on data structure
Update Operations
update_cell
- Update a specific cell in an Excel fileadd_row
- Add a new row to an Excel filedelete_rows
- Delete rows from an Excel file based on filters
Additional Features
detect_anomalies
- Find anomalies in numeric data using Z-scoresexport_to_csv
- Export Excel data to CSV format
Available Resources
excel://{filename}/sheets
- Get list of sheets in an Excel fileexcel://{filename}/sheet/{sheet_name}
- Get data from a specific sheetexcel://{filename}/sheet/{sheet_name}/summary
- Get summary of sheet dataexcel://{filename}/sheet/{sheet_name}/filter
- Filter data in a sheet
Example: Creating a Custom Client
You can create your own client to interact with the MCP server:
import requests
def call_tool(tool_name, params):
"""Call an MCP tool"""
url = f"http://localhost:8000/tools/{tool_name}"
response = requests.post(url, json=params)
return response.json()
# Example: Get chart visualization
chart_result = call_tool("visualize_chart", {
"filename": "sales_data.xlsx",
"sheet_name": "Sheet1",
"chart_type": "bar",
"x_column": "Month",
"y_columns": ["Revenue"],
"title": "Monthly Revenue"
})
# Save chart image
if chart_result.get("success", False) and "image" in chart_result:
import base64
img_data = base64.b64decode(chart_result["image"])
with open("revenue_chart.png", "wb") as f:
f.write(img_data)
Integration with AI Models
This MCP server can be easily integrated with AI models like Claude to provide natural language interfaces to Excel data:
- The AI can call the appropriate MCP tool based on the user's request
- Process the data returned by the tool
- Present insights and visualizations to the user
This creates an interactive "Excel assistant" that can understand natural language requests to analyze and manipulate Excel data.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.