Labsco
barvhaim logo

Python Interpreter MCP

โ˜… 3

from barvhaim

An MCP server that provides Python code execution capabilities through a REST API interface.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

Python Interpreter MCP

A Model Context Protocol (MCP) server that provides Python code execution capabilities through a REST API interface.

Overview

This MCP server exposes a single tool execute_python_code that allows AI assistants and other MCP clients to execute Python code remotely. The server acts as a bridge between MCP clients and a Python interpreter REST API service.

Features

  • Execute arbitrary Python code through MCP
  • Returns complete execution results including stdout, stderr, exit codes, and file outputs
  • Built with FastMCP for easy MCP server development
  • Async HTTP client for reliable communication with the Python interpreter service

Error Handling

The server handles various error conditions:

  • Request errors: Network connectivity issues
  • HTTP errors: API service errors (4xx/5xx responses)
  • Timeout errors: Long-running code execution

All errors are returned in the standard response format with appropriate error messages in the stderr field.

Dependencies

  • fastmcp: MCP server framework
  • httpx: Async HTTP client for API communication