Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(mcp): stop seeding gitbooks as an MCP server

Steven Enamakel2273aa825405
diff --git a/crates/openhuman-core/src/mcp/host.rs b/crates/openhuman-core/src/mcp/host.rs
index 9a47b7bf5a..1f03d58738 100644
--- a/crates/openhuman-core/src/mcp/host.rs
+++ b/crates/openhuman-core/src/mcp/host.rs
@@ -354,29 +354,15 @@ pub fn client_config(config: &Config) -> McpClientConfig {
client.registry_auth = config.mcp_client.registry_auth.clone();
- // The documentation server is seeded here rather than by the module: it is
- // this application's own, and `tinymcp` has no business knowing about it.
- if config.gitbooks.enabled
- && !client
- .servers
- .iter()
- .any(|server| server.name == GITBOOKS_SERVER_NAME)
- {
- client.servers.push(McpServerConfig {
- name: GITBOOKS_SERVER_NAME.to_string(),
- endpoint: config.gitbooks.endpoint.clone(),
- description: Some("OpenHuman GitBook documentation MCP server.".to_string()),
- timeout_secs: config.gitbooks.timeout_secs,
- ..McpServerConfig::default()
- });
- }
+ // The documentation server is deliberately not seeded as an MCP server:
+ // `gitbooks_search` / `gitbooks_get_page` are hard-coded deferred tools
+ // (`tools::implementations::network::gitbooks`). Seeding it here made every
+ // first turn dial the endpoint for `tools/list` and register the generic
+ // MCP bridge tools for nothing.
client
}
-/// The name the documentation server is registered under.
-pub const GITBOOKS_SERVER_NAME: &str = "gitbooks";
-
/// Whether a declared server's transport may be dialed with its configured
/// credentials attached.
///
diff --git a/crates/openhuman-core/src/mcp/host_tests.rs b/crates/openhuman-core/src/mcp/host_tests.rs
index d5779ede28..7ff3077160 100644
--- a/crates/openhuman-core/src/mcp/host_tests.rs
+++ b/crates/openhuman-core/src/mcp/host_tests.rs
@@ -186,56 +186,13 @@ fn the_registry_credentials_survive_the_conversion() {
}
#[test]
-fn the_documentation_server_is_seeded_when_it_is_enabled() {
- // It is this application's own server. `tinymcp` has no business knowing
- // about it, so the seeding happens here.
+fn the_documentation_server_is_never_seeded_as_an_mcp_server() {
+ // The docs are served by the hard-coded `gitbooks_*` tools; an MCP server
+ // entry would make the first turn dial the endpoint for nothing.
let mut config = Config::default();
config.gitbooks.enabled = true;
- let converted = client_config(&config);
- let docs = converted
- .servers
- .iter()
- .find(|server| server.name == GITBOOKS_SERVER_NAME)
- .expect("the documentation server");
-
- assert_eq!(docs.endpoint, config.gitbooks.endpoint);
- assert_eq!(docs.timeout_secs, config.gitbooks.timeout_secs);
-}
-
-#[test]
-fn the_documentation_server_is_not_seeded_when_it_is_disabled() {
- let converted = client_config(&config_without_docs());
-
- assert!(!converted
- .servers
- .iter()
- .any(|server| server.name == GITBOOKS_SERVER_NAME));
-}
-
-#[test]
-fn a_user_declared_server_of_the_same_name_wins_over_the_seeded_one() {
- // Someone who deliberately pointed that name somewhere else keeps it.
- let mut config = Config::default();
- config.gitbooks.enabled = true;
- config.mcp_client.servers.push(HostServer {
- server: tinymcp_bus::McpServerConfig {
- name: GITBOOKS_SERVER_NAME.into(),
- endpoint: "https://mine.test/mcp".into(),
- ..Default::default()
- },
- ..Default::default()
- });
-
- let converted = client_config(&config);
- let matching: Vec<_> = converted
- .servers
- .iter()
- .filter(|server| server.name == GITBOOKS_SERVER_NAME)
- .collect();
-
- assert_eq!(matching.len(), 1);
- assert_eq!(matching[0].endpoint, "https://mine.test/mcp");
+ assert!(client_config(&config).servers.is_empty());
}
#[test]