Python Local MCP Server
python_local MCP 服务器
提供交互式 Python REPL(读取-求值-打印循环)环境的 MCP 服务器。
成分
资源
服务器提供对 REPL 会话历史记录的访问:
用于访问会话历史记录的自定义
repl://URI 方案每个会话的历史记录都可以被视为文本/纯文本资源
历史记录显示每次执行的输入代码和相应的输出
工具
服务器实现了一个工具:
python_repl:在持久会话中执行 Python 代码以
code(要执行的 Python 代码)和session_id作为必需参数为每个会话维护单独的状态
支持表达式和语句
捕获并返回 stdout/stderr 输出
Related MCP server: Django Shell MCP Server
配置
安装
克劳德桌面
在 MacOS 上: ~/Library/Application\ Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
发展
构建和发布
准备分发包:
同步依赖项并更新锁文件:
uv sync构建软件包分发版:
uv build这将在dist/目录中创建源和轮子分布。
发布到 PyPI:
uv publish注意:您需要通过环境变量或命令标志设置 PyPI 凭据:
令牌:
--token或UV_PUBLISH_TOKEN或用户名/密码:
--username/UV_PUBLISH_USERNAME和--password/UV_PUBLISH_PASSWORD
调试
由于 MCP 服务器通过 stdio 运行,调试起来可能比较困难。为了获得最佳调试体验,我们强烈建议使用MCP Inspector 。
您可以使用以下命令通过npm启动 MCP Inspector:
npx @modelcontextprotocol/inspector uv --directory /path/to/python_local run python-local启动后,检查器将显示一个 URL,您可以在浏览器中访问该 URL 以开始调试。
This server cannot be deployed
Maintenance
Related MCP Connectors
- mcp-serverOAuthai.cdbx
Build Apps and run code in 30 languages — sandboxed, with persistent sessions for agent loops.
Run Python code from natural language prompts, with optional PyPI package install.
A persistent Linux computer for your AI: what it installs and writes survives the session.
Run Python code in a secure sandbox without local setup. Declare inline dependencies and execute s…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to execute Python code with pexpect functionality for interactive debugging sessions with command-line tools like LLDB and GDB. Maintains a stateful Python session allowing programmatic control of interactive processes.74Apache 2.0
- AlicenseNot gradedqualityAmaintenanceProvides a stateful Django shell environment that allows AI assistants to execute Python code directly against Django projects. Maintains persistent session state between calls, enabling iterative exploration of models, queries, and debugging.40MIT
- FlicenseNot gradedqualityCmaintenanceProvides interactive Python REPL capabilities with persistent sessions, virtual environment support, package management via uv, and development tools like testing, linting, and code formatting for Python projects.-
- AlicenseNot gradedqualityDmaintenanceProvides a persistent Python REPL session as a tool for executing code, managing files, installing packages, and initializing projects via the MCP protocol.1MIT
Appeared in Searches
- AI tools for debugging Python code
- MaxScript scripting documentation and tutorials for 3ds Max
- MCP servers for curated context in Cursor IDE to plan, debug, and iterate on features
- A server for web searching, content summarization, and task automation
- Testing Local AI Agents in LMStudio for Computer Use and Code Execution Tasks