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
docs(mcp): rewrite module READMEs around the tinymcp module boundary
Steven Enamakel59ac87a3396e
diff --git a/crates/openhuman-core/src/mcp/README.md b/crates/openhuman-core/src/mcp/README.mdindex d2b319c3d7..9a329a6409 100644--- a/crates/openhuman-core/src/mcp/README.md+++ b/crates/openhuman-core/src/mcp/README.md@@ -1,224 +1,88 @@-# mcp+# MCP-The host half of Model Context Protocol support. The MCP client itself (both-transports, the config-declared server set, the dynamic server registry with-its store, reconnect supervisor and browser sign-in, and the write-audit log)-lives in the vendored `tinymcp` library. This folder holds what belongs to-OpenHuman: the one `tinymcp` service per workspace, the RPC surface over it,-the agent-facing tools, the prompt-injection screen over remote tool-definitions, and the `openhuman-core mcp` server that exposes OpenHuman's own-tools to external MCP hosts such as Claude Desktop or Cursor.+This folder contains OpenHuman's host integration for the TinyMCP module. The+module owns MCP client and server protocol behavior, transports, configured and+installed server state, tool caches, OAuth and reconnect supervision. OpenHuman+owns product configuration and policy, the `mcp_clients` and `mcp_audit` RPC+surfaces, agent approval and prompt-injection screening, and the host entry+points for the local MCP server.-## How it works--There are two directions. As a client, OpenHuman connects to MCP servers the-user declared and lets its agents call their tools. As a server, it answers-other MCP hosts that call into it.--```text- client side server side- +-------------------------------+ +------------------------------+- | agent tools | | external MCP host |- | mcp_registry_* (registry/) | | (Claude Desktop, Cursor, |- | mcp_<server>_<tool> | | sandboxed claude subprocess)|- | installed-server actions | +--------------+---------------+- | mcp_list_servers/... (tools/ | | stdio or HTTP- | impl/network, static set) | v- +---------------+---------------+ +------------------------------+- | | server/ OpenHumanMcpHandler |- RPC mcp_clients.*, mcp_audit.* | over tinymcp::server |- | +--------------+---------------+- v |- +-------------------------------+ v- | host.rs McpHost per workspace| registered core RPC methods- | dynamic() static_servers() | (memory, agent, search, ...)- | audit() | under SecurityPolicy, with- +---------------+---------------+ writes recorded to the audit log- |- v- vendor/tinymcp-```--### The service holder--[`host.rs`](./host.rs) keeps a process-wide map (`HOSTS`) from workspace path to one-`McpHost`. An `McpHost` wraps the `tinymcp` service and exposes its three-parts: `dynamic()` (the user-declared registry), `static_servers()` (the-TOML-declared set) and `audit()` (the write-audit store). The library holds no-globals of its own, so two hosts in one process do not share connections;-this holder is the one place that decides there is one per workspace.+Host calls cross the module boundary through `tinymcp-bus`; the host does not+link TinyMCP's implementation into the normal build graph. `module_client.rs`+keeps one serialized module object per workspace and retains open/close+receipts so cancellation and lost replies do not orphan lifecycle work.-`host::init` opens the service at boot. A caller that arrives earlier gets-`None` from `try_service` rather than a service built on a configuration-nobody chose. `for_config` opens or returns the host for a specific-workspace, and `all_hosts` lets the supervisor walk every workspace opened so-far. `client_config` converts OpenHuman's `[mcp_client]` config into-`tinymcp`'s `McpClientConfig`.--### Startup+## How it works```text- core/runtime/subscribers.rs (RPC enable path) core/runtime/services.rs- | |- v v- mcp::start mcp::start_boot_jobs- registry::bus::init() mcp::start- host::init() (failure logged, ignored) spawn installed-server boot- spawn configured tool-cache- refresh- spawn reconnect supervisor- (Once)+ OpenHuman host policy and adapters TinyMCP module+ +--------------------------------+ +--------------------------------++ | configuration, proxy, approval |---->| MCP transports and protocol |+ | mcp_clients / mcp_audit RPCs | | stores, registry, supervisor |+ | tool exposure and event mapping |<--->| static and installed servers |+ | local stdio / HTTP entry points|---->| tool validation and execution |+ +--------------------------------+ +--------------------------------+```-Both entry points are idempotent, so the two startup paths can both call-them. `mcp::start` never fails: MCP being unavailable must not stop the core-coming up. The boot jobs dial installed servers, refresh every configured-server's cached tool list once per app load, and start the reconnect-supervisor exactly once per process. Between loads the tool cache changes-only on an MCP change (connect, credentials, disable, uninstall, an edited-definition).--### What stayed host-side, and why--Three things are host policy rather than protocol:--- Prompt-injection detection over remote tool definitions.- `registry::tools_safe_for_agent` ([`registry/mod.rs`](./registry/mod.rs)) drops a tool whose- description trips a rule, and logs and publishes `McpToolRejected` with the- rule code only, never the offending text. The lexical half (control- characters, prompt-template fences, length caps) lives in the- `tinymcp-bus` contract and is applied by its display accessors.-- Events. `tinymcp` reports outcomes in return values. Turning them into- `DomainEvent`s happens here: [`registry/ops.rs`](./registry/ops.rs) for RPC-driven lifecycle- events, [`registry/supervisor_events.rs`](./registry/supervisor_events.rs) for what the reconnect supervisor- observed, and `tools_safe_for_agent` for rejections. `audit/` publishes- nothing.-- The proxy decision. `host::proxy_for_mcp` applies OpenHuman's proxy scope- setting, per-service list and no-proxy list, and hands `tinymcp` a resolved- proxy (or none).--### Two server sets--The static set is declared in config TOML (`[[mcp_client.servers]]`) and is-reached through `mcp::config_servers` and the `mcp_list_servers`,-`mcp_list_tools` and `mcp_call_tool` bridge tools plus per-tool-`mcp_<server>_<tool>` tools in [`tools/impl/network/`](../tools/impl/network/). The dynamic set is the-user's `mcp.json` document, edited through `mcp_clients.config_get` and-`config_set`, browsed from the Smithery and official catalogs, and reached-through the `mcp_registry_*` tools and installed-server actions. Both are-compiled out with the `mcp` feature.--## Layout--| Path | What it does |-| --- | --- |-| [`mod.rs`](./mod.rs) | Family root: `start`, `start_boot_jobs`, the configured tool-cache refresh, the supervisor spawn, and the `http_client` and `config_servers` re-export modules. |-| `host.rs` | The per-workspace `McpHost` holder, config conversion (`client_config`, `static_registry`), `oauth_redirect_uri`, `proxy_for_mcp`. |-| [`registry/`](registry/README.md) | The `mcp_clients` RPC namespace (including `mcp.json`), the `mcp_registry_*` agent tools, installed-server action tools (`action_tool.rs`), supervisor event translation, the injection screen, and the `boot`, `supervisor`, `oauth` and `connections` helpers. |-| [`audit/`](audit/README.md) | The `mcp_audit` RPC namespace over the write-audit log. |-| [`server/`](server/README.md) | The `openhuman-core mcp` stdio and Streamable HTTP server, its tool catalog and dispatch, the write-audit pipeline, prompt resources, and the in-process loopback endpoint used by the sandboxed Claude Code provider. |--`mcp::http_client` and `mcp::config_servers` are modules in `mod.rs`, not-directories, and hold only `pub use` re-exports of `tinymcp`:--- `http_client` (ungated): the Streamable HTTP transport- (`McpHttpClient`, `McpHttpClientBuilder`), `tinymcp::Error` as `McpError`,- `redact_endpoint`, `render_tool_result`, and `tinymcp_bus` wire types- (`McpRemoteTool`, `McpServerToolResult`, `McpSseEvent`, the OAuth challenge- and metadata types). It is always compiled because the ungated `gitbooks`- tool ([`tools/impl/network/gitbooks.rs`](../tools/impl/network/gitbooks.rs)) dials `McpHttpClient`.-- `config_servers` (`mcp` feature): `McpStdioClient`, `McpRegistrySource`,- `McpServerDefinition`, `McpServerRegistry`, `McpTransportClient`, and- `tinymcp_bus::McpAuthConfig` re-exported as `McpDefinitionAuth`. That is a- different type from OpenHuman's own `config::McpAuthConfig`, which is what- the TOML declares.--## Key types and entry points--- `McpHost` (`host.rs`) and `host::{init, for_config, try_service, service,- all_hosts}`.-- `host::client_config`, `host::static_registry`, `host::proxy_for_mcp`.-- `mcp::start`, `mcp::start_boot_jobs` (`mod.rs`).-- `registry::connections::{connected_overview,- connected_overview_for_config}`: the connected-server view the tool- registry and diagnostics read.-- `registry::types`: `InstalledServer`, `McpTool`, `ConnStatus` and the- catalog types, re-exported from `tinymcp_bus` (the Smithery names are- aliases for the contract's `Registry*` types).-- `server::{run_stdio_from_cli, run_http, ensure_local_http, tool_specs}`- (see [server/README.md](server/README.md)).--## RPC surface--Registered through [`core/all.rs`](../core/all.rs):--- `mcp_clients.*` ([`registry/schemas/`](./registry/schemas/)): `registry_search`,- `registry_get`, `registry_settings_get`, `registry_settings_set`,- `installed_list`, `config_get`, `config_set`, `update_env`, `uninstall`,- `set_enabled`, `detect_auth`, `oauth_begin`, `connect`, `disconnect`,- `status`, `list_tools`, `tool_call`. On the wire these are- `openhuman.mcp_clients_<function>`.-- `mcp_audit.list` ([`audit/schemas.rs`](./audit/schemas.rs)): rows from the write-audit log.--The `openhuman-core mcp` server is not an RPC domain. It is a CLI entry wired-through [`core/cli.rs`](../core/cli.rs) that translates each MCP `tools/call` into an existing-registered core RPC method.--Agent tools registered from this folder: `mcp_registry_search`,-`mcp_registry_get`, `mcp_registry_installed_list`, `mcp_registry_status`,-`mcp_registry_list_tools`, `mcp_registry_connect`,-`mcp_registry_disconnect`, `mcp_registry_tool_call` and-`mcp_registry_uninstall`, plus deferred per-action tools for installed-servers. There is no install tool: servers are added by the user in-`mcp.json`.+The module's wire vocabulary lives in `tinymcp-bus`. `mcp::module_client`+serializes access to the per-workspace configured object. `mcp::host` converts+OpenHuman configuration to bus DTOs and applies product proxy and credential+transport policy. Registry handlers and agent tools call module operations,+then translate outcomes into OpenHuman RPC results and domain events.++The local MCP server keeps its OpenHuman tool catalog, authorization policy,+write audit decisions, and RPC dispatch. TinyMCP owns the protocol session,+stdio/HTTP framing, HTTP session admission, and transport lifecycle. The host+passes requests and callbacks through bus operations rather than parsing MCP+protocol messages itself.++## Host responsibilities++- `host.rs` builds `McpClientConfig`, resolves the product proxy, refuses+ credentialed plaintext non-loopback HTTP, and selects the OAuth callback URL.+- `module_client.rs` owns workspace-scoped open, call, close, retry, and+ shutdown receipt handling. It also adapts the bus interface to host callers.+- `registry/` owns the product RPC schemas and outcomes, `mcp.json` editing,+ prompt-injection screening, permission/exposure mapping, and domain events.+ The module owns the catalogs, stores, connections, and supervisor.+- `audit/` exposes the module-owned write-audit records as OpenHuman RPC.+- `server/` owns the OpenHuman tool catalog and dispatch policy for the local+ MCP server. TinyMCP owns the wire protocol and session lifecycle.+- `tools/impl/network/` contains host tool adapters for configured MCP tools+ and the GitBooks docs tool. They use confidential bus calls and keep product+ approval checks on the host.++The static server set comes from OpenHuman config (`[[mcp_client.servers]]`).+The installed server set comes from the user's `mcp.json` document. The host+preserves the existing `mcp_clients.*` and `mcp_audit.*` RPC names and the+stdio/Streamable HTTP entry points while delegating protocol and server state+to the module.## Boundaries-- `tinymcp` ([`vendor/tinymcp`](../../../../vendor/tinymcp/), repo `tinyhumansai/tinymcp`) owns the- transports, handshakes, OAuth discovery, the dynamic registry and its- SQLite store, the supervisor, the write-audit store, and the generic server- half (`tinymcp::server`). Fix protocol or client behavior there and move the- gitlink.-- `tinymcp-bus` is the wire contract: payload types and member names with no- transport or runtime. It also generates the desktop settings schema. Never- redeclare its types here.-- `crate::config` owns `McpClientConfig`, `McpServerConfig` and- `McpAuthConfig`, which `host.rs` converts from.-- The `mcp_*` bridge tools over the static set live in- `tools/impl/network/`; MCP tools in the cross-surface discovery registry- are assembled by [`tools/registry/`](../tools/registry/).-- `tinymcp` is a path dependency on `vendor/tinymcp` with- `default-features = false` (see the `tinymcp` block in- [`crates/openhuman-core/Cargo.toml`](../../Cargo.toml) for why it is not the pinned release).- The loadable-module release pin is in- [`modules/registry/records_mcp_connectors.rs`](../modules/registry/records_mcp_connectors.rs).--## Gotchas--- The `mcp` feature gates `registry`, `audit` and `server`, each of which has- its own `stub.rs` so a build without the feature still serves `/rpc`- without those namespaces. `host` and `http_client` are ungated because the- startup path and always-on consumers reach them without a `cfg`.- `config_servers` is `#[cfg(feature = "mcp")]` with no stub.-- The server's HTTP transport also needs the `http-server` feature, which- forwards `tinymcp/server-http`.-- `host::try_service` returns `None` before boot. Code that can run early must- handle an absent service rather than build one.-- Rejected remote tools are published by rule code only. Do not add the- description text to logs or events; it is the dangerous payload.+- `tinymcp` owns MCP protocol, transports, registries, stores, server+ supervision, generic argument validation, rendering, and output scrubbing.+ Implement those capabilities in `vendor/tinymcp` and publish the owner+ release before changing its host pin.+- `tinymcp-bus` owns payload types and member names. Do not duplicate its wire+ DTOs in OpenHuman.+- OpenHuman owns configuration, credential custody, proxy policy, approvals,+ prompt-injection screening, product RPCs, and event mapping.+- Never send host credentials through an ordinary bus call. Operations that+ carry credentials or sensitive tool data must use TinyBus confidential+ delivery.+- Keep MCP user data and provider responses out of analytics. Logs must use+ the shared endpoint redactor and must not contain credentials or response+ payloads.## Tests-Each module has a sibling `*_tests.rs` ([`host_tests.rs`](./host_tests.rs), and the suites under-`registry/`, `audit/` and `server/`, including the wire and HTTP golden tests-in `server/`). Run with `cargo test -p openhuman mcp::` or-`pnpm debug rust mcp`, and check the disabled build with-`cargo check --no-default-features`.--## Further reading+The module owns protocol and generic MCP behavior tests. OpenHuman tests cover+host policy, bus lifecycle/retry behavior, tool mapping, and product RPCs. Run+the focused host tests with `cargo test -p openhuman --features modules,mcp+mcp::`, and check that the normal graph does not include the implementation+with `scripts/assert-shed.sh default tinymcp`.-- [Parent module README](../../README.md)-- [MCP servers and skills](../../../../gitbooks/features/integrations/mcp-and-skills.md)-- [MCP registry](../../../../gitbooks/developing/architecture/mcp-registry.md)-- [MCP server](../../../../gitbooks/developing/mcp-server.md)-- [tinymcp](../../../../vendor/tinymcp/README.md)+Further reading: [MCP registry](../../../../gitbooks/developing/architecture/mcp-registry.md),+[MCP server](../../../../gitbooks/developing/mcp-server.md), and+[`tinymcp`](../../../../vendor/tinymcp/README.md).diff --git a/crates/openhuman-core/src/mcp/registry/README.md b/crates/openhuman-core/src/mcp/registry/README.mdindex 6fe1cbd1d7..e907fbafd3 100644--- a/crates/openhuman-core/src/mcp/registry/README.md+++ b/crates/openhuman-core/src/mcp/registry/README.md@@ -1,164 +1,57 @@-# mcp/registry: user-declared MCP servers+# MCP registry host adapter-Host half of the dynamic, user-declared MCP server surface. The registry-itself (the Smithery and official catalogs, the SQLite store, the live-connection map, and the subprocess/browser-sign-in supervisor) moved to-[`tinymcp`](https://github.com/tinyhumansai/tinymcp). What is left here is-what belongs to this application: the `mcp_clients` RPC surface, the-`mcp.json` document that is the only way a server is added or removed, the-agent-facing tools, the prompt-injection scan over remote tool definitions,-and turning what the reconnect supervisor observed into this application's-own events.+This module preserves OpenHuman's `mcp_clients` RPC and agent-tool surface+while delegating registry behavior to TinyMCP over `tinymcp-bus`. TinyMCP owns+the catalogs, installed-server store, connections, OAuth protocol, and reconnect+supervisor. OpenHuman owns product RPC schemas, configuration custody,+permission and exposure mapping, prompt-injection screening, and conversion of+module outcomes into domain events.-There is no install-from-catalog RPC, no install tool and no setup agent. In-the Registry tab, a hosted server that needs no setup is added in one click:-the app declares it in `mcp.json` through `config_get` / `config_set`. Any-other server opens its own page, and the user declares it in `mcp.json`.--The RPC namespace and the on-disk database filename are still `mcp_clients`,-unchanged across the move, existing frontend code and existing on-disk state-keep working. The Rust module path is `crate::mcp::registry`.+The RPC namespace and on-disk `mcp_clients` name remain stable. Servers are+added through the user's `mcp.json` document; there is no install-from-catalog+RPC or agent install tool.## Key files| File | Role || --- | --- |-| [`mod.rs`](./mod.rs) | Module declarations, the `connections`/`store`/`boot`/`supervisor`/`oauth` re-export facades, and `tools_safe_for_agent` (the prompt-injection scan). |-| [`ops.rs`](./ops.rs) / [`ops_tests.rs`](./ops_tests.rs) | `mcp_clients_*` RPC handler bodies, each delegates to the service `mcp::host` holds. |-| [`config_ops.rs`](./config_ops.rs) | `mcp_clients_config_get` / `config_set`: the `RpcOutcome` envelope, domain events and background connects over `tinymcp`'s `McpRegistry::render_config_doc` / `apply_config_doc` (the `mcp.json` contract and reconciliation live in `tinymcp::registry::config_doc`). |-| `schemas/` (`mod.rs`, `registry.rs`, `handlers.rs`, `params.rs`), [`schemas_tests.rs`](./schemas_tests.rs) | Controller schema registry and dispatch. |-| [`supervisor_events.rs`](./supervisor_events.rs) / [`supervisor_events_tests.rs`](./supervisor_events_tests.rs) | Maps a supervisor tick's `TickReport` into `DomainEvent`s. |-| [`bus.rs`](./bus.rs) / [`bus_tests.rs`](./bus_tests.rs) | `McpClientEventSubscriber`: logs lifecycle events for observability. |-| [`tools.rs`](./tools.rs) / [`tools_tests.rs`](./tools_tests.rs) | Agent-facing `mcp_registry_*` tools: adapters over `tinymcp_bus::agent_tools::RegistryTool` specs (name, description, schema are the contract's), mapping effect to permission/exposure and executing through `ops.rs`. |-| [`action_tool.rs`](./action_tool.rs) / [`action_tool_tests.rs`](./action_tool_tests.rs) | One deferred agent tool per action on a connected server, built from `tinymcp_bus::agent_tools::action_tool_specs` with `tools_safe_for_agent` as the admission filter; execution re-checks the current connection and routes through `ops.rs`. |-| [`helpers.rs`](./helpers.rs) | Shared identifier validation, workspace-service resolution, and env-key injection used by the handlers. |-| [`stub.rs`](./stub.rs) | The `mcp`-less mirror of the always-on surface: `all_mcp_registry_registered_controllers` (empty), `boot`, `bus`, `supervisor`, `oauth`, and the three `connections` lookups always-on callers name. |--## Modules re-exported over `tinymcp`--`mod.rs` defines several thin facade modules rather than fresh logic:--- `types`: the payload vocabulary, entirely re-exported from `tinymcp_bus`- (`InstalledServer`, `McpTool`, `ConnStatus`, `Transport`, the Smithery- catalog types, …). A parallel set of types here would mean a conversion at- every call site that nothing checks.-- `connections`: a thin view over the live connection map the `mcp::host`- service holds: `connected_overview[_for_config]`,- `all_connected_tools[_for_config]`, `tools_for`/`server_tools_for_config`,- `is_connected_for_config`, `auth_hint_for_config`, `connect`,- `disconnect_for_config`, `last_error_for_config`. Every lookup answers- "nothing" (empty list / `false` / `None`) when the workspace has no open- host yet, rather than erroring; only `connect` returns an error in that- case.-- `boot`: `spawn_installed_servers`, connecting every enabled installed- server at startup; never fails (a broken third-party server is logged and- skipped).-- `supervisor`: `run()`, the reconnect-supervisor loop: one task per- process, walking every workspace host the process has opened each tick.-- `oauth`: `complete`, finishing a browser sign-in from the redirect- callback and reconnecting the server.--## RPC surface--`ops.rs` implements the `mcp_clients` namespace: `registry_search`,-`registry_get`, `installed_list`, `update_env`, `uninstall`, `detect_auth`,-`oauth_begin`, `connect`, `disconnect`, `status`, `tool_call`,-`registry_settings_get`, `registry_settings_set`, `set_enabled`.-`config_ops.rs` adds `config_get` and `config_set`: the `mcp.json`-document. All are registered by `schemas::all_registered_controllers`-([`schemas/registry.rs`](./schemas/registry.rs)).--`config_set` is a *replace*: a server absent from the document is-uninstalled, a new one is inserted as an `InstalledServer` built straight-from its declaration (`command`/`args` → stdio, `url` → HTTP-remote), and one-whose dial changed is rewritten under the same `server_id` so the row the-frontend and the connection map address stays the same row. Credentials are-the exception: `env` (stdio) and `headers` (HTTP) are write-only, a read-renders only `envKeys` and `authConfigured`: so an entry saved without a-credential block keeps what is stored, and a key set to `""` removes that one-value. Enabled servers that were added or rewritten are connected in the-background; the status poll reports the outcome.--What stayed host-side inside these handlers, on purpose:--- **Events**: `tinymcp` reports outcomes in its return values and publishes- nothing; the handlers turn those into `DomainEvent`s because the vocabulary- is this application's.-- **The prompt-injection scan**: `tools_safe_for_agent` filters remote tool- definitions before they reach the agent.-- **The document**: `tinymcp` has no notion of `mcp.json`; the shape, the- refusals and the reconciliation are this application's.--## Reconnect-supervisor events--`supervisor_events::domain_events_for` maps each `TickReport` from-`tinymcp::Supervisor::tick` into `DomainEvent`s in the `mcp_client` domain:-`McpServerProbeTimedOut`, `TransportDropped`, `Reconnected`,-`ReconnectFailed`, `Parked`. Every event is stamped with the workspace whose-host was ticked, because one process supervises every workspace it has-opened over its life and a subscriber persisting an event (the notification-bridge) needs to file it under the right one. An answered probe, the-nominal case, is deliberately not an event; `tinymcp` logs it at trace-level. These events reach the developer Event Log (`GET /events/domain`) and,-for the stays-down/restored/parked cases, the desktop notification bridge.--## Agent tools--`tools.rs` exposes `mcp_registry_search`, `mcp_registry_get`,-`mcp_registry_installed_list`, `mcp_registry_status`,-`mcp_registry_list_tools`, `mcp_registry_connect`,-`mcp_registry_disconnect`, `mcp_registry_tool_call`,-`mcp_registry_uninstall`: thin shims over `ops.rs`. Discovery/observe/-connect/call tools are default-ON; `uninstall` (a persistent write of-installed state) ships default-OFF, gated behind the `mcp_manage` toggle in-[`tools/user_filter.rs`](../../tools/user_filter.rs). There is no install tool: servers are declared by-the user in `mcp.json`. Re-exported by [`tools/mod.rs`](../../tools/mod.rs) behind-`#[cfg(feature = "mcp")]`. The generic `mcp_list_servers`/`mcp_call_tool`-bridge tools live elsewhere and are a distinct surface from these-`mcp_registry_*` tools.--## Compile-time gate (`mcp` feature)--Every member above except `types` is gated on the `mcp` feature; with it-off, `stub.rs` mirrors the always-on surface with empty/no-op bodies.-`types` stays ungated so `ConnectedServerOverview` and `McpTool` are the-same real type in both builds.--## Dependencies--- `tinymcp` / `tinymcp_bus`: the extracted registry library and its wire- contract.-- `crate::mcp::host`: the per-workspace service holder every function here- resolves through.-- `crate::core::bus` / `crate::core::events`: `DomainEvent` publishing.-- `crate::security::prompt_injection`: `scan_tool_definition`, used by- `tools_safe_for_agent`.--## Used by--- [`crates/openhuman-core/src/core/all.rs`](../../core/all.rs) (~line 444), registers- `all_mcp_registry_registered_controllers()`.-- [`crates/openhuman-core/src/mcp/mod.rs`](../mod.rs): `start`/`start_boot_jobs` wire up- `bus::init()`, `boot::spawn_installed_servers`, and the reconnect- supervisor.-- `tinymcp`'s live connection map is the process cache: startup connects- installed servers, and connect, disconnect, config updates, and reconnects- update the map. `connected_overview()` reads tool snapshots from that map;- it does not call an MCP server on each chat turn.-- [`crates/openhuman-rpc/src/server/http/oauth_mcp.rs`](../../../../openhuman-rpc/src/server/http/oauth_mcp.rs): the `/oauth/mcp/callback`- route calls `oauth::complete`.-- [`crates/openhuman-core/src/tools/registry/ops.rs`](../../tools/registry/ops.rs) and- [`crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs`](../../agent/registry/agents/orchestrator/prompt.rs):- read `mcp::registry::connections` to list connected servers/tools for the- tool catalog and the orchestrator prompt.-- `crates/openhuman-core/src/agent/session_host/turn/core_turn.rs`: reads- `connections::connected_overview()` when assembling a turn.-- [`crates/openhuman-core/src/platform/about_app/catalog_auth_channels_team.rs`](../../platform/about_app/catalog_auth_channels_team.rs): the- `channels.mcp_registry_browse` / `mcp_server_install` /- `mcp_server_connect` capability entries.--## Further reading--- [Parent module README](../README.md)-- [MCP registry](../../../../../gitbooks/developing/architecture/mcp-registry.md)-- [MCP servers and skills](../../../../../gitbooks/features/integrations/mcp-and-skills.md)+| [`mod.rs`](./mod.rs) | Bus-backed registry facade, contract re-exports, and `tools_safe_for_agent` prompt-injection filter. |+| [`ops.rs`](./ops.rs) / [`ops_tests.rs`](./ops_tests.rs) | `mcp_clients_*` handlers and domain event mapping. |+| [`config_ops.rs`](./config_ops.rs) | `config_get` / `config_set` host adapter for the module-owned `mcp.json` document. |+| `schemas/` and [`schemas_tests.rs`](./schemas_tests.rs) | OpenHuman controller schemas and dispatch. |+| [`supervisor_events.rs`](./supervisor_events.rs) / tests | Converts module supervisor reports into OpenHuman domain events. |+| [`bus.rs`](./bus.rs) / tests | Logs lifecycle events for observability. |+| [`tools.rs`](./tools.rs) / tests | Maps module-provided registry tool specs to OpenHuman permissions and dispatch. |+| [`action_tool.rs`](./action_tool.rs) / tests | Builds deferred installed-server action tools and rechecks admission before execution. |+| [`helpers.rs`](./helpers.rs) | Product identifier validation, workspace config selection, and environment-key injection. |+| [`stub.rs`](./stub.rs) | Empty/no-op registry facade when the `mcp` feature is disabled. |++## Behavior and boundaries++`ops.rs` and `config_ops.rs` call the configured TinyMCP object through+`mcp::module_client`. The host does not retain a second registry or connection+map. Calls that carry credentials use confidential TinyBus delivery; ordinary+calls must not be used for secrets. The module manages protocol state and+reports typed outcomes. The host translates those outcomes into OpenHuman's+RPC response shape and domain events.++`tools_safe_for_agent` is intentionally host-owned because it is the product's+prompt-injection policy. Remote descriptions and schemas are scrubbed by the+module before the host sees them; the host then applies this admission filter+before advertising a tool. Execution rechecks that the configured tool is+still present and safe.++`config_set` retains its replace semantics and existing credentials behavior:+environment values and HTTP headers remain write-only, while reads expose+environment key names and whether authentication is configured. The host+preserves user-facing policy and event behavior; document parsing, persistence,+reconciliation, and connection changes belong to TinyMCP.++The module's wire DTOs and operation names come from `tinymcp-bus`. Put protocol,+store, catalog, connection, OAuth, supervisor, or generic tool behavior in+`vendor/tinymcp`; update the OpenHuman submodule pin only to a published,+verified compatible release.++Run the host-focused suite with `cargo test -p openhuman --features modules,mcp+mcp::registry::`, and test the disabled feature build with+`cargo check -p openhuman --no-default-features`.diff --git a/crates/openhuman-core/src/mcp/registry/mod.rs b/crates/openhuman-core/src/mcp/registry/mod.rsindex 1808c5ada5..a8e88790d2 100644--- a/crates/openhuman-core/src/mcp/registry/mod.rs+++ b/crates/openhuman-core/src/mcp/registry/mod.rs@@ -1,22 +1,18 @@-//! MCP Registry — the host half of the user-installed server surface.+//! MCP Registry — the host adapter for user-installed servers.//!-//! The registry itself moved to `tinymcp`: the Smithery and official catalogs,-//! the SQLite store, the live connection map, the subprocess supervisor and the-//! browser sign-in flow all live there now. What is left here is what belongs-//! to *this* application. A server is declared in the user's `mcp.json`-//! (`tinymcp::registry::config_doc`); there is no install-from-catalog RPC. The-//! app's Registry tab declares a hosted server there in one step.+//! TinyMCP owns the catalogs, store, connections, protocol, supervisor, OAuth,+//! and `mcp.json` document behavior. This module owns the OpenHuman RPC and+//! agent-tool surface, product admission policy, and event translation. A+//! server is declared in the user's `mcp.json`; there is no install-from-catalog+//! RPC.//!//! # Modules//!//! - [`bus`] — the lifecycle subscriber that logs this domain's events.-//! - [`store`] — the one direct reach into the registry's store that outlives-//! the extraction: an end-to-end test seeding the upstream response cache.-//! - [`ops`] — the `mcp_clients` RPC handlers, delegating to the service-//! [`super::host`] holds and publishing this application's own events.+//! - [`ops`] — the `mcp_clients` RPC handlers, calling the module and+//! publishing this application's own events.//! - [`config_ops`] — the `config_get` / `config_set` handlers over the-//! `mcp.json` document; the document contract and the reconciliation are-//! `tinymcp::registry::config_doc`.+//! module-owned `mcp.json` document.//! - `schemas` — the controller schemas and dispatch.//! - [`supervisor_events`] — what the reconnect supervisor observed each//! tick, as this domain's events; the Event Log and the notification bridge@@ -31,10 +27,8 @@//!//! # Types come from the contract//!-//! Everything this module used to define — the install record, the tool shape,-//! the status summary, the catalog records — is re-exported from-//! `tinymcp_bus`. A parallel set of types here would mean a conversion at every-//! call site that nothing checks.+//! Registry payloads are re-exported from `tinymcp_bus`. A parallel set of+//! types here would mean a conversion at every call site that nothing checks.#[cfg(feature = "mcp")]pub mod action_tool;@@ -74,14 +68,11 @@ pub mod types {pub use types::{ConnStatus, InstalledServer, McpTool};-/// The live connection map.+/// Typed views over the module-owned live connection state.///-/// A thin view over the service [`super::host`] holds. It exists because the-/// map used to be a process global and callers reached it through free-/// functions; `tinymcp` owns it instead, so those functions become lookups-/// through the holder. Everything here answers as though nothing were connected-/// when the service is not up yet, which is what a caller running before boot-/// completes should see.+/// These adapters query TinyMCP over the bus. Before the module is available,+/// read-only lookups report the empty state expected by callers that run before+/// boot completes.#[cfg(feature = "mcp")]pub mod connections {use crate::config::Config;diff --git a/vendor/tinymcp b/vendor/tinymcpindex 40d6001ad2..f18c189390 160000--- a/vendor/tinymcp+++ b/vendor/tinymcp@@ -1 +1 @@-Subproject commit 40d6001ad29092b71e5cb6fa6f9ea0fd5c38f5e6+Subproject commit f18c189390e57cd5d4f304f896bce65cf2105b36