Python REPL MCP Server
This MCP server provides a Python REPL (Read-Eval-Print Loop) as a tool. It allows execution of Python code through the MCP protocol with a persistent session.
Setup
No setup needed! The project uses uv
for dependency management.
Running the Server
Simply run:
Usage with Claude Desktop
Add this configuration to your Claude Desktop config file:
The server provides three tools:
execute_python
: Execute Python code with persistent variablescode
: The Python code to executereset
: Optional boolean to reset the session
list_variables
: Show all variables in the current sessioninstall_package
: Install a package from pypi
Examples
Set a variable:
Use the variable:
List all variables:
Reset the session:
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. Here are some ways you can contribute:
- Report bugs
- Suggest new features
- Improve documentation
- Add test cases
- Submit code improvements
Before submitting a PR, please ensure:
- Your code follows the existing style
- You've updated documentation as needed
- Maybe write some tests?
For major changes, please open an issue first to discuss what you would like to change.
local-only server
The server can only run on the client's local machine because it depends on local resources.
A server that provides a persistent Python REPL environment through the MCP protocol, allowing execution of Python code, variable management, and package installation.
Related Resources
Related MCP Servers
- -securityFlicense-qualityThis is an MCP server that facilitates building tools for interacting with various APIs and workflows, supporting Python-based development with potential for customizable prompts and user configurations.Last updated -Python
- -securityFlicense-qualityA Python-based server that helps users easily install and configure other MCP servers across different platforms.Last updated -2Python
- -securityAlicense-qualityA template repository for creating custom Model Context Protocol (MCP) servers in Python that can be integrated with applications like Claude Desktop or Cursor.Last updated -5PythonMIT License
- -securityFlicense-qualityA minimal Python package for easily setting up and running MCP servers and clients, allowing functions to be automatically exposed as tools that LLMs can use with just 2 lines of code.Last updated -23Python