feat(mcp): expose server instructions from InitializeResult on MCPClient#1814
Merged
poshinchen merged 1 commit intostrands-agents:mainfrom Mar 6, 2026
Merged
Conversation
dbschmigelski
requested changes
Mar 5, 2026
|
Assessment: Comment This is a well-scoped, minimal change that exposes MCP server instructions to Host applications - aligning with the MCP specification. The implementation is clean and tests are included. Review Summary
Small, focused feature addition. Once the requested changes are addressed, this looks good to merge. |
d2c0cf3 to
048cc27
Compare
048cc27 to
583ded4
Compare
Store InitializeResult.instructions on MCPClient.server_instructions so Host applications can access MCP server instructions and inject them into the LLM's system prompt. The MCP specification defines instructions as a way for servers to provide LLMs with contextual knowledge about tool interdependencies and operational constraints. Clients like Claude Code and VSCode already support this feature. Closes strands-agents#1813
583ded4 to
ba91fba
Compare
dbschmigelski
approved these changes
Mar 6, 2026
|
Assessment: Approve ✅ The requested changes have been addressed:
Clean implementation that aligns with the MCP specification. Ready to merge. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
poshinchen
approved these changes
Mar 6, 2026
mehtarac
approved these changes
Mar 6, 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.
Description
Store
InitializeResult.instructionsonMCPClient.server_instructionsso Host applications can access MCP server instructions and inject them into the LLM's system prompt.The MCP specification defines
instructionsinInitializeResultfor servers to provide LLMs with contextual knowledge about tool interdependencies and operational constraints. CurrentlyMCPClientdiscards theInitializeResult, making instructions inaccessible to Host applications.Changes:
mcp_client.py: Storeinit_result.instructionsaftersession.initialize()(3 lines added)conftest.py: Fix mock to return properInitializeResultwithinstructionsfieldtest_mcp_client.py: Add 2 tests (default empty string, populated from server)The SDK's responsibility is only to make the data accessible — how/whether to inject into the system prompt remains the Host's decision.
Related Issues
Closes #1813
Documentation PR
N/A — Public attribute
server_instructionsis self-documenting. Docs update can follow if needed.Type of Change
New feature
Testing
apacvsus)Checklist