Skip to content

feat(mcp): emit server-level instructions in initialize response#143

Merged
colbymchenry merged 1 commit into
mainfrom
feat/mcp-server-instructions
May 8, 2026
Merged

feat(mcp): emit server-level instructions in initialize response#143
colbymchenry merged 1 commit into
mainfrom
feat/mcp-server-instructions

Conversation

@colbymchenry
Copy link
Copy Markdown
Owner

Summary

  • New src/mcp/server-instructions.ts (~40 lines of guidance) wired into the initialize response so MCP clients surface it in the agent's system prompt automatically.
  • Scoped tight: references only the 9 tools that exist on main (search / context / callers / callees / impact / node / explore / files / status). No "(when present)" references to unmerged tools.

Salvaged from #121, which bundled the instructions with #117's tool-registry refactor and referenced many tools that don't exist on main.

Why this matters

Agents reach for codegraph_search then walk callers manually because that's the most general-sounding tool name. The playbook redirects "what would changing this break?" to codegraph_impact (one call instead of recursive caller-walks), and "what's the deal with this feature?" to codegraph_context (one round-trip instead of search+node).

Test plan

  • npx tsc --noEmit clean
  • npm test — 416/416 pass (no test changes — initialize response is structurally compatible)

🤖 Generated with Claude Code

Adds a universal tool-selection playbook surfaced by MCP clients
(Claude Code, Cursor, opencode, LangChain, OpenAI Agent SDK) in the
agent's system prompt automatically. Without this, agents have to
infer tool composition from individual tool descriptions and tend to
walk callers manually instead of reaching for codegraph_impact, etc.

Scoped tight: only the 9 tools that exist on main today
(search/context/callers/callees/impact/node/explore/files/status), no
"(when present)" references to unmerged tools, no per-language
guidance. ~40 lines of useful guidance.

Salvaged from #121, which bundled the instructions with #117's MCP
tool-registry refactor and referenced many tools that don't exist on
main.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@colbymchenry colbymchenry merged commit 804ab67 into main May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant