MCP for sandboxed, reproducible envs for agentic-first coding workflows(github.com)
github.com
MCP for sandboxed, reproducible envs for agentic-first coding workflows
https://github.com/aniongithub/devcontainer-mcp
5 comments
Thanks! You're right, the idea is obvious in hindsight. The hard part was finding something that works generically across environments. The devcontainer spec turned out to be that standard. It's already adopted by VS Code, GitHub Codespaces, DevPod, and a growing list of tools, so you get a portable definition for free.
On the multi-environment point, devcontainer-mcp already supports this. An agent can spin up multiple workspaces simultaneously (local Docker, DevPod, Codespaces) and work across them in the same session. Each workspace is just another set of tool calls with a different handle. Nothing stops you from having a frontend container and a backend container running at the same time.
On the diff format / apply-patch point, that's a real concern. I went with surgical string replacement (old_str → new_str) for file edits inside containers because it's model-agnostic. No diff format to get wrong, no patch that fails to apply. It's less clever but it works reliably across models.
On the multi-environment point, devcontainer-mcp already supports this. An agent can spin up multiple workspaces simultaneously (local Docker, DevPod, Codespaces) and work across them in the same session. Each workspace is just another set of tool calls with a different handle. Nothing stops you from having a frontend container and a backend container running at the same time.
On the diff format / apply-patch point, that's a real concern. I went with surgical string replacement (old_str → new_str) for file edits inside containers because it's model-agnostic. No diff format to get wrong, no patch that fails to apply. It's less clever but it works reliably across models.
In theory, it should be possible (trivial, even) to simultaneously connect multiple folders to a single session (as to mirror a more complex workspace). However, I haven't really seen any coding agent that can connect to multiple environments yet.
As far as I'm informed the complexity doing this is a little bit higher than just giving it read and write tools, if I understand correctly, modern harnesses are a little bit more optimized per model (diff formats, see "apply patch").