mcp: use rust-rmcp instead of brk-rmcp

This commit is contained in:
nym21
2025-07-17 16:34:29 +02:00
parent cc87b22757
commit 2001370441
9 changed files with 99 additions and 66 deletions

View File

@@ -14,7 +14,7 @@ brk_indexer = { workspace = true }
brk_vec = { workspace = true }
color-eyre = { workspace = true }
derive_deref = { workspace = true }
brk_rmcp = { workspace = true }
rmcp = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }

View File

@@ -1,5 +1,5 @@
use brk_rmcp::schemars::JsonSchema;
use color_eyre::eyre::eyre;
use rmcp::schemars::JsonSchema;
use serde::Deserialize;
#[allow(clippy::upper_case_acronyms)]

View File

@@ -1,6 +1,6 @@
use std::ops::Deref;
use brk_rmcp::schemars::{self, JsonSchema};
use rmcp::schemars::{self, JsonSchema};
use serde::Deserialize;
use crate::{

View File

@@ -26,7 +26,7 @@ pub fn init(path: Option<&Path>) {
});
Builder::from_env(Env::default().default_filter_or(
"info,bitcoin=off,bitcoincore-rpc=off,fjall=off,lsm_tree=off,rolldown=off,brk_rolldown=off,rmcp=off,brk_rmcp=off,tracing=off",
"info,bitcoin=off,bitcoincore-rpc=off,fjall=off,lsm_tree=off,rolldown=off,brk_rolldown=off,rmcp=off,rmcp=off,tracing=off",
))
.format(move |buf, record| {
let date_time = Timestamp::now()

View File

@@ -11,4 +11,4 @@ repository.workspace = true
axum = { workspace = true }
brk_interface = { workspace = true }
log = { workspace = true }
brk_rmcp = { workspace = true }
rmcp = { workspace = true }

View File

@@ -4,14 +4,14 @@
// #![doc = "```"]
use brk_interface::{IdParam, Interface, PaginatedIndexParam, PaginationParam, Params};
use brk_rmcp::{
Error as McpError, RoleServer, ServerHandler,
use log::info;
use rmcp::{
ErrorData as McpError, RoleServer, ServerHandler,
handler::server::{router::tool::ToolRouter, tool::Parameters},
model::*,
service::RequestContext,
tool, tool_handler, tool_router,
};
use log::info;
pub mod route;

View File

@@ -1,6 +1,6 @@
use axum::Router;
use brk_interface::Interface;
use brk_rmcp::transport::{
use rmcp::transport::{
StreamableHttpServerConfig,
streamable_http_server::{StreamableHttpService, session::local::LocalSessionManager},
};
@@ -22,15 +22,13 @@ where
return self;
}
let config = StreamableHttpServerConfig {
// stateful_mode: false, // breaks Claude
..Default::default()
};
let service = StreamableHttpService::new(
move || Ok(MCP::new(interface)),
LocalSessionManager::default().into(),
config,
StreamableHttpServerConfig {
// stateful_mode: false, // breaks Claude
..Default::default()
},
);
info!("Setting MCP...");