OlympHill
M

mcp_safe_local_python_executor基于 hugging faces 的小型 agent 框架中的 `smolagents` 框架中 `LocalPythonExecutor` 的_stdio MCP 服务,包装本地 Python 运行时(LocalPythonExecutor)。 本地 Python 运行时与 Docker、VM、云运行时相比简化了设置(

(0)
Daniel Nikulshyn审阅者 Daniel Nikulshyn·更新 2026年7月

概览

mcp_safe_local_python_executor 是一个stdio MCP 服务,使用hugging face的LocalPythonExecutor从 smolagents 框架中包装而成。它为 LLM 生成的 Python 代码提供一个本地运行时,具有基本的隔离和安全性。这个工具不需要 Docker 或虚拟机,可以与 LLM 应用程序,如 Claude Desktop 或任何兼容 MCP 的客户端一起使用。它通过限制文件 I/O 操作和导入来提供设置 ease 和安全性之间的平衡。然而,用户仍应谨慎在机器上执行LLM生成的代码。

主要功能

  • 公布了工具 run_python
  • 相比直接 eval(),Python代码的执行更安全
  • 通过 uv 运行在 Python 虚拟环境中
  • 禁止文件 I/O 操作
  • 受限的导入列表

价格

模型
Free
评分
暂无评价

使用场景

Claude Desktop 的代码解释器

这个工具可以作为 Claude Desktop 的代码解释器插件,允许用户执行 LLM 生成的 Python 代码。

LLM 应用程序中的 Python 执行器

mcp_safe_local_python_executor 可以与任何兼容 MCP 的客户端一起使用,提供一个安全并方便地执行 LLM 生成的 Python 代码的方式。

优点 & 缺点

优点

  • 与 Docker 或 VM 相比,安装更方便
  • 为在运行 Python 代码时提供基本的隔离和安全性
  • 为 LLM 应用程序暴露 'run_python' 工具
  • 受限制的导入,仅在 Python 虚拟环境中运行
  • 支持 LLM 应用程序

缺点

  • 不如使用 VM 或 Docker 容器那样安全
  • 在执行 LLM 生成的代码时需要格外谨慎
  • 需要仔细考虑执行 LLM 生成的代码
  • 没有提供高层次的安全
  • 需要用户谨慎

评测

登录以留下评测。

暂无评测。来当第一个吧!

问答

Can I use it with LLM apps?

Yes, it exposes a 'run_python' tool for LLM apps like Claude Desktop or any other MCP compatible client.

Asked by Uma Krishnan · Feb 21, 2026

How does it compare to direct Python eval?

The mcp_safe_local_python_executor offers safer execution of Python code compared to direct use of Python eval.

Asked by Rosalind Frost · Feb 9, 2026

What security features are included?

The tool provides basic isolation and security by restricting file I/O operations and limiting imports, but it is not as secure as using a VM or Docker container.

Asked by Idris Suleiman · Jan 18, 2026

Is Docker required?

No, Docker is not required. This tool provides a custom Python runtime without needing Docker or a VM.

Asked by Yaw Owusu · Jan 8, 2026

提问

服务配缩器 的替代品