-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update mcp-core prompt to match spec, add mcp list/get to mcp-client #1323
base: main
Are you sure you want to change the base?
Conversation
- add new endpoints `list_prompts` and `get_prompt` in the MCP client - update prompt model in mcp-core to make `description` and `arguments` optional, following MCP spec
@@ -70,9 +70,9 @@ pub fn load_prompt_files() -> HashMap<String, Prompt> { | |||
description: arg.description, | |||
required: arg.required, | |||
}) | |||
.collect(); | |||
.collect::<Vec<PromptArgument>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated to this PR: i don't think we need this mapping - https://github.com/block/goose/blob/main/crates/goose-mcp/src/developer/prompts/unit_test.json
it'd be easier to stay closer to the MCP prompt in the json to avoid this mapping (description instead of template)
nit: you can add a prompt in the mcp-server example here: https://github.com/modelcontextprotocol/rust-sdk/blob/main/crates/mcp-server/src/main.rs. that'll make it easier to test from this mcp-client example: https://github.com/modelcontextprotocol/rust-sdk/blob/main/crates/mcp-client/examples/stdio_integration.rs |
…e implementing types to define them, similar to other methods
… test both new methods
- extend CLI input handling to support `/prompts` for listing available prompts - add `ListPrompts` variant in the input enum and update help documentation - implement prompt rendering in the session output module - update agent traits and capabilities to aggregate and list prompts from all extensions
Moved this back into a draft PR for now, since we're in progress of moving the mcp stuff to the rust-sdk, I'm keeping the commits in sync manually for now but I'll hold off on diverging for nwo. |
fix: cherry-pick conflicts resolved
Added some basic cli based prompting scaffolding, mainly to list prompts and get the information about them. Calling the prompt is not yet implemented. Ex: ( O)> /prompts
mcp_test
- no_args_prompt
- one_arg_prompt
developer
- unit_test
( O)> /prompt unit_test --info
Extension: developer
Prompt: unit_test
Generate or update unit tests for a given source code file.
The source code file is provided in {source_code}.
Please update the existing tests, ensure they are passing, and add any new tests as needed.
The test suite should:
- Follow language-specific test naming conventions for {language}
- Include all necessary imports and annotations
- Thoroughly test the specified functionality
- Ensure tests are passing before completion
- Handle edge cases and error conditions
- Use clear test names that reflect what is being tested
Arguments:
source_code (required) The source code file content to be tested
language (required) The programming language of the source code
( O)> |
from the mcp server
agent loop Add functionality to transform PromptMessageContent to MessageContent with proper handling in the session module and add test coverage. Add the results of GetPrompt to the message conversation and run the agent loop with prompt response.
update
Prompt
structs for align with MCP spec, add basic prompt commands to mcp-clientdescription
andarguments
are optional fields, use optional in the structsPromptArguments
description
andrequired
are optional toolist_prompts
andget_prompt
method to theMcpClientTrait
list_prompts
andget_prompt
to callprompts/list
andprompts/get
respectivelystdio
andsse
clients to handleJsonRpcMessage::Error
responses to send back to the user instead of doing nothing