Skip to content
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

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

darinkishore
Copy link

@darinkishore darinkishore commented Dec 16, 2024

i think feasible implementation? will have to add tests.

  • integration test.

test multiple servers as well.

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub struct MCPIntegrationToolQuery {
pub action: String,
Copy link
Contributor

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

Comment on lines +184 to +186
fn tool_input_format(&self) -> String {
r#"{"action":"list"} or {"action":"call","server_name":"string","tool_name":"string","arguments":{}}"#.to_string()
}
Copy link
Contributor

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 {
Copy link
Contributor

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>>,
Copy link
Contributor

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
Copy link
Author

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?)
Copy link
Author

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants