Skip to main content
Glama
611711Dark

mcp_python_exec_server

by 611711Dark

Python安全沙箱执行工具 (Python Safe Sandbox Execution Tool)

中文文档

功能描述

这是一个安全的Python代码执行工具,通过MCP服务器提供安全的执行环境。用户可以通过该工具执行Python代码片段,并获取执行结果。该工具禁用了危险的内置函数和模块,以防止恶意代码执行。

支持的标准库

  • math: 数学计算

  • statistics: 统计计算

  • decimal: 高精度小数

  • fractions: 分数运算

  • functools: 函数工具

  • random: 随机数生成

  • string: 字符串处理

  • time: 时间相关

  • datetime: 日期时间

  • json: JSON处理

  • re: 正则表达式

禁用功能

以下内置函数被禁用:

  • eval, exec, open, input, globals, locals

  • breakpoint, compile, delattr, setattr

  • exit, quit, help, memoryview, vars, dir

使用示例

调用该工具的MCP函数名为python_exec,参数为字符串类型的Python代码。

# 计算1+1
print(1+1)

返回结果:

输出:
2

如果定义了变量:

a = 10
b = 20
c = a + b
c

返回结果:

输出:
30

定义的变量/函数:
a = 10
b = 20
c = 30

注意事项

  1. 代码必须是字符串类型

  2. 代码不能为空

  3. 该工具不能执行文件操作、网络请求等危险操作

  4. 如果代码执行出错,将返回错误信息

F
license - not found
-
quality - not tested
F
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    -
    maintenance
    A secure server that enables code execution in isolated Docker environments, supporting Python with strict security constraints including network isolation, limited filesystem access, and resource limitations.
    Last updated
  • A
    license
    -
    quality
    F
    maintenance
    Enables LLM agents to execute arbitrary Python code in secure, isolated sandbox environments with automatic dependency management and file handling. Each code execution runs in a fresh virtual environment that gets destroyed after completion, providing safe and reproducible Python code execution.
    Last updated
    29
    MIT
  • -
    license
    -
    quality
    -
    maintenance
    Enables Python code execution in a sandboxed environment with virtual file system management and pip package installation capabilities.
    Last updated

View all related MCP servers

Related MCP Connectors

  • Execute code in 8 languages (Python, JS, TS, Go, Java, C++, C, Bash) in gVisor sandboxes.

  • Verify a skill, tool, or package for malicious behavior before your agent installs it. Hosted.

  • Operate your Linux servers from your LLM. Every action runs through an auditable allowlist.

View all MCP Connectors

Latest Blog Posts

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/611711Dark/mcp_python_exec_server'

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