Repository navigation
feat(core): one-shot probe for unapproved MCP servers and an unpinned launcher check - #777
Merged
Merged
Conversation
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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.
What
Fourth part of the first slice of #600:
tole_core::mcp::probe_manifest, a one-shot look at a server nobody approved yet, andtole_core::plugin_launcher::unpinned_launcher. Neither is wired to a command yet;tole plugin adduses them in the next part.Why
Probing an unvetted server through the shared reactor leaves its process (and a launcher's grandchildren) running for the life of the host, passes the
[secrets]release to code nobody approved, and can start it outside the sandbox.addneeds a probe that ends everything and starts only where the tier allows.Changes
probe_manifest(cfg, require_sandbox): a stdio server runs on its own thread and runtime, leads its own process group, and the whole group is killed on every exit path (returned, failed, timed out, panicked), before the server is reaped so the group id cannot be anyone else's. Empty secret grant (the scrub keeps nothing), stderr discarded, a launch that would run direct is refused before spawning when the sandbox is required. HTTP servers have no local process and use the reactor. Other platforms kill the server process only.unpinned_launcher(command, args):npx,bunx,pnpm dlx,uvx,pipx run,docker/podman runwithout an exact version or digest; an unknown flag is never guessed at.Testing
mcp_probe: tools returned; server and grandchild gone after success, after a server that dies (grandchild holds the pipes), and after a timeout; no secret in the server's environment; sandbox required with none configured does not spawn.killpg, no process group, or a keep-everything env scrub each failmcp_probe.cargo clippy -p tole-core --all-targets --features mcp -D warnings;tole-core --no-default-featuresbuilds.Refs #600