Skip to content
Closed
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
19 changes: 19 additions & 0 deletions .vscode/mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"servers": {
// "rmcp-servers-stdio": {
// "type": "stdio",
// // "command": "/home/pete/.cargo_target/release/examples/servers_std_io",
// "command": "cargo",
// "args": ["run", "--example", "servers_std_io"]
// },
"generic-server": {
"type": "stdio",
// "command": "/home/pete/.cargo_target/release/examples/servers_std_io",
"command": "cargo",
"args": ["run",
"--manifest-path",
"/home/pete/me-ref/rmcp/Cargo.toml",
"--example", "servers_std_io"]
}
}
}
4 changes: 2 additions & 2 deletions crates/rmcp-macros/src/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ pub(crate) fn tool_impl_item(attr: TokenStream, mut input: ItemImpl) -> syn::Res
input.items.push(parse_quote! {
async fn list_tools(
&self,
request: rmcp::model::PaginatedRequestParam,
request: Option<rmcp::model::PaginatedRequestParam>,
context: rmcp::service::RequestContext<rmcp::RoleServer>,
) -> Result<rmcp::model::ListToolsResult, rmcp::Error> {
self.list_tools_inner(request, context).await
Expand Down Expand Up @@ -316,7 +316,7 @@ pub(crate) fn tool_impl_item(attr: TokenStream, mut input: ItemImpl) -> syn::Res
input.items.push(parse_quote! {
async fn list_tools_inner(
&self,
_: rmcp::model::PaginatedRequestParam,
_: Option<rmcp::model::PaginatedRequestParam>,
_: rmcp::service::RequestContext<rmcp::RoleServer>,
) -> Result<rmcp::model::ListToolsResult, rmcp::Error> {
Ok(rmcp::model::ListToolsResult {
Expand Down
2 changes: 2 additions & 0 deletions crates/rmcp/tests/test_tool_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ impl<DS: DataService> GenericServer<DS> {
self.data_service.get_data()
}
}
#[tool(tool_box)]
impl<DS: DataService> ServerHandler for GenericServer<DS> {}

#[tokio::test]
async fn test_tool_macros() {
Expand Down
15 changes: 10 additions & 5 deletions examples/clients/src/std_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ async fn main() -> Result<()> {
)
.with(tracing_subscriber::fmt::layer())
.init();

let args = "cargo run --example servers_std_io".to_string();
let mut args = args.split_whitespace();
let service = ()
.serve(TokioChildProcess::new(Command::new("uvx").configure(
|cmd| {
cmd.arg("mcp-server-git");
},
))?)
.serve(TokioChildProcess::new(
Command::new(args.next().unwrap()).configure(|cmd| {
while let Some(arg) = args.next() {
cmd.arg(arg);
}
}),
)?)
.await?;

// or serve_client((), TokioChildProcess::new(cmd)?).await?;
Expand Down
Loading