Get the FREE Ultimate OpenClaw Setup Guide →

pandas

MCP server from marlonluo2018/pandas-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio marlonluo2018-pandas-mcp-server uvx --from /path/to/pandas-mcp-server pandas-mcp-server

How to use

The Pandas MCP Server exposes a secure, sandboxed environment for executing pandas code and generating visualizations through the Model Context Protocol (MCP). It provides four built-in tools that an LLM can invoke: read_metadata_tool to analyze file structure and metadata, interpret_column_data to gain deeper insights into specific columns, run_pandas_code_tool to execute pandas operations and return results, and generate_chartjs_tool to produce interactive Chart.js visualizations. This enables AI assistants to safely inspect datasets, perform transformations, and produce charts without exposing the underlying system to untrusted code. To use it, configure the MCP client (for example, Claude Desktop) to connect to the server via the stdio bridge using uvx, and then call the available tools in sequence as your analysis workflow requires. The server automates memory management and offers configurable security and feature flags to tailor execution to your environment.

How to install

Prerequisites:

  • Python 3.10+
  • pip
  • Git
  • uv (via uvx) or a Python runtime environment as outlined below

Step 1: Clone the Repository

git clone https://github.com/marlonluo2018/pandas-mcp-server.git
cd pandas-mcp-server

Step 2: Install Dependencies

pip install -r requirements.txt

Step 3: Configure Environment Variables (Optional) The server supports extensive configuration through environment variables. Copy the example configuration file:

cp .env.example .env

Edit the .env file to customize settings such as log levels, file size limits, feature flags, memory monitoring, and security options. For detailed configuration, see CONFIGURATION.md.

Step 4: Verify Installation

# Test the CLI interface
python cli.py

# Or test the MCP server directly
python server.py

Notes:

  • The pandas-mcp-server requires pandas>=2.0.0, fastmcp>=1.0.0, chardet>=5.0.0, and psutil as listed in dependencies.
  • If you prefer using uvx, ensure uv is installed: pip install uv or pipx install uv.
  • You can configure Claude Desktop or other MCP clients to point at the server using the provided examples in CONFIGURATION.md.

Additional notes

Tips and common issues:

  • Ensure the Python environment used to run the server has internet access for dependency resolution.
  • Use the .env file to tune performance (memory limits, large file handling) and security (blacklist extensions).
  • If you encounter file encoding issues, verify the chardet dependency and dataset encoding; set appropriate environment variables to control detection behavior.
  • When integrating with Claude Desktop, follow the provided JSON snippets for either uvx or Python-based invocations to ensure proper path handling across OSes.
  • The four MCP tools exposed are read_metadata_tool, interpret_column_data, run_pandas_code_tool, and generate_chartjs_tool; call them in the recommended order for a typical data analysis workflow.

Related MCP Servers

Sponsor this space

Reach thousands of developers