Python REPLBLOCK
A python repl for MCP
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
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 variables
code: 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.
4c6eb554a97aOBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add mcp-python -- uvx mcp-python
{
"mcpServers": {
"mcp-python": {
"command": "uvx",
"args": [
"mcp-python"
]
}
}
}Exposed tools (3)
1 read · 2 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
execute_python | write | Execute Python code and return the output. Variables persist between executions. |
install_package | write | Install a Python package using uv |
list_variables | read | List all variables in the current session |
Trust audit
BLOCKgrade D · trust 69/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | FAIL |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- declared (3 observation(s))
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (3)
exec(code, self.global_namespace)
last_value = eval(last_line, self.global_namespace)
exec(f"import {package.split('[')[0]}", self.global_namespace)Gates applied: no_behavioural_pass.
4c6eb554a97afull audit observations/trust-audit/mcp-server/hdresearch__python-repl.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 4c6eb554a97a | BLOCK | D | 69 | first audit |
Questions
What is the Python REPL MCP server?
A python repl for MCP
What tools does Python REPL expose?
3 in total: 1 read-only, 2 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Python REPL safe to connect to an agent?
No — not without reading the findings first. The audit graded it D (69/100) and found 3 critical or high issues in the source. Each one is listed on this page with the file and line it is on.
What credentials does Python REPL need?
No credential environment variables were found in its source, so it appears to need none.
How does Python REPL run?
It speaks stdio, so it runs as a local process your client starts. It is published on PyPI as mcp-python.
How current is this page?
The grade is for one exact copy of the source (4c6eb554a97a), read on 2026-10-08. The repository is watched and re-audited when it changes.