Skip to main content
Glama

Python Local MCP Server

by Alec2435

python_local MCP 服务器

提供交互式 Python REPL(读取-求值-打印循环)环境的 MCP 服务器。

成分

资源

服务器提供对 REPL 会话历史记录的访问:

  • 用于访问会话历史记录的自定义repl:// URI 方案
  • 每个会话的历史记录都可以被视为文本/纯文本资源
  • 历史记录显示每次执行的输入代码和相应的输出

工具

服务器实现了一个工具:

  • python_repl :在持久会话中执行 Python 代码
    • code (要执行的 Python 代码)和session_id作为必需参数
    • 为每个会话维护单独的状态
    • 支持表达式和语句
    • 捕获并返回 stdout/stderr 输出

配置

安装

克劳德桌面

在 MacOS 上: ~/Library/Application\ Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json

发展

构建和发布

准备分发包:

  1. 同步依赖项并更新锁文件:
uv sync
  1. 构建软件包分发版:
uv build

这将在dist/目录中创建源和轮子分布。

  1. 发布到 PyPI:
uv publish

注意:您需要通过环境变量或命令标志设置 PyPI 凭据:

  • 令牌: --tokenUV_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 以开始调试。

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

提供一个交互式 Python REPL 环境,维护持久会话状态,允许用户执行 Python 代码和访问会话历史记录。

  1. 成分
    1. 资源
    2. 工具
  2. 配置
    1. 安装
  3. 发展
    1. 构建和发布
    2. 调试

Related MCP Servers

  • -
    security
    A
    license
    -
    quality
    A Model Context Protocol server that allows execution of Python code within Daytona workspaces, providing a secure and isolated environment for executing and managing Python scripts.
    Last updated -
    1
    14
    Python
    Apache 2.0
    • Apple
  • -
    security
    F
    license
    -
    quality
    This is an MCP server that facilitates building tools for interacting with various APIs and workflows, supporting Python-based development with potential for customizable prompts and user configurations.
    Last updated -
    Python
  • A
    security
    A
    license
    A
    quality
    A server that provides a persistent Python REPL environment through the MCP protocol, allowing execution of Python code, variable management, and package installation.
    Last updated -
    3
    3
    Python
    MIT License
  • A
    security
    F
    license
    A
    quality
    A Python server implementing the Model Context Protocol to provide customizable prompt templates, resources, and tools that enhance LLM interactions in the continue.dev environment.
    Last updated -
    2
    1
    Python

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Alec2435/python_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server