远程文件系统访问服务

Azure开发服务器为Claude Desktop提供远程文件系统和Shell访问功能,支持读取、写入、编辑、搜索和执行命令。

  • by david3xu
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 david3xu/azure-dev-server

使用说明

⚠️ 已弃用 --此存储库已合并到 datacore monorepo packages/dev-server。此仓库已存档,不再维护。 所有未来的开发都发生在monorepo中。

azure开发服务器

远程MCP服务器,通过HTTPS为Claude Desktop提供完整的文件系统和shell访问权限——一个托管在云上的服务器 桌面指挥官 在Azure容器应用程序上运行。

它的作用

公开8个MCP工具,以便Claude Desktop可以在远程计算机上读取、写入、编辑、搜索和运行命令:

工具 说明
ping 健康检查
read_file 读取带有行号的文件
write_file 写入或附加到文件
edit_file 手术发现和更换(单次发生)
search_files 使用可选的文件模式遍历目录
list_directory 列出具有递归深度的文件/dir
run_command 执行shell命令,返回stdout/stderr
get_file_info 文件元数据(大小、类型、修改时间)

为什么它存在

Claude Desktop的内置Desktop Commander仅在本地工作。此项目为Claude Desktop在远程Azure机器上提供了相同的功能,当工作区位于云中或需要在设备之间共享时非常有用。

快速入门(本地)

git clone https://github.com/david3xu/azure-dev-server.git
cd azure-dev-server
pnpm install
pnpm run build
MCP_API_KEY=your-key WORKSPACE=/path/to/your/workspace pnpm start

健康检查:

curl http://localhost:3001/health

连接到实时实例

服务器运行在:

https://ca-dev-server.purplegrass-77b8c839.australiaeast.azurecontainerapps.io

光标

增添 ~/.cursor/mcp.json:

{
  "mcpServers": {
    "azure-dev": {
      "url": "https://ca-dev-server.purplegrass-77b8c839.australiaeast.azurecontainerapps.io/mcp",
      "headers": {
        "x-api-key": "<your-api-key>"
      }
    }
  }
}

重新加载窗口(Cmd+Shift+P → “重新加载窗口”)——MCP面板中显示8个工具。

VSCode+GitHub副本

增添 .vscode/mcp.json (每个工作区)或用户 settings.json:

{
  "mcp": {
    "servers": {
      "azure-dev": {
        "type": "http",
        "url": "https://ca-dev-server.purplegrass-77b8c839.australiaeast.azurecontainerapps.io/mcp",
        "headers": {
          "x-api-key": "<your-api-key>"
        }
      }
    }
  }
}

克劳德桌面版

Claude Desktop仅支持stdio传输,因此请使用 mcp遥控器 作为HTTP网桥。

创建 ~/Library/Application Support/Claude/azure-dev-mcp-bridge.sh:

#!/bin/zsh
set -euo pipefail

exec /opt/homebrew/bin/npx -y mcp-remote \
  "https://ca-dev-server.purplegrass-77b8c839.australiaeast.azurecontainerapps.io/mcp" \
  --transport http-first \
  --header "x-api-key:<your-api-key>"

然后添加到 ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "azure-dev": {
      "command": "/bin/zsh",
      "args": ["/Users/<you>/Library/Application Support/Claude/azure-dev-mcp-bridge.sh"]
    }
  }
}

重新启动克劳德桌面(Cmd+Q,重新开放)。

终端(集装箱内的交互式外壳)

需要 Azure命令行界面.

步骤1 --将别名添加到您的shell配置文件中(一次):

echo "alias azure-dev-shell='az containerapp exec \\
  --name ca-dev-server \\
  --resource-group rg-datacore \\
  --command bash'" >> ~/.zshrc

步骤2 --将其加载到当前终端:

source ~/.zshrc

步骤3 --连接:

azure-dev-shell

你会看到 INFO: Successfully connected to container: 'ca-dev-server' 以及shell提示符。

容器内提示:

  • clear 不可用--使用 Ctrl+L 而
  • 提示可能显示 sh-5.2# --奔跑 bash 切换到完整的Bash会话
  • /workspace 是Azure文件装载吗?在此处写入的文件在重新启动后仍然存在
  • 退出 Ctrl+D

验证连接

通过任何客户端连接后,按顺序运行这些工具:

  1. ping --应该回来 "alive — workspace: /workspace"
  2. list_directory 和 path: "/" --列出工作区根目录
  3. write_file 然后 read_file --确认读/写访问

环境变量

变量 必填 默认 描述
MCP_API_KEY 是的 dev-key-change-me 发送了API密钥 x-api-key 头球
WORKSPACE 没有 process.cwd() 所有文件操作的根目录
PORT 没有 3001 HTTP端口

部署到Azure容器应用程序

需要Azure CLI。不需要本地Docker——镜像是在云中构建的:

# One-time setup
az group create --name rg-datacore --location australiaeast
az acr create --name acrdevserver --resource-group rg-datacore --sku Basic --admin-enabled true
az containerapp env create --name cae-dev-server --resource-group rg-datacore --location australiaeast

# Build + deploy
az acr build --registry acrdevserver --image azure-dev-server:latest --file Dockerfile .

ACR_PASS=$(az acr credential show --name acrdevserver --query "passwords[0].value" -o tsv)
az containerapp create \
  --name ca-dev-server \
  --resource-group rg-datacore \
  --environment cae-dev-server \
  --image acrdevserver.azurecr.io/azure-dev-server:latest \
  --registry-server acrdevserver.azurecr.io \
  --registry-username acrdevserver \
  --registry-password "$ACR_PASS" \
  --target-port 3001 --ingress external \
  --min-replicas 1 --max-replicas 3 \
  --cpu 0.5 --memory 1.0Gi \
  --env-vars "MCP_API_KEY=<your-key>" "NODE_ENV=production" "PORT=3001" "WORKSPACE=/workspace"

代码更改后重新部署:

az acr build --registry acrdevserver --image azure-dev-server:latest --file Dockerfile .
az containerapp update --name ca-dev-server --resource-group rg-datacore \
  --image acrdevserver.azurecr.io/azure-dev-server:latest

发展

pnpm run check      # format + lint + type-check + build + test (all layers)
pnpm run test       # tests only
pnpm run format     # auto-format src/ and tests/

所有7个约束层均处于活动状态:CI→ 预提交挂钩→ ESLint→ TypeScript严格→ 测试→ 更漂亮→ Zod模式。

技术栈

许可证

麻省理工学院