feat: add mcp_prompts_resources plugin - #60
Open
venkat-raman17 wants to merge 1 commit into
Open
Conversation
Code Puppy consumes MCP tools only. `MCPToolset` already implements `list_prompts`, `get_prompt`, `list_resources` and `read_resource`, so prompts and resources on a configured MCP server are unreachable purely for want of wiring. This surfaces them. Registered as agent tools rather than slash commands: tool calls run inside the agent's async context, so the async MCP calls need no sync/async bridge. A sync command handler runs on the event loop thread and would deadlock if it blocked for a result. Adds four tools - list_mcp_prompts, get_mcp_prompt, list_mcp_resources, read_mcp_resource. Servers are queried only while running, and only when they advertise the matching capability; a server that is stopped, disabled or quarantined is skipped rather than raising. Errors are reported per server, so one bad server does not blank the listing, and a failed `get_prompt` keeps its message so a missing argument does not masquerade as "prompt not found". Co-Authored-By: Claude <noreply@anthropic.com>
Author
|
@mpfaffenberger , Can you please review the PR? |
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
Code Puppy consumes MCP tools only.
MCPToolsetalready implementslist_prompts,get_prompt,list_resourcesandread_resource— so prompts and resources on a configured MCP server are unreachable purely for want of wiring. This plugin surfaces them.Motivation: running a platform-curated stdio MCP server, the tools work but the prompts and docs the same server publishes are invisible.
Adds four agent tools:
list_mcp_prompts,get_mcp_prompt,list_mcp_resources,read_mcp_resource.Notes
MCPCommandHandler._commandsis a hardcoded dict in core, so/mcp <sub>isn't extensible from a plugin anyway.MCPToolset.capabilitiesraisesAttributeErroruntil the toolset is entered, which the capability check absorbs.get_promptkeeps its message, so a missing required argument reports as such rather than masquerading as "prompt not found".get_mcp_promptacceptsserver:promptor a barepromptname.get_mcp_manager,unwrap_toolset,toolset_is_running, and theregister_tools/register_agent_toolsphases).Testing
16 new tests, all passing. Suite: 2162 passed.
The 18 remaining failures are pre-existing and unrelated (oauth token-storage permission bits, symlink rejection, statusline, spill, computer_use policy) — all Windows-environment limitations around file permissions and symlink privileges, in plugins this PR doesn't touch.
Also verified end to end against a live stdio MCP server, and through the real plugin loader — the four tools appear in both
on_register_tools()andon_register_agent_tools().Sampling and elicitation are deliberately out of scope: those are server-initiated requests that need a consent and UI surface, unlike these read calls.
🤖 Generated with Claude Code