Commit e8fe23c
committed
feat(mcp): use aggressive MANDATORY instructions in initialize response
Change ServerInfo.instructions field from marketing copy to the aggressive
MANDATORY usage protocol (INITIAL_INSTRUCTIONS). This provides automatic
delivery of usage guidelines to MCP clients at connection time.
Why This Change:
- MCP prompts require manual user triggering (click + button in Claude Desktop)
- The 'instructions' field is the ONLY automatic delivery mechanism in MCP
- Per MCP spec, instructions "can be used by clients to improve the LLM's
understanding of available tools, potentially being added to system prompt"
- Client support varies, but it's the best pattern for automatic guidance
Impact:
- Instructions now sent automatically in every initialize response
- Clients that support serverInstructions will add to system prompt
- MCP prompt 'codegraph_initial_instructions' still available as fallback
- Tool 'read_initial_instructions' remains for explicit access
Verified:
- Build successful
- Initialize response contains full MANDATORY protocol
- Tested with: echo initialize | codegraph start stdio
References:
- MCP Lifecycle spec: instructions field in InitializeResult
- LibreChat pattern: serverInstructions configuration
- Client support: 20 of 58 MCP clients support prompts, fewer support
automatic instructions field, but this is still best practice1 parent fa89ea5 commit e8fe23c
1 file changed
+4
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
768 | | - | |
769 | | - | |
770 | | - | |
771 | | - | |
772 | | - | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
788 | 763 | | |
789 | 764 | | |
790 | 765 | | |
| |||
0 commit comments