Get the FREE Ultimate OpenClaw Setup Guide →

python

MCP server from Timtech4u/python-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 timtech4u-python-mcp-server node /absolute/path/to/python-mcp-server/dist/index.js \
  --env PYTHONUNBUFFERED="Optional: run Python with unbuffered output"

How to use

This MCP server exposes Python execution and file/environment management capabilities to Claude, Cline, or other LLM assistants via the MCP interface. It supports executing Python code snippets, running Python files, checking the Python version, listing, reading, and writing Python files, and inspecting the Python environment. With these tools, you can run ad hoc Python code, automate script execution, manage project files, and verify environment details from within your LLM-driven workflows. After configuring the server in Claude Desktop or Cline, you can invoke tools like execute_python_code to run dynamic Python snippets, or execute_python_file to run a script located on your filesystem. You can also query check_python_version to confirm your runtime, list_python_files to discover Python scripts in a directory, and use read_python_file or write_python_file to inspect or modify code as part of a larger automation or tutoring flow.

How to install

Prerequisites:

  • Node.js 16 or higher
  • Python installed and available in your PATH
  • Claude Desktop or Cline installed (optional for integration)

Installation steps:

  1. Clone the repository:
git clone https://github.com/Timtech4u/python-mcp-server.git
cd python-mcp-server
  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Start the MCP server (example):
node dist/index.js
  1. Configure Claude Desktop or Cline to load the MCP server using the provided configuration example in the README (adjust the path to dist/index.js to your environment).

Additional notes

Tips and notes:

  • Ensure Python is installed and accessible in your system PATH before using the Python-related tools.
  • The MCP server supports configurable timeouts and working directories for code execution via the tool parameters (e.g., timeout and workingDir in execute_python_code or execute_python_file).
  • If you encounter permission errors when reading or writing files, verify that the user running the MCP server has the necessary filesystem permissions.
  • The available tools are designed to be used from your LLM prompts; for example, you can ask the model to execute a snippet, run a script, or list files in a directory to prepare a larger workflow.
  • If you run into Python not found errors, verify your Python installation and PATH configuration.
  • The autoApprove list determines which actions the MCP server will automatically approve in Claude/Cline integrations.

Related MCP Servers

Sponsor this space

Reach thousands of developers