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
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
GemForge (Gemini Tools)
Integrates Google's Gemini for advanced codebase analysis, web search, and processing of text, PDFs, and images.
GitHub MCP Server
Repository analysis, issues, pull requests, and code structure exploration
MCP Gateway
A gateway to translate MCP tool calls into HTTP API requests, configurable via YAML.
302AI Basic MCP Server
A toolkit for enhancing the fundamental capabilities of large language models.
Code Scalpel
Code Scalpel is an MCP server that upgrades your AI coding agent with surgical, graph-based tools for precise analysis, atomic refactoring, and 99% lower token costs.
Auto API - YApi
A tool to retrieve API interface information from YApi, with authentication configurable via environment variables.
MCPJam Inspector
A developer tool for testing and debugging MCP servers, supporting STDIO, SSE, and Streamable HTTP protocols.
Raymon
Stateful HTTP ingest + MCP server + terminal UI for Ray-style logs.
Code Assistant
A Rust-based CLI tool for code-related tasks, operating as an MCP server.
Autodev Codebase
A platform-agnostic code analysis library with semantic search capabilities and MCP server support.