mcp-pandas
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-pandasProfile the file sales.csv"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.

MCP Pandas
A modern Model Context Protocol server for pandas-based data analysis. Point it at a CSV/Excel file and it profiles the data, explains individual columns, runs sandboxed pandas code, and renders interactive charts.
Exposes 4 tools and 2 guided prompts. Functionality inspired by
marlonluo2018/pandas-mcp-server.
Requirements
Python 3.10+
uv (or Docker, for the containerized setup)
Related MCP server: Claude Data Buddy
Installation
uv venv
uv pip install -e ".[dev]"Running
The server supports two transports, selected via the MCP_TRANSPORT environment variable (see Configuration).
STDIO
The server speaks MCP over stdio by default (the transport used by most MCP clients such as Claude Desktop and Claude Code):
source .venv/bin/activate
mcp-pandasStreamable HTTP
To serve over streamable HTTP instead:
source .venv/bin/activate
MCP_TRANSPORT=http mcp-pandasThe HTTP endpoint is then available at http://0.0.0.0:8080/mcp/.
Docker
Build the image and run it in HTTP mode (the image defaults to HTTP on port 8080):
docker build -t mcp-pandas .
docker run --rm -p 8080:8080 mcp-pandasOverride any setting at runtime with -e, e.g. a different port:
docker run --rm -p 9000:9000 -e MCP_PORT=9000 mcp-pandasConfiguration
Variable | Default | Description |
|
| Transport to use: |
|
| Host/interface to bind when using HTTP. Use |
|
| Port to listen on when using HTTP. |
|
| Directory where |
Available Tools
Tool | Description |
| Profile a CSV/Excel file: shape, dtypes, null counts, cardinality, sample values, quality warnings and suggested operations (samples the first 100 rows). |
| Full value distribution of one or more columns (scans the whole file). |
| Execute pandas code in a restricted sandbox; optionally preload a file as |
| Render an interactive Chart.js HTML file ( |
Guided Prompts
Prompt | Description |
| Walks metadata → column analysis → pandas code → visualization. |
| Summarizes a single column and turns its distribution into a chart. |
run_pandas_code safety
The executed code runs with a replaced __builtins__ and a pattern filter. It
must assign its output to a variable named result, and constructs that escape
the sandbox are rejected: import, open, exec, eval, and references to
os/sys/subprocess/shutil/socket/dunder attributes. pd (pandas) and
np (numpy) are available; pass file_path to preload the data as df.
Limits
Maximum input file size: 100 MB.
read_metadataprofiles the first 100 rows for speed.interpret_column_datareturns up to 200 distinct values per column.Supported formats:
.csv,.tsv,.txt,.xlsx,.xls.
Project layout
src/mcp_pandas/
├── server.py # FastMCP instance, registration, transport entry point
├── loader.py # shared file loading, validation, memory optimization
├── utils.py # code-safety and column validation helpers
├── charting.py # Chart.js HTML generation
├── prompts.py # guided prompts
└── tools/ # one module per tool, each exposing register(mcp)
├── metadata.py
├── columns.py
├── execution.py
└── charts.pyDevelopment
Testing
The suite writes fixture files to a temp directory and needs no network:
pytestLicense
Available Tools
4 toolsgenerate_chartjsA
Generate an interactive Chart.js HTML file from series data.
Supports bar, line and pie charts. The self-contained HTML is
written to the charts directory (MCP_CHARTS_DIR, default ./charts)
and the tool returns its path. Pie charts use the first series only. Feed
it aggregated data — e.g. the output of a run_pandas_code group-by.
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Chart data as {'labels': [...], 'series': [{'name': str, 'values': [...]}]}. Every series must match the label count. | |
| title | No | Chart title. | Chart |
| chart_type | No | bar |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It discloses that the HTML file is written to a configurable directory (MCP_CHARTS_DIR, default ./charts) and returns the path. It also notes the behavioral quirk about pie charts using only the first series. This is adequate for behavioral expectations, though more details on overwriting or authentication would improve it.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is only five sentences, each essential. No redundant or verbose language. It starts with the core purpose, then elaborates on supported types, output location, and usage hints. Highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (3 parameters, nested data object, output schema exists), the description covers the key aspects: purpose, input format, output file generation, and special behavior. It omits details like error handling or file naming, but these are reasonable gaps for a straightforward tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 67% schema description coverage, the description adds value by explaining that data should be aggregated and that pie charts only use the first series. The chart_type enum is reinforced, and the title parameter is straightforward. The description supplements the schema's missing description for chart_type.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Generate an interactive Chart.js HTML file from series data,' specifying the verb and resource. It distinguishes from siblings (read_metadata, interpret_column_data, run_pandas_code) by focusing on visualization output. Examples of chart types and input source are given.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description advises to 'Feed it aggregated data — e.g. the output of a run_pandas_code group-by,' providing clear when-to-use guidance. It also notes 'Pie charts use the first series only,' which is a usage caveat. However, it does not explicitly state when not to use or mention alternatives, keeping it from a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
interpret_column_dataA
Return the complete value distribution of one or more columns.
For each requested column, reports dtype, total/null/unique counts and the
value frequencies (sorted most-common first). Unlike read_metadata,
this scans the whole file rather than a sample, so it is ideal for
understanding categorical columns. Frequencies are capped at 200 distinct
values per column.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Path to a CSV/TSV or Excel (.xlsx/.xls) file. | |
| sheet_name | No | Excel sheet name; ignored for CSV files. | |
| column_names | Yes | Columns to analyze. |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description fully discloses key behaviors: it scans the whole file, reports dtype/total/null/unique counts, value frequencies sorted most-common first, and caps frequencies at 200 distinct values. It does not mention performance implications but covers essential behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with two paragraphs. The first sentence immediately states the purpose. The second paragraph provides essential details without superfluous words. Every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has three parameters and an output schema, the description explains the output components (dtype, counts, frequencies) and behavior (full scan, 200 cap). It adequately informs an AI agent for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so all parameters are described. The description adds value by mentioning file format support (CSV/TSV/Excel), sheet_name applicability, and the cap on distinct values. This enriches the schema's bare descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool returns 'complete value distribution' of columns, specifying verb 'return' and resource 'value distribution'. It distinguishes itself from sibling read_metadata by noting it scans the whole file rather than a sample, making the purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states this tool is 'ideal for understanding categorical columns' and contrasts with read_metadata ('Unlike read_metadata, this scans the whole file'). It does not explicitly list when not to use or name other alternatives, but the context is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_metadataA
Profile a data file: structure, types, quality warnings and next steps.
Reads only the first rows for efficiency and returns file info, a
per-column profile (dtype, null counts, cardinality, sample values and
numeric min/max/mean), data-quality warnings, and suggested pandas
operations to run next with run_pandas_code. This is the recommended
first call when exploring an unknown dataset.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Path to a CSV/TSV or Excel (.xlsx/.xls) file. |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully carries the burden. It discloses that only first rows are read for efficiency, provides output details (file info, per-column profile, warnings, suggestions), and implies read-only behavior. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with two paragraphs, front-loading the main purpose. Every sentence adds value, though it could be slightly tighter.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given an output schema exists, the description efficiently covers what's returned (file info, column profile with stats, warnings, suggested operations) and ties to sibling tools. It's complete for a simple profiling tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The sole parameter file_path is fully described in the schema. The description adds context about reading first rows but doesn't augment parameter meaning beyond the schema. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool profiles a data file, listing specific outputs (structure, types, quality warnings, suggested next steps) and explicitly positions it as the recommended first call for unknown datasets, distinguishing it from siblings like run_pandas_code.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly recommends this as the first call when exploring an unknown dataset, and mentions efficiency (reads only first rows). While it doesn't specify when not to use it, the context is clear relative to sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
run_pandas_codeA
Execute pandas code in a restricted sandbox and return result.
pd (pandas) and np (numpy) are in scope; when file_path is
given, the file is loaded into a DataFrame named df. The code must
assign its output to result. For safety, filesystem/process/interpreter
access (import, open, exec, eval, os/sys/…) is
rejected. DataFrame/Series results are returned as records.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python/pandas code to run. `pd` and `np` are available; assign the final output to a variable named `result`. | |
| file_path | No | Optional CSV/Excel file to preload as a DataFrame named `df` before running the code. |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description carries the full burden. It describes the sandbox, restricted operations (import, open, exec, etc.), and result format (records for DataFrames/Series). It does not mention timeouts or error handling, but the critical safety behaviors are covered.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise (~100 words) and well-structured, with the main action first, followed by scope, file loading, assignment rule, safety restrictions, and result format. Every sentence provides necessary information without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (code execution) and no annotations, the description covers allowed operations, restricted actions, file integration, and output format. It is mostly complete but could mention error behavior or limits for better agent guidance.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds value by explaining the scoped libraries (pd, np), the preloading of file_path into a DataFrame df, and the assignment requirement. This goes beyond the schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it executes pandas code in a restricted sandbox and returns the result. It distinguishes itself from sibling tools like generate_chartjs, read_metadata, and interpret_column_data by being the only tool that runs arbitrary code.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context on how to use the tool (available libraries, file loading, assignment to result) but does not explicitly state when not to use it or mention alternatives. It is adequate but lacks exclusions or comparison hints.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a distinct purpose: generating charts, profiling metadata, examining column distributions, and executing arbitrary pandas code. There is no overlap or ambiguity.
All tool names use snake_case with a verb_noun pattern, but the verbs vary (generate, read, interpret, run). This is consistent within its own style, though not perfectly uniform.
Four tools is a minimal but focused set for pandas operations. It covers key actions without being overly sparse or excessive for the domain.
Core operations like metadata profiling, column analysis, code execution, and visualization are covered. Minor gaps exist (e.g., no direct data subsetting tool) but arbitrary code fills most needs.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
The all-in-one data stack for agents. Upload files, run SQL, evolve tables, and render charts.
Renders interactive Chart.js charts and dashboards inline in AI conversations.
AI access to Quadratic spreadsheets: open files, run Python/SQL, query connected databases.
The statistical analyst in your AI chat — validated, citable, re-runnable analysis of your data.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered business intelligence and data analysis using pandas and LLM code generation. Supports automated data processing, statistical analysis, and visualization creation through natural language interactions.15
- FlicenseNot gradedqualityDmaintenanceEnables conversational analysis of CSV and Parquet files through natural language, providing statistics, summaries, data type information, and comprehensive multi-step data analysis.
- AlicenseNot gradedqualityBmaintenanceA spreadsheet and CSV analysis toolkit for AI agents that enables loading CSV files, filtering and querying data, computing statistics, creating aggregations, building pivot tables, and exporting chart-ready data using pandas.16MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to safely execute pandas code for data analysis and generate interactive visualizations through MCP protocol.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/devantage/mcp-pandas'
If you have feedback or need assistance with the MCP directory API, please join our Discord server