Skip to content
MCP Server Directory logo
developer-tools

Python

Giving Claude ability to run code with E2B via MCP (Model Context Protocol)

Reviewed overview

MCP サーバー概要

what is this project?

E2B MCP Server (Python) is a Model Context Protocol (MCP) server that gives Claude the ability to run code in a secure sandbox. It’s maintained by e2b-dev and designed to integrate with Claude Desktop so the Claude model can execute user code via MCP.

how to use the project?

  1. Clone the repository and install dependencies (project uses a uv tool):
    • uv install
  2. Configure Claude Desktop to point to the MCP server by editing the Claude Desktop config:
    • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%/Claude/claude_desktop_config.json
    • Example server config snippet: { “mcpServers”: { “e2b-mcp-server”: { “command”: “uvx”, “args”: [“e2b-mcp-server”], “env”: { “E2B_API_KEY”: “${e2bApiKey}” } } } }
  3. Set required environment variables (e.g., E2B_API_KEY) and run the server via the provided command.
  4. For debugging, run the MCP Inspector tool to proxy stdio and open debugging UI:
    • npx @modelcontextprotocol/inspector uv --directory . run e2b-mcp-server

key features

  • Secure sandboxed code execution for models
  • Implements Model Context Protocol (MCP) for Claude integration
  • Easy integration with Claude Desktop via config
  • Cross-platform guidance (macOS and Windows paths shown)
  • Debugging support via MCP Inspector for visualizing MCP/stdIO messages

use cases

  1. Allowing Claude to execute and test code snippets during conversations.
  2. Local development and prototyping of model-driven code execution workflows.
  3. Automating tasks or scripts triggered by model outputs in a sandbox.
  4. Educational demos where a model runs example code safely.
  5. Extending Claude with custom tool integrations that require executing code.

FAQ

  • Is running code safe?

The server runs code in a sandboxed environment to reduce risk, but you should still follow best practices: limit privileges, secure environment variables (API keys), and run on trusted machines.

  • How do I configure Claude Desktop to use this server?

Add an entry under mcpServers in claude_desktop_config.json pointing to the server command and pass any needed env vars (example provided above).

  • What dependencies are required?

The repository uses the uv tool for development and server execution. Install project dependencies with uv install (see repo README for full instructions).

  • How can I debug MCP/stdio communication?

Use the MCP Inspector (npx @modelcontextprotocol/inspector ...) which proxies stdio and gives a browser UI for inspecting messages.

  • Which Claude/model versions are supported?

The project is aimed at Claude/MCP-enabled clients (tags reference Anthropic/Claude). Verify compatibility with your Claude Desktop/MCP implementation; the repo targets MCP-capable Claude builds.

  • Where can I find the source and license?

Source is on the GitHub repo (https://github.com/e2b-dev/mcp-server/tree/HEAD/packages/python). Check the repository for license details.