Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .release-plz.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ version_group = "acp"
name = "agent-client-protocol-polyfill"
version_group = "acp"

# rmcp is a public dependency, so this crate's major version tracks rmcp's
# major releases independently of the rest of the workspace.
[[package]]
name = "agent-client-protocol-rmcp"
version_group = "acp"

[[package]]
name = "agent-client-protocol-conductor"
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }

# MCP SDK
rmcp = { version = "1.2.0", features = ["server", "transport-io", "schemars"] }
rmcp = { version = "2.1.0", features = ["server", "transport-io", "schemars"] }

# CLI parsing
clap = { version = "4.5", features = ["derive"] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async fn test_scoped_mcp_server_through_proxy() -> Result<(), agent_client_proto
.await?;

expect_test::expect![[r#"
"OK: CallToolResult { content: [Annotated { raw: Text(RawTextContent { text: \"2\", meta: None }), annotations: None }], structured_content: None, is_error: Some(false), meta: None }"
"OK: CallToolResult { content: [Text(TextContent { text: \"2\", meta: None, annotations: None })], structured_content: None, is_error: Some(false), meta: None }"
"#]].assert_debug_eq(&result);

Ok(())
Expand Down Expand Up @@ -84,7 +84,7 @@ async fn test_scoped_mcp_server_through_session() -> Result<(), agent_client_pro
.await?;

expect_test::expect![[r#"
"OK: CallToolResult { content: [Annotated { raw: Text(RawTextContent { text: \"2\", meta: None }), annotations: None }], structured_content: None, is_error: Some(false), meta: None }"
"OK: CallToolResult { content: [Text(TextContent { text: \"2\", meta: None, annotations: None })], structured_content: None, is_error: Some(false), meta: None }"
"#]].assert_debug_eq(&result);

Ok(())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ async fn test_standalone_server_call_echo_tool() -> Result<(), agent_client_prot
let text = result
.content
.first()
.and_then(|c| c.raw.as_text())
.and_then(|c| c.as_text())
.map(|t| t.text.as_str())
.expect("Expected text content");

Expand Down Expand Up @@ -197,7 +197,7 @@ async fn test_standalone_server_call_add_tool() -> Result<(), agent_client_proto

// Structured output should have the result
let content = result.content.first().expect("Expected content");
let text = content.raw.as_text().expect("Expected text content");
let text = content.as_text().expect("Expected text content");
assert!(
text.text.contains('8') || text.text.contains("result"),
"Expected result to contain 8, got: {}",
Expand Down
2 changes: 1 addition & 1 deletion src/agent-client-protocol-conductor/tests/test_tool_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async fn test_tool_fn_greet() -> Result<(), agent_client_protocol::Error> {
.await?;

expect_test::expect![[r#"
"OK: CallToolResult { content: [Annotated { raw: Text(RawTextContent { text: \"\\\"Hello, World!\\\"\", meta: None }), annotations: None }], structured_content: None, is_error: Some(false), meta: None }"
"OK: CallToolResult { content: [Text(TextContent { text: \"\\\"Hello, World!\\\"\", meta: None, annotations: None })], structured_content: None, is_error: Some(false), meta: None }"
"#]].assert_debug_eq(&result);

Ok(())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ async fn test_trace_client_mcp_server() -> Result<(), agent_client_protocol::Err
"sessionUpdate": String("agent_message_chunk"),
"content": Object {
"type": String("text"),
"text": String("OK: CallToolResult { content: [Annotated { raw: Text(RawTextContent { text: \"{\\\"echoed\\\":\\\"Client echoes: Hello from client test!\\\",\\\"call_number\\\":1}\", meta: None }), annotations: None }], structured_content: Some(Object {\"echoed\": String(\"Client echoes: Hello from client test!\"), \"call_number\": Number(1)}), is_error: Some(false), meta: None }"),
"text": String("OK: CallToolResult { content: [Text(TextContent { text: \"{\\\"echoed\\\":\\\"Client echoes: Hello from client test!\\\",\\\"call_number\\\":1}\", meta: None, annotations: None })], structured_content: Some(Object {\"echoed\": String(\"Client echoes: Hello from client test!\"), \"call_number\": Number(1)}), is_error: Some(false), meta: None }"),
},
"messageId": String("testy-message-end-turn-1"),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
"capabilities": Object {},
"clientInfo": Object {
"name": String("rmcp"),
"version": String("1.8.0"),
"version": String("2.1.0"),
},
},
},
Expand All @@ -667,7 +667,7 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
},
"serverInfo": Object {
"name": String("rmcp"),
"version": String("1.8.0"),
"version": String("2.1.0"),
},
"instructions": String("A simple test MCP server with an echo tool"),
},
Expand Down Expand Up @@ -739,7 +739,7 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
"sessionUpdate": String("agent_message_chunk"),
"content": Object {
"type": String("text"),
"text": String("OK: CallToolResult { content: [Annotated { raw: Text(RawTextContent { text: \"{\\\"result\\\":\\\"Echo: Hello from trace test!\\\"}\", meta: None }), annotations: None }], structured_content: Some(Object {\"result\": String(\"Echo: Hello from trace test!\")}), is_error: Some(false), meta: None }"),
"text": String("OK: CallToolResult { content: [Text(TextContent { text: \"{\\\"result\\\":\\\"Echo: Hello from trace test!\\\"}\", meta: None, annotations: None })], structured_content: Some(Object {\"result\": String(\"Echo: Hello from trace test!\")}), is_error: Some(false), meta: None }"),
},
"messageId": String("testy-message-end-turn-1"),
},
Expand Down Expand Up @@ -772,7 +772,7 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
"sessionUpdate": String("agent_message_chunk"),
"content": Object {
"type": String("text"),
"text": String("OK: CallToolResult { content: [Annotated { raw: Text(RawTextContent { text: \"{\\\"result\\\":\\\"Echo: Hello from trace test!\\\"}\", meta: None }), annotations: None }], structured_content: Some(Object {\"result\": String(\"Echo: Hello from trace test!\")}), is_error: Some(false), meta: None }"),
"text": String("OK: CallToolResult { content: [Text(TextContent { text: \"{\\\"result\\\":\\\"Echo: Hello from trace test!\\\"}\", meta: None, annotations: None })], structured_content: Some(Object {\"result\": String(\"Echo: Hello from trace test!\")}), is_error: Some(false), meta: None }"),
},
"messageId": String("testy-message-end-turn-1"),
},
Expand Down
2 changes: 1 addition & 1 deletion src/agent-client-protocol-cookbook/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ pub mod global_mcp_server {
//! impl MyMcpServer {
//! #[tool(description = "Echoes back the input message")]
//! async fn echo(&self, Parameters(params): Parameters<EchoParams>) -> Result<CallToolResult, rmcp::ErrorData> {
//! Ok(CallToolResult::success(vec![Content::text(format!("Echo: {}", params.message))]))
//! Ok(CallToolResult::success(vec![ContentBlock::text(format!("Echo: {}", params.message))]))
//! }
//! }
//!
Expand Down
9 changes: 9 additions & 0 deletions src/agent-client-protocol-rmcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ This crate is separate from `agent-client-protocol` to avoid coupling the core p
- `agent-client-protocol-rmcp` to track `rmcp` updates independently
- Breaking changes in `rmcp` only require updating this crate

## Versioning

`rmcp` is a public dependency of this crate: its types appear in the public API (e.g. `McpServerExt::from_rmcp`). Each major release of `rmcp` therefore requires a major release of this crate, independent of the other `agent-client-protocol` crates.

| agent-client-protocol-rmcp | rmcp |
| -------------------------- | ---- |
| 2.x | 2.x |
| 1.x | 1.x |

## Related Crates

- **[agent-client-protocol](../agent-client-protocol/)** — Core ACP protocol types and traits
Expand Down
2 changes: 1 addition & 1 deletion src/agent-client-protocol-rmcp/examples/with_mcp_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl ExampleMcpServer {
&self,
Parameters(params): Parameters<EchoParams>,
) -> Result<CallToolResult, McpError> {
Ok(CallToolResult::success(vec![Content::text(format!(
Ok(CallToolResult::success(vec![ContentBlock::text(format!(
"Echo: {}",
params.message
))]))
Expand Down
6 changes: 3 additions & 3 deletions src/agent-client-protocol-rmcp/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,9 @@ impl<R: Role> ServerHandler for McpServerConnection<R> {
if has_structured_output {
Ok(CallToolResult::structured(result))
} else {
Ok(CallToolResult::success(vec![rmcp::model::Content::text(
result.to_string(),
)]))
Ok(CallToolResult::success(vec![
rmcp::model::ContentBlock::text(result.to_string()),
]))
}
}
Err(error) => Err(to_rmcp_error(error)),
Expand Down
2 changes: 1 addition & 1 deletion src/agent-client-protocol-test/src/bin/mcp_echo_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl EchoServer {
&self,
Parameters(params): Parameters<EchoParams>,
) -> Result<CallToolResult, McpError> {
Ok(CallToolResult::success(vec![Content::text(format!(
Ok(CallToolResult::success(vec![ContentBlock::text(format!(
"Echo: {}",
params.message
))]))
Expand Down