Overview
The python_local MCP Server is an interactive environment that allows users to run Python code locally, providing a Read-Eval-Print Loop (REPL) experience.
To use the server, configure it following the installation instructions, and then access the REPL through the provided custom URI scheme to start executing Python code.
- Provides a persistent REPL for Python code execution - Maintains separate session states and supports multiple sessions simultaneously - Offers full access to execution history via a text/plain resource - Captures and returns both standard and error outputs from the executed code
- Rapidly testing Python code snippets in an interactive environment
- Debugging code by accessing previous sessions and outputs
- Learning Python through a hands-on coding approach in a local setup
Add to your AI client
Use these steps to connect python_local MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"python-mcp-alec2435": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-python-mcp-alec2435"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"python-mcp-alec2435": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-python-mcp-alec2435"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"python-mcp-alec2435": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-python-mcp-alec2435"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"python-mcp-alec2435": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-python-mcp-alec2435"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"python-mcp-alec2435": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-python-mcp-alec2435"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"python-mcp-alec2435": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-python-mcp-alec2435"
]
}
}
}FAQ
Can I use the python_local MCP Server on Windows?
Yes! The server can be configured and used on both MacOS and Windows platforms.
How do I configure the server for development?
You can modify the configuration files as outlined in the documentation to set up the server for local development.
Is there a limit on session history?
Session history is maintained for each active session, allowing users to track inputs and outputs during their coding sessions.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":87,"uuid":"ede411c8-ed05-4ff7-8be0-49c56b308264","name":"python_mcp","title":"python_local MCP Server","description":"MCP Server to run python code locally","avatar_url":"https://avatars.githubusercontent.com/u/9058562?v=4","created_at":"2024-12-13T09:00:31.728Z","updated_at":"2024-12-13T09:34:47.903Z","status":"created","author_name":"Alec2435","author_avatar_url":"https://avatars.githubusercontent.com/u/9058562?v=4","tags":"[]","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/Alec2435/python_mcp","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":null,"user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]