Skip to main content
Glama

agent-env-mcp

一个宿主端 MCP 控制器,拥有一个可复用的 Linux 开发运行时,并向编码代理暴露一个狭窄的、项目范围的 workspace/工具边界。

信任边界

  • MCP 进程在宿主上运行,因为它必须控制 Docker。

  • 模型永远不会获得宿主文件系统工具或任意宿主命令工具。

  • VS Code 在 MCP 启动时通过 AGENT_HOST_WORKSPACE 传递当前打开的 workspace。

  • 该 workspace 被 bind-mount 到代理拥有的运行时中的 /agent-env/environment/<project-slug>

  • 文件读取、搜索、编辑、本地 Git、构建、测试以及其他命令执行都发生在 Linux agent 容器内。

  • 该运行时没有 Docker socket,也没有 GitHub 凭据挂载。

  • Compose 和 Dockerfile 由本仓库拥有,而非应用程序仓库。

暴露的工具

  • ensure_environment

  • list_directory

  • read_file

  • search_workspace

  • workspace_edit

  • run_command

  • git_command

run_command 使用结构化的 program + args 执行,不经过 shell,并拒绝直接使用 Git。git_command 专为 GitHub Operator 设计,禁用仓库钩子/签名,并且只允许本地 Git 子命令白名单;网络 Git 操作被有意排除在外。

安装

cd D:\mcp\agent-env-mcp
npm install

使用 mcp.json.example 将服务器添加到 VS Code 用户 MCP 配置中。

重要的设置是:

"env": {
  "AGENT_HOST_WORKSPACE": "${workspaceFolder}"
}

MCP 服务器启动后,模型无法选择不同的宿主 workspace。

验证

重启 MCP 服务器后:

  1. ensure_environment

  2. 使用 path: "." 执行 list_directory

  3. 对已知项目文件执行 read_file

  4. 对已知符号/文本执行 search_workspace

  5. 使用 program: "pwd" 执行 run_command

  6. 使用 args: ["status", "--short"] 执行 git_command

预期的边界失败:

  • read_file("../../anything")

  • 绝对路径

  • Windows 路径

  • 直接读取 .git

  • 使用 bash 执行 run_command

  • 使用 docker 执行 run_command

  • 使用 git 执行 run_command

迁移

在新运行时得到验证后:

  1. 移除项目拥有的 .devcontainer

  2. 从 Software Engineer 中移除通用的 VS Code executereadeditsearch

  3. 对于严格的仅容器读取边界,还要移除检查 agent-env 之外源代码的 VS Code C/C++ 语义工具。

  4. 为 GitHub Operator 提供 agent-env/git_command 用于本地 Git。

  5. 将远程 GitHub 操作保留在 GitHub MCP 中。

运行时基线

包含的 Dockerfile 使用 Node 24 LTS、C/C++ 构建工具、Python、PlatformIO 6.1.19、Git 和 ripgrep。运行时配置文件可以在以后拆分出来,而不会改变信任模型。

-
license - not tested
Not graded
quality - not tested
C
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 Connectors

  • Git-backed platform for skills, tools, and context for AI agents

  • Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.

  • Securely search and manage workspace context files for AI agents and teams.

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/brycepelletier/agent-env-mcp'

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