Repository navigation
feat(microsandbox): run the MCP runner inside the sandbox, switched from the web app - #632
Merged
Merged
Conversation
…rom the web app In a microsandbox install the MCP runner is a process inside the sandbox rather than a container: as a user of its own, mcp, with the volume that holds the database and the archive closed to it (mode 750), Node and uv through read-only bind mounts, on the sandbox's localhost only. The upgrade agent's services switch adds mcp to COMPOSE_PROFILES in .env and nothing else there; the sandbox reads .env every few seconds and starts or stops the runner to match (microsandbox/mcp.sh, test-mcp.sh). The runner stops its servers on SIGTERM and takes LENS_MCP_BIND. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CsyA2Kuhsnhzz2HjkD3zED
…th the microsandbox variant Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CsyA2Kuhsnhzz2HjkD3zED
21 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: on a microsandbox install, the Run the MCP runner on this machine switch failed with "mcp runs in Docker; this install runs in a microsandbox", so MCP servers that run as a program (npx, uvx) couldn't be used there.
After: the same switch works. The runner is a process inside the sandbox rather than a container, as a user of its own (
mcp) with the volume that holds the database and the archive closed to it (mode 750, lens's alone), Node and uv reached through read-only bind mounts, listening on the sandbox's localhost only. The upgrade agent addsmcptoCOMPOSE_PROFILESin.envand nothing else there; the sandbox reads.envevery few seconds and starts or stops the runner to match, starting it again if it stops. Without an agent, the switch shows the.envline to write instead of a Docker line.How:
microsandbox/mcp.sh(sourced by run.sh) holds the user and folder setup, the bind mounts and the loop; the agent'sservicesaction takes the microsandbox branch formcponly; the runner takesLENS_MCP_BINDand stops its servers on SIGTERM; run.sh also keepsuvxnext touvfor servers from PyPI.Motivation and Context
Follows #304 (the runner, Docker only) and #506 (the switch). Adeel's rule: every setting in the web app, on Docker and microsandbox alike.
Steps to reproduce (if appropriate):
microsandbox/test-mcp.sh(run in the sandbox's image) checks the loop: starts asmcponce.envnames the profile, with the volume closed to it; started again after it stops; stopped when the profile goes; and the real runner answering on localhost with its token where Lens reads it, 401 without the token.packaging/host/test-services.shcase 9: in a microsandbox the agent changes.envonly and runs no Docker.mcp, thatmcpcan't list/data, lists the tools of@modelcontextprotocol/server-memorythrough Lens's own client, and switches it off.tests/api/test_services.py: the line shown without an agent in a microsandbox.Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
PUT /api/v1/admin/services/mcpand MCPset_service..envedit or reinstall.COMPOSE_PROFILESas before.mcp.list/mcp.callin the ledger as before.Generated by Claude Code