Token导航 LogoToken导航TokenDH.com
Daytona MCP Interpreter logo
AI代理stdio官方级别未说明来源级核验

Daytona MCP Interpreter

MCP Server

Daytona MCP Interpreter是一个提供Python代码执行能力的模型上下文协议服务器,可在临时Daytona沙箱中安全运行代码。

工具数

0

提示词数

0

GitHub Stars

22

资源数

0
PythonClaudeAI代理Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

nibzard

提供方

nibzard

最后核验

2026/5/17 20:19

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uv run src/daytona_mcp_interpreter/server.py

详细介绍

Daytona MCP口译员

一个模型上下文协议服务器,在短暂的Daytona沙盒中提供Python代码执行功能。

Daytona MCP Server in Claude Desktop

概述

Daytona MCP解释器使Claude等AI助手能够在安全、隔离的环境中执行Python代码和shell命令。它实现了模型上下文协议(MCP)标准,为以下方面提供了工具:

  • 沙盒环境中的Python代码执行
  • Shell命令执行
  • 文件管理(上传/下载)
  • Git存储库克隆
  • 为正在运行的服务器生成Web预览

所有执行都发生在临时Daytona工作区中,这些工作区在使用后会自动清理。

安装

  1. 如果您还没有安装uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. 创建并激活虚拟环境。

如果您有一个现有的env,请先停用并删除它:

deactivate
rm -rf .venv

创建并激活新的虚拟环境:

uv venv
source .venv/bin/activate

(在Windows上: .venv\Scripts\activate)

  1. 安装依赖项:
uv add "mcp[cli]" pydantic python-dotenv "daytona-sdk>=0.10.5"
注意:此项目需要daytona-sdk 0.10.5或更高版本。早期版本具有不兼容的FileSystem API。

环境变量

配置这些环境变量以确保正常运行:

  • MCP_DAYTONA_API_KEY:代托纳身份验证所需的API密钥
  • MCP_DAYTONA_SERVER_URL:服务器URL(默认值:https://app.daytona.io/api)
  • MCP_DAYTONA_TIMEOUT:请求超时(秒)(默认值:180.0)
  • MCP_DAYTONA_TARGET:目标区域(默认值:eu)
  • MCP_VERIFY_SSL:启用SSL验证(默认值:false)

发展

直接运行服务器:

uv run src/daytona_mcp_interpreter/server.py

或者,如果紫外线不在你的路径上:

/Users/USER/.local/bin/uv run ~LOCATION/daytona-mcp-interpreter/src/daytona_mcp_interpreter/server.py

使用MCP检查器测试服务器:

npx @modelcontextprotocol/inspector \
  uv \
  --directory . \
  run \
  src/daytona_mcp_interpreter/server.py

查看日志:

tail -f /tmp/daytona-interpreter.log

与Claude Desktop集成

![Watch the demo video](https://youtu.be/26m2MjY8a5c)

  1. 在Claude Desktop(或其他MCP兼容客户端)中配置:

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

{
    "mcpServers": {
        "daytona-interpreter": {
            "command": "/Users/USER/.local/bin/uv",
            "args": [
                "--directory",
                "/Users/USER/dev/daytona-mcp-interpreter",
                "run",
                "src/daytona_mcp_interpreter/server.py"
            ],
            "env": {
                "PYTHONUNBUFFERED": "1",
                "MCP_DAYTONA_API_KEY": "api_key",
                "MCP_DAYTONA_SERVER_URL": "api_server_url",
                "MCP_DAYTONA_TIMEOUT": "30.0",
                "MCP_VERIFY_SSL": "false",
                "PATH": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
            }
        }
    }
}
  1. 重新启动克劳德桌面
  2. Daytona Python解释器工具将在Claude中提供

可用工具

壳牌高管

在Daytona工作区中执行shell命令。

# Example: List files
ls -la

# Example: Install a package
pip install pandas

文件下载

通过智能处理大型文件,从Daytona工作区下载文件。

基本用法:

file_download(file_path="/path/to/file.txt")

高级用法:

# Set custom file size limit
file_download(file_path="/path/to/large_file.csv", max_size_mb=10.0)

# Download partial content for large files
file_download(file_path="/path/to/large_file.csv", download_option="download_partial", chunk_size_kb=200)

# Convert large file to text
file_download(file_path="/path/to/large_file.pdf", download_option="convert_to_text")

# Compress file before downloading
file_download(file_path="/path/to/large_file.bin", download_option="compress_file")

# Force download despite size
file_download(file_path="/path/to/large_file.zip", download_option="force_download")

文件上传

将文件上传到Daytona工作区。支持文本和二进制文件。

基本用法:

# Upload a text file
file_upload(file_path="/workspace/example.txt", content="Hello, World!")

高级用法:

# Upload a text file with specific path
file_upload(
    file_path="/workspace/data/config.json",
    content='{"setting": "value", "enabled": true}'
)

# Upload a binary file using base64 encoding
import base64
with open("local_image.png", "rb") as f:
    base64_content = base64.b64encode(f.read()).decode('utf-8')

file_upload(
    file_path="/workspace/images/uploaded.png",
    content=base64_content,
    encoding="base64"
)

# Upload without overwriting existing files
file_upload(
    file_path="/workspace/important.txt",
    content="New content",
    overwrite=False
)

克隆

将Git存储库克隆到Daytona工作区进行分析和代码执行。

基本用法:

git_clone(repo_url="https://github.com/username/repository.git")

高级用法:

# Clone a specific branch
git_clone(
    repo_url="https://github.com/username/repository.git",
    branch="develop"
)

# Clone to a specific directory with full history
git_clone(
    repo_url="https://github.com/username/repository.git",
    target_path="my_project",
    depth=0  # 0 means full history
)

# Clone with Git LFS support for repositories with large files
git_clone(
    repo_url="https://github.com/username/large-files-repo.git",
    lfs=True
)

Web预览

为Daytona工作区内运行的web服务器生成预览URL。

基本用法:

# Generate a preview link for a web server running on port 3000
web_preview(port=3000)

高级用法:

# Generate a preview link with a descriptive name
web_preview(
    port=8080,
    description="React Development Server"
)

# Generate a link without checking if server is running
web_preview(
    port=5000,
    check_server=False
)

例子:

# First run a simple web server using Python via the shell
shell_exec(command="python -m http.server 8000 &")

# Then generate a preview link for the server
web_preview(port=8000, description="Python HTTP Server")

](https://smithery.ai/server/@nkkko/daytona-mcp)

目录标签

目录标签

PythonClaudeAI代理Python执行本地部署沙箱环境代码隔离AI助手集成文件管理

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP