Daytona MCP 解释器
模型上下文协议服务器在临时 Daytona 沙箱中提供 Python 代码执行功能。
概述
Daytona MCP 解释器使 Claude 等 AI 助手能够在安全、隔离的环境中执行 Python 代码和 Shell 命令。它实现了模型上下文协议 (MCP) 标准,可提供以下工具:
- 沙盒环境中的 Python 代码执行
- Shell命令执行
- 文件管理(上传/下载)
- Git 存储库克隆
- 为正在运行的服务器生成 Web 预览
所有执行都发生在临时的 Daytona 工作区中,使用后会自动清理。
安装
- 如果尚未安装 uv,请安装:
- 创建并激活虚拟环境。
如果您有现有的环境,请先停用并删除它:
创建并激活新的虚拟环境:
(在 Windows 上: .venv\Scripts\activate
)
- 安装依赖项:
注意:本项目需要 daytona-sdk 0.10.5 或更高版本。早期版本的 FileSystem API 不兼容。
环境变量
配置以下环境变量以确保正常运行:
MCP_DAYTONA_API_KEY
:Daytona 身份验证所需的 API 密钥MCP_DAYTONA_SERVER_URL
:服务器 URL(默认值: https://app.daytona.io/api )MCP_DAYTONA_TIMEOUT
:请求超时时间(秒)(默认值:180.0)MCP_DAYTONA_TARGET
:目标区域(默认值:欧盟)MCP_VERIFY_SSL
:启用 SSL 验证(默认值:false)
发展
直接运行服务器:
或者如果 uv 不在你的路径中:
使用 MCP Inspector 测试服务器:
查看日志:
与 Claude Desktop 集成
- 在 Claude Desktop(或其他 MCP 兼容客户端)中配置:
在 MacOS 上,编辑: ~/Library/Application Support/Claude/claude_desktop_config.json
在 Windows 上,编辑: %APPDATA%\Claude\claude_desktop_config.json
- 重启Claude桌面
- Daytona Python 解释器工具将在 Claude 中提供
可用工具
Shell 执行程序
在 Daytona 工作区中执行 shell 命令。
文件下载
从 Daytona 工作区下载文件,并对大文件进行智能处理。
基本用法:
高级用法:
文件上传
将文件上传到 Daytona 工作区。支持文本和二进制文件。
基本用法:
高级用法:
Git 克隆
将 Git 存储库克隆到 Daytona 工作区进行分析和代码执行。
基本用法:
高级用法:
网页预览
为 Daytona 工作区内运行的 Web 服务器生成预览 URL。
基本用法:
高级用法:
例子:
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
模型上下文协议服务器允许在 Daytona 工作区内执行 Python 代码,为执行和管理 Python 脚本提供安全且隔离的环境。
Related Resources
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server that allows management and execution of Blender Python scripts, enabling users to create, edit and run scripts in a headless Blender environment through natural language interfaces.Last updated -4Python
- -securityAlicense-qualityA Model Context Protocol server that extracts and analyzes Python code structures, focusing on import/export relationships between files to help LLMs understand code context.Last updated -4PythonMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables seamless execution of commands, Python code, web content fetching, and reusable task management with secure credentials handling.Last updated -2PythonMIT License
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.Last updated -1Python