Repository navigation
feat: read-only MCP server (Phase 4) - #56
Merged
Merged
Conversation
…s on SIGTERM and session end
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.
Summary
Phase 4:
permesh mcp, a local, read-only MCP server over stdio (protocol 2026-07-28 only), built on the official Rust SDK (rmcp3.7,server+transport-io).Closed tool list mapping onto existing commands:
doctordoctoruser_accessuserresource_accessresourceadminsadminsorphanedorphanedprofile_checkprofile checkplan_join,plan_move,plan_leaveaccess join,access move,access leaveverify_planaccess verifypermesh --jsonargv parsed by the normal CLI parser and run byapp::run, so it uses the same workspace, approvals and credentials as the CLI.check,snapshot save,identity map,auth,provider,init,offboardandaccess reviewcan't be reached.Results carry
exit_code, the CLI's--jsonreport, and anotewhen the capture is incomplete. Exit codes 4 and 6 are answers, not tool errors.Paths are confined to the workspace folder: no absolute paths, no
..escapes, no symlinks pointing out. Values are passed as--name=valueand positionals after--, so data never becomes a flag.Plan outputs are new
.jsonfiles only, never insidepeople/,profiles/or hidden folders, and never overwritten.Shutdown and cancellation: calls run one at a time. Cancelling a call, closing stdin, Ctrl+C or SIGTERM drains a running call, so provider processes are stopped and reaped before exit.
Docs: ADR 0035,
docs/mcp.md, plus README, CHANGELOG,docs/README.mdanddocs/stability.mdupdates.permesh mcpis experimental.Validation
cargo test --workspace: 701 passed, 0 failed.tests/mcp.rshas 24 end-to-end stdio tests, including cancellation, SIGTERM and EOF tests with a native provider that hangs in discovery.cargo clippy --workspace --all-targets -- -D warnings,cargo fmt --check,cargo deny checkandscripts/check_docs.pyare clean.Deferred minors
profiles/removearray gets a generic "Invalid tool arguments".complete; it isreport.complete, on successful results only.docs/mcp.md's "not available" list isn't exhaustive.