Repository navigation
Trim MCP server instructions and search/execute tool descriptions - #779
Conversation
Deduplicate the MCP instruction surface per the documented principles in docs/contributing/documentation.md and mcp-server-patterns.md: - Server instructions no longer restate the search/execute tool descriptions, the per-capability job/session/service catalog (all discoverable via search), or the conversationId/memoryContext schema docs. The package lifecycle model, authoring lanes, credential rules, and guide pointers remain. - The search description drops authoring-lane and integration-bootstrap guidance now stated once in the server instructions. - The execute description keeps the full sandbox surface, gains the namespaced kody.remote/kody.mcp/kody.openapi accessor rule previously only in server instructions, and drops duplicated credential and bootstrap paragraphs. - Remove the now-unused conversationIdGuidance and repoRunCommandsExecuteSummary exports. Baseline static text shrinks from ~21.6k to ~11.3k chars (-48%). Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughMCP server instructions, tool descriptions, and capability domain descriptions were revised. The obsolete ChangesMCP guidance updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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. Comment |
|
🔎 Preview deployed: https://kody-pr-779.kody-a99.workers.dev Worker: Mocks:
|
Domain descriptions render into the per-session server instructions domain list. Trim the nine verbose ones (integrations, openapi, admin, community, mcp_servers, packages, meta, secrets, coding) by dropping operational detail that already lives on the individual capability descriptions or in the server-instruction conventions, keeping the scope and safety framing of each group. Builtin domain description text shrinks from ~4.0k to ~2.8k chars. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/worker/src/mcp/capabilities/secrets/domain.ts`:
- Line 11: Update the capability description in the domain definition to
explicitly prohibit requesting or accepting raw secrets in chat, including
tokens, passwords, and API keys, while preserving the existing safeguards for
prompts, execution results, and package source.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 19dc2c7f-73b6-4603-ae04-0b68250b7baf
📒 Files selected for processing (9)
packages/worker/src/mcp/capabilities/admin/domain.tspackages/worker/src/mcp/capabilities/coding/domain.tspackages/worker/src/mcp/capabilities/community/domain.tspackages/worker/src/mcp/capabilities/integrations/domain.tspackages/worker/src/mcp/capabilities/mcp-servers/domain.tspackages/worker/src/mcp/capabilities/meta/domain.tspackages/worker/src/mcp/capabilities/openapi/domain.tspackages/worker/src/mcp/capabilities/packages/domain.tspackages/worker/src/mcp/capabilities/secrets/domain.ts
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
The MCP instruction surface had grown to ~21.6k chars (~5.4k tokens) of static text injected into every MCP session, with heavy duplication across the server instructions, the two tool descriptions, and the schema field docs. This deduplicates it per the repo's own principles in
docs/contributing/documentation.md("MCP instructions and tool descriptions stay tight") anddocs/contributing/mcp-server-patterns.md("server instructions should not repeat tool descriptions or tool argument docs").What changed
Server instructions (
server-instructions.ts, 12.2k → 4.2k chars, −66%):search/executemini-doc sections that restated the tool descriptions (one literally said "see theexecutetool description").job_*,package_*,session_*,service_*,workflow_run_list) — those are individual capabilities whose descriptions and exact call shapes surface throughsearch; enumerating them in static text undermined the progressive-disclosure design. Replaced with one line pointing atsearch.conversationId/memoryContextparagraphs (verbatim duplicates of the schema field descriptions on both tools) with a one-line cross-tool convention.package_lifecycleguide for the full treatment), authoring lanes, credential/secret rules, integration-bootstrap workflow, memory verify-first rule, overlay note, friction guide pointer, and the generated domains/connectors/overlay sections.searchdescription (3.1k → 1.9k chars, −38%):value_get/integration_getusage notes (entity detail supplies exact call shapes).executedescription (6.3k → 5.2k chars, −18%):kody:runtimesandbox surface — it exists nowhere else in-band.kody.remote[...]/kody.mcp[...]/kody.openapi[...], never a flat call), which previously lived only in the server instructions.packageshelper bullet.Builtin domain descriptions (4.0k → 2.8k chars, −31%): trimmed the nine verbose entries (
integrations,openapi,admin,community,mcp_servers,packages,meta,secrets,coding), dropping operational detail that already lives on the individual capability descriptions or in the server-instruction conventions. Domain descriptions only surface in the server-instructions domain list — capability search indexes capability-level fields (name, domain id, description, keywords), not domain descriptions — so ranking is unaffected.Dead code: removed the now-unused
conversationIdGuidanceandrepoRunCommandsExecuteSummaryexports.Total baseline static text: 21.6k → 10.1k chars (roughly −53%), before per-user domains, connectors, and overlays are appended.
What was deliberately preserved
Every behavioral rule still appears exactly once somewhere in-band: secrets-never-in-chat, verify-first memory writes, smoke-test-before-shipping auth-dependent work, escalation signals, projection rule, placeholder safety, and the authoring lanes. Content removed outright (e.g. per-job-tool docs) remains discoverable through
searchentity detail and thecoding_guide_getguides.System recap — extends a primitive's contract (medium risk)
Mode: recap · Base:
main@182a1903· Head:a4fd21a3Classification: extends — the MCP endpoint's instruction/description contract text changes; no primitives added, no runtime behavior changed.
Primitives touched
mcp-servercapability-registrySystem map
The change is confined to the static text the MCP endpoint serves at connect time; capability behavior, registries, and search ranking are untouched.
Legend: green = composes (wiring only) · amber = extended by this PR · red = new primitive · gray = context (unchanged, included only when an edge crosses it).
Before / after
searchdescriptionexecutedescriptionSummary by CodeRabbit
executeandsearchtool descriptions, including sandbox-access rules, package ID formats, hidden packages behavior, and that secret searches return metadata only (not secret values).