Python REPL
A Python REPL with persistent sessions and automatic dependency management using uv.
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:
uv run src/python_repl/server.py
Usage with Claude Desktop
Add this configuration to your Claude Desktop config file:
{
"mcpServers": {
"python-repl": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/python-repl-server",
"run",
"mcp_python"
]
}
}
}
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 session -
install_package
: Install a package from pypi
Examples
Set a variable:
a = 42
Use the variable:
print(f"The value is {a}")
List all variables:
# Use the list_variables tool
Reset the session:
# Use execute_python with reset=true
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.
Related Servers
CopyTuner Client
Manage Rails i18n translations with CopyTuner. Search, update, and create translation keys.
Algorand
A comprehensive MCP server for tooling interactions(40+) and resource accessibility(60+) plus many useful prompts to interact with Algorand Blockchain.
Tripo MCP Server
Generate 3D models with Tripo AI. Requires the external Tripo AI Blender Addon.
OPNsense MCP Server
A comprehensive MCP server for managing OPNsense firewalls, offering over 300 tools for configuration and monitoring.
Remote MCP Server (Authless)
An example of a remote MCP server deployable on Cloudflare Workers without authentication.
Xcode
Tools for Xcode project management, building, testing, archiving, code signing, and iOS development utilities.
Pickapicon
Quickly retrieve SVGs using the Iconify API, with no external data files required.
Deliberate Reasoning Engine (DRE)
Transforms linear AI reasoning into structured, auditable thought graphs, enabling language models to externalize their reasoning process as a directed acyclic graph (DAG).
MCP Shell
Execute secure shell commands from AI assistants and other MCP clients, with configurable security settings.
Codacy
Access the Codacy API to analyze code quality, coverage, and security for your repositories.