feat(kagent-adk): expose MCP prompts and resources#1506
Open
jsonmp-k8 wants to merge 1 commit intokagent-dev:mainfrom
Open
feat(kagent-adk): expose MCP prompts and resources#1506jsonmp-k8 wants to merge 1 commit intokagent-dev:mainfrom
jsonmp-k8 wants to merge 1 commit intokagent-dev:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Exposes MCP server prompts and resources to kagent-adk declarative Python agents by adding server-specific helper tools that can load prompt/resource contents into the next model turn.
Changes:
- Extend
KAgentMcpToolsetto discover MCP prompt/resource capabilities and append corresponding helper tools. - Add capability loader tools to fetch MCP prompt/resource catalogs and inject selected contents into the LLM request.
- Add focused unit tests covering helper discovery, unique helper naming per server, and prompt/resource loading behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
python/packages/kagent-adk/src/kagent/adk/_mcp_toolset.py |
Adds MCP prompt/resource APIs plus helper-tool creation and unique per-server helper naming. |
python/packages/kagent-adk/src/kagent/adk/_mcp_capability_tools.py |
Implements helper tools that list available prompts/resources and inject selected content into the next model turn. |
python/packages/kagent-adk/src/kagent/adk/_constants.py |
Centralizes the proxy host header constant. |
python/packages/kagent-adk/src/kagent/adk/types.py |
Switches to importing PROXY_HOST_HEADER from _constants.py. |
python/packages/kagent-adk/tests/unittests/test_mcp_capability_tools.py |
Adds unit tests for helper discovery and prompt/resource loading behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
055e603 to
6b923f6
Compare
Expose MCP server prompts and resources to kagent-adk declarative Python agents via server-specific helper tools that inject loaded prompt/resource contents into the next model turn. - Extend KAgentMcpToolset to discover MCP prompt/resource capabilities and append corresponding helper tools during get_tools() - Add capability loader tools that fetch MCP prompt/resource catalogs and inject selected contents into the LLM request - Extract PROXY_HOST_HEADER to _constants.py for shared use - Search backwards through contents for function responses so batched helper calls (resource + prompt in the same turn) work correctly - Validate resource_names input type to handle bare strings from LLMs - Harden _model_dump fallback for non-iterable objects - Add focused unit tests covering helper discovery, unique naming, input coercion, combined helper calls, and prompt/resource loading Addresses kagent-dev#890 for the Python declarative runtime. Signed-off-by: Jaison Paul <paul.jaison@gmail.com>
6b923f6 to
9db5f6c
Compare
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.
Summary
Testing
Addresses #890 for the Python declarative runtime.