agent-env-mcp
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_environmentlist_directoryread_filesearch_workspaceworkspace_editrun_commandgit_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 服务器后:
ensure_environment使用
path: "."执行list_directory对已知项目文件执行
read_file对已知符号/文本执行
search_workspace使用
program: "pwd"执行run_command使用
args: ["status", "--short"]执行git_command
预期的边界失败:
read_file("../../anything")绝对路径
Windows 路径
直接读取
.git使用
bash执行run_command使用
docker执行run_command使用
git执行run_command
迁移
在新运行时得到验证后:
移除项目拥有的
.devcontainer。从 Software Engineer 中移除通用的 VS Code
execute、read、edit和search。对于严格的仅容器读取边界,还要移除检查
agent-env之外源代码的 VS Code C/C++ 语义工具。为 GitHub Operator 提供
agent-env/git_command用于本地 Git。将远程 GitHub 操作保留在 GitHub MCP 中。
运行时基线
包含的 Dockerfile 使用 Node 24 LTS、C/C++ 构建工具、Python、PlatformIO 6.1.19、Git 和 ripgrep。运行时配置文件可以在以后拆分出来,而不会改变信任模型。
This server cannot be installed
Maintenance
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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