feat(mcp): a read-only server mode that hides and refuses writing tools - #69
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Sep 26, 2026
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
The owner chose this on 2026-09-24, from the survey of other BIM/CAD MCP servers (dwg-mcp has the same switch). It gives a review or inspection session a boundary that an agent cannot talk its way past.
The MCP server can now run read-only: start it with
--read-only, or setNAVISHELPER_MCP_READ_ONLY=1(ortrue). In that mode:tools/listshows only the 36 tools whoseToolCapabilitieseffects areNone(declared in feat(mcp): declare each tool's effects and requirements, with a generated table #68);read_only_modebefore any host is reached;mcp_health_checkreportsreadOnlyMode.The mode is strict: view-only tools (selection, camera, visibility) are hidden too, because they carry the
Vieweffect.With the mode off, nothing changes: all 104 tool names, descriptions and input schemas are byte-identical to
main's.McpReadOnlyModebuilds the name-to-effects map once at start-up by reflection. It registers a list-tools filter and a call-tool filter beside the existing validation and timing filters. Start-up fails if the attribute names ever drift from the registered tools.IsErrorwith a text block.read_only_modeis added toErrorCodesand to the contract thatmcp_error_contractreturns.## Read-only modesection indocs/MCP_TOOL_CONTRACTS.md, and a line indocs/MCP_CLIENT_GUIDE.md.Provenance
52ecd89: Codex (gpt-6-sol, high effort) wrote it from a 1.3 KB brief and a context file (626 s, main checkout untouched).Verification
The acceptance script ended
ALL PASSon the head, rerun by the curator. It checks:main(3c7d5ffc…);None, nothing else;create_viewpointis refused withread_only_mode;readOnlyModeis true when on and false when off;mcp_error_contractlists the new code;No plugin code changed.
🤖 Generated with Claude Code