-
Notifications
You must be signed in to change notification settings - Fork 604
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] MCP prompts #639
[feat] MCP prompts #639
Conversation
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.
Looks good!
let client = capabilities | ||
.get_system(system) | ||
.await | ||
.unwrap_or_else(|| panic!("System not found: {}", system)); |
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.
I think we should return an Err (SystemError::UnknownSystem) here instead of panicing?
async fn passthrough(&self, _system: &str, _request: Value) -> SystemResult<Value> { | ||
// TODO implement | ||
Ok(Value::Null) | ||
async fn passthrough(&self, system: &str, method: &str, params: Value) -> SystemResult<Value> { |
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.
meganit: maybe implement self.capabilities.passthrough helper - i think this code would be the same throughout
@@ -314,4 +314,10 @@ impl Capabilities { | |||
|
|||
result | |||
} | |||
|
|||
/// Retrieve a client by name, if it exists | |||
pub async fn get_system(&self, system: &str) -> Option<Arc<Mutex<Box<dyn McpClientTrait>>>> { |
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.
nit: for clarity get_client
to match get_client_for_tool
?
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.
nice!!
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.
cargo run --bin goosed -- agent
curl --request POST \
--url http://127.0.0.1:3000/prompts/list \
--header 'Content-Type: application/json' \
--header 'X-Secret-Key: test' \
--data '{
"system": "developer"
}'
This hangs for me though
ported over here |
Implement get_prompt and list_prompts per MCP: https://spec.modelcontextprotocol.io/specification/2024-11-05/server/prompts/