The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(hosting): correct MCP tool schema to use proper JSON Schema types
Steven Enamakel4114df0b29ec
diff --git a/crates/openhuman-core/src/config/schema/tools/mcp.rs b/crates/openhuman-core/src/config/schema/tools/mcp.rsindex df2e642067..58b1da83e9 100644--- a/crates/openhuman-core/src/config/schema/tools/mcp.rs+++ b/crates/openhuman-core/src/config/schema/tools/mcp.rs@@ -37,55 +37,24 @@ impl Default for GitbooksConfig {}}-#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]+// The wire contract's shapes, shared with `tinymcp`: what a server is called,+// how to reach it, and how to authenticate. The TOML spelling is the+// contract's, so a config file and the module cannot drift apart.+pub use tinymcp_bus::{HttpHeader, McpAuthConfig, McpRegistryAuthConfig};++/// One configured MCP server: the contract's [`tinymcp_bus::McpServerConfig`]+/// (flattened, so the TOML keys are unchanged) plus how this application+/// exposes its tools to the model.+///+/// Dereferences to the contract type, so `server.name`, `server.endpoint` and+/// the rest read as they always have.+#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonSchema)]#[serde(default)]pub struct McpServerConfig {- /// Stable server slug used by the agent-facing bridge tools.- #[serde(default)]- pub name: String,- /// MCP endpoint URL. Current implementation supports stateless- /// Streamable HTTP / JSON responses.- #[serde(default)]- pub endpoint: String,- /// Optional stdio command for local MCP servers. When set, the- /// client launches this command as a subprocess and speaks newline-- /// delimited JSON-RPC over stdin/stdout per the MCP stdio transport.- #[serde(default)]- pub command: String,- /// Command-line arguments for stdio MCP servers.- #[serde(default)]- pub args: Vec<String>,- /// Extra environment variables for stdio MCP servers. MCP stdio auth- /// is typically passed this way.- #[serde(default)]- pub env: HashMap<String, String>,- /// Optional working directory for stdio MCP servers.- #[serde(default)]- pub cwd: Option<String>,- /// Optional human-readable description shown in bridge tool output.- #[serde(default)]- pub description: Option<String>,- /// Whether this server should be exposed to the MCP bridge tools.- #[serde(default = "defaults::default_true")]- pub enabled: bool,- /// Exact remote tool names this server may expose through the generic- /// MCP bridge. Empty means all remote tools are allowed unless they- /// appear in `disallowed_tools`.- #[serde(default)]- pub allowed_tools: Vec<String>,- /// Exact remote tool names that should always be hidden and blocked.- /// This denylist takes precedence over `allowed_tools`.- #[serde(default)]- pub disallowed_tools: Vec<String>,- /// Per-request timeout in seconds.- #[serde(default = "default_mcp_timeout_secs")]- pub timeout_secs: u64,- /// Optional auth strategy applied to outbound requests for this- /// server. Useful for API-key and pre-provisioned bearer-token- /// flows; interactive OAuth discovery is handled by the client- /// transport separately when a server returns an auth challenge.- #[serde(default)]- pub auth: McpAuthConfig,+ /// Name, endpoint or command, environment, allow/deny lists, timeout and+ /// auth: everything the MCP client needs to reach the server.+ #[serde(flatten)]+ pub server: tinymcp_bus::McpServerConfig,/// How this server's tools reach the model. Every remote tool becomes its/// own `mcp_<server>_<tool>` tool; `deferred` (the default) leaves them/// out of the catalogue until `tool_search` finds them, `direct` sends@@ -98,77 +67,38 @@ pub struct McpServerConfig {pub direct_tools: Vec<String>,}-/// How a configured MCP server's tools enter the model's catalogue.-#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]-#[serde(rename_all = "snake_case")]-pub enum McpToolExposure {- /// Found through `tool_search`, then callable by name.- #[default]- Deferred,- /// Sent to the model every turn.- Direct,+impl std::ops::Deref for McpServerConfig {+ type Target = tinymcp_bus::McpServerConfig;++ fn deref(&self) -> &Self::Target {+ &self.server+ }}-fn default_mcp_timeout_secs() -> u64 {- 30+impl std::ops::DerefMut for McpServerConfig {+ fn deref_mut(&mut self) -> &mut Self::Target {+ &mut self.server+ }}-impl Default for McpServerConfig {- fn default() -> Self {+impl From<tinymcp_bus::McpServerConfig> for McpServerConfig {+ fn from(server: tinymcp_bus::McpServerConfig) -> Self {Self {- name: String::new(),- endpoint: String::new(),- command: String::new(),- args: Vec::new(),- env: HashMap::new(),- cwd: None,- description: None,- enabled: defaults::default_true(),- allowed_tools: Vec::new(),- disallowed_tools: Vec::new(),- timeout_secs: default_mcp_timeout_secs(),- auth: McpAuthConfig::None,- expose: McpToolExposure::Deferred,- direct_tools: Vec::new(),+ server,+ ..Self::default()}}}-/// One HTTP header (name + value) for the multi-header [`McpAuthConfig::Headers`]-/// variant — e.g. a remote that requires both `X-Client-Key` and-/// `X-Client-Secret`, or an API key plus an org id.-#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]-pub struct HttpHeader {- pub name: String,- pub value: String,-}--#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]-#[serde(tag = "kind", rename_all = "snake_case")]-#[derive(Default)]-pub enum McpAuthConfig {+/// How a configured MCP server's tools enter the model's catalogue.+#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]+#[serde(rename_all = "snake_case")]+pub enum McpToolExposure {+ /// Found through `tool_search`, then callable by name.#[default]- None,- BearerToken {- token: String,- },- Basic {- username: String,- password: String,- },- Header {- name: String,- value: String,- },- /// Multiple request headers, all applied — for remotes that authenticate- /// with more than one header (single-header servers use [`Self::Header`]).- Headers {- headers: Vec<HttpHeader>,- },- QueryParam {- name: String,- value: String,- },+ Deferred,+ /// Sent to the model every turn.+ Direct,}#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]@@ -238,27 +168,3 @@ impl Default for McpClientConfig {}}}--/// Registry-browse auth + endpoint overrides. Lets a user who hits Smithery-/// rate limits (or needs an authenticated official-registry endpoint) supply-/// credentials from the desktop app instead of editing env vars. Each field is-/// config-first with an env-var fallback so existing CI/Docker deployments that-/// only set env vars keep working unchanged.-///-/// Secrets are write-only over RPC: the getter reports whether each secret is-/// *set* (a boolean) and never echoes the value back.-#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonSchema)]-#[serde(default)]-pub struct McpRegistryAuthConfig {- /// Smithery API key. Falls back to `SMITHERY_API_KEY`.- #[serde(default)]- pub smithery_api_key: Option<String>,- /// Base URL override for the official registry. Falls back to- /// `MCP_OFFICIAL_REGISTRY_BASE` (non-secret).- #[serde(default)]- pub mcp_official_base: Option<String>,- /// Bearer token for the official registry. Falls back to- /// `MCP_OFFICIAL_REGISTRY_TOKEN`.- #[serde(default)]- pub mcp_official_token: Option<String>,-}diff --git a/crates/openhuman-core/src/hosting/hosting_tests.rs b/crates/openhuman-core/src/hosting/hosting_tests.rsindex 600e165091..1e9a268f0a 100644--- a/crates/openhuman-core/src/hosting/hosting_tests.rs+++ b/crates/openhuman-core/src/hosting/hosting_tests.rs@@ -7,7 +7,6 @@use super::*;use crate::config::Config;-use tinytools::Tool;fn config_with(workspace: &std::path::Path, enabled: bool, api_key: &str) -> Config {let mut config = Config::default();