feat: Add support for mcp tools with rig agents + add anthropic prompt caching
Allows developers to use mcp tools and servers with rig.
Example usage:
use mcp_client_rs::client::ClientBuilder;
let fetch_client = ClientBuilder::new("uvx")
.arg("mcp-server-fetch")
.spawn_and_initialize()
.await?;
let fetch_tools = fetch_client.list_tools().await?.tools;
let fetch_client = Arc::new(fetch_client);
for tool in fetch_tools {
agent = agent.mcp_tool(tool, fetch_client.clone());
}
@cvauclair could you have a look at this please?
Hey @edisontim thanks for the PR! FYI we are currently looking at implementing MCP (clients, servers and compatibility with existing agents) directly into Rig, which is why there's been a delay to get this reviewed. I'll make a tracking issue for this so we can have a central place to discuss everything MCP related!
Hey @cvauclair, any news on the issue to track MCP development?
any issue to track this? I'm willing to contribute if there're some clear planing for MCP
@cvauclair do you guys have a path for MCP?
@cvauclair an answer would be appreciated. I'm continuing to push on this branch and imo it brings to the table multiple interesting features for anthropic users, namely the thinking feature for the new sonnet3.7 and prompt caching. It would be interesting to merge this branch to the main so I can also use new features implemented in the main branch, and how I should proceed with MCP
Closed because I opened https://github.com/0xPlaygrounds/rig/pull/328, which has a refactor of the bedrock provider as well