refactor(mcp): trim model-facing instructions - #320
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe pull request updates MCP workspace fields and structured outputs to snake_case, adds explicit internal-to-wire mappings, awaits workspace lookups, updates server metadata and authorization wiring, and shortens Claude and Codex guidance. ChangesProtocol and tool-surface updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change standardizes MCP workspace fields and trims model guidance while retaining workspace validation, authorization, and live tool registration. No merge-blocking production risk is identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit maps each field, Comment |
Greptile SummaryThis PR trims model-facing MCP instructions while preserving the workspace, skill, artifact-transfer, and change-review workflows.
Confidence Score: 4/5The PR appears safe to merge after a non-blocking hardening improvement restores explicit unsandboxed-command disclosure on the Claude and Codex surfaces. The underlying command behavior is unchanged, but the revised descriptions obscure that workspace validation controls only the initial working directory and does not constrain command access to the host filesystem. Files Needing Attention: src/tool-surfaces/claude.ts, src/tool-surfaces/codex.ts
|
| Filename | Overview |
|---|---|
| src/server.ts | Condenses workspace lifecycle, skill-reading, artifact-transfer, and change-review instructions without changing handlers. |
| src/artifact-tools.ts | Simplifies artifact tool descriptions while retaining destination and runtime validation behavior. |
| src/tool-surfaces/claude.ts | Removes routing guidance but also drops the explicit disclosure that shell commands are not workspace-contained. |
| src/tool-surfaces/codex.ts | Simplifies patch and process descriptions but makes the unrestricted command boundary ambiguous. |
Reviews (1): Last reviewed commit: "refactor(mcp): simplify tool description..." | Re-trigger Greptile
| } | ||
|
|
||
| const CLAUDE_SHELL_DESCRIPTION = `Run a shell command with the local user's authority. Commands are not sandboxed; workspace validation only selects the initial working directory. Use this for file inspection, tests, builds, package scripts, and other commands.`; | ||
| const CLAUDE_SHELL_DESCRIPTION = "Run a shell command in a workspace with the user's local permissions."; |
There was a problem hiding this comment.
Shell containment is ambiguous
The shell descriptions now say commands run “in a workspace” but omit that only the initial working directory is validated. Both handlers execute unrestricted commands with the user’s local permissions, so a model may infer workspace containment and use absolute paths or parent traversal that modifies resources outside the workspace. Keep an explicit statement that shell execution is not sandboxed; the same issue appears in src/tool-surfaces/codex.ts:142.
How this was verified: Both command handlers validate the initial working directory but execute the raw command without restricting absolute paths, parent traversal, or access to other local resources.
f92aac8 to
fb09168
Compare
fb09168 to
7191afb
Compare
The MCP surface currently tells models to refer to the server by its product name and exposes execution/validation internals plus prescriptive tool-routing guidance. That can conflict with host-assigned connector names and unnecessarily constrain how capable hosts compose the tools.
This keeps the model-facing contract focused on workspace lifecycle, returned instructions and skills, artifact transfer, and change review while removing hard-coded branding, sandbox/validation details, shell-command prohibitions, and forced edit-tool routing.
Summary by CodeRabbit
snake_case, including workspace identifiers, references, source details, process information, timing, output, and patch paths.