-
Notifications
You must be signed in to change notification settings - Fork 32
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
super super super WIP mcp integration #1635
base: main
Are you sure you want to change the base?
Conversation
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
#[serde(rename_all = "snake_case")] | ||
pub struct MCPIntegrationToolQuery { | ||
pub action: String, |
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.
any reason to keep this String or can we make this enum and make it properly typed, string feels weird over here
fn tool_input_format(&self) -> String { | ||
r#"{"action":"list"} or {"action":"call","server_name":"string","tool_name":"string","arguments":{}}"#.to_string() | ||
} |
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.
this format is generally used for parsing xml and not json which might lead to errors over here
})?; | ||
|
||
let mut tool_descriptors = Vec::new(); | ||
for t in tools_array { |
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.
proper variable names please, I dont enjoy second guessing single variable names and looking for them in the codebase.. there is no need to be stingy with the variable name
} | ||
|
||
pub struct MCPIntegrationToolBroker { | ||
servers: HashMap<String, Arc<Client>>, |
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.
any reason the servers here have Arc and not Client
@@ -85,4 +85,11 @@ pub enum ToolError { | |||
|
|||
#[error("Readline error")] | |||
ReadLineError, | |||
} | |||
|
|||
// Newly added error variants for integration tool usage |
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.
mcp
} | ||
|
||
fn tool_description(&self) -> String { | ||
// TODO: change description to aggregate descriptions of all servers (or maybe a simpler option?) |
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.
address
Introduced an awaited `.with_mcp()` in the `ToolBroker` for MCP customization, ensuring async readiness. Updated various dependencies in `Cargo.lock`, including `thiserror`, `syn`, `serde`, `tokio`, and `tungstenite`, reflecting improvements and compatibility updates.
put it into the agent shits looping though idk why
i think feasible implementation? will have to add tests.
test multiple servers as well.