diff --git a/app/src/services/__tests__/rpcMethods.test.ts b/app/src/services/__tests__/rpcMethods.test.ts index 3f669e7f03..54d266f3b2 100644 --- a/app/src/services/__tests__/rpcMethods.test.ts +++ b/app/src/services/__tests__/rpcMethods.test.ts @@ -53,6 +53,48 @@ describe('rpcMethods catalog', () => { ); }); + describe('MCP client legacy alias resolution (Sentry CORE-RUST-DW/DV/DT/DS/DR)', () => { + test('mcp_clients.list resolves to mcp_clients_installed_list', () => { + expect(normalizeRpcMethod('mcp_clients.list')).toBe(CORE_RPC_METHODS.mcpClientsInstalledList); + }); + + test('openhuman.mcp_clients_list resolves to mcp_clients_installed_list', () => { + expect(normalizeRpcMethod('openhuman.mcp_clients_list')).toBe( + CORE_RPC_METHODS.mcpClientsInstalledList + ); + }); + + test('openhuman.mcp_list resolves to mcp_clients_installed_list', () => { + expect(normalizeRpcMethod('openhuman.mcp_list')).toBe( + CORE_RPC_METHODS.mcpClientsInstalledList + ); + }); + + test('openhuman.mcp_servers_list resolves to mcp_clients_installed_list', () => { + expect(normalizeRpcMethod('openhuman.mcp_servers_list')).toBe( + CORE_RPC_METHODS.mcpClientsInstalledList + ); + }); + + test('openhuman.tool_registry_call resolves to mcp_clients_tool_call', () => { + expect(normalizeRpcMethod('openhuman.tool_registry_call')).toBe( + CORE_RPC_METHODS.mcpClientsToolCall + ); + }); + + test('canonical mcp_clients_installed_list passes through unchanged', () => { + expect(normalizeRpcMethod('openhuman.mcp_clients_installed_list')).toBe( + 'openhuman.mcp_clients_installed_list' + ); + }); + + test('canonical mcp_clients_tool_call passes through unchanged', () => { + expect(normalizeRpcMethod('openhuman.mcp_clients_tool_call')).toBe( + 'openhuman.mcp_clients_tool_call' + ); + }); + }); + test('catalog canonical methods exist in core schema registry (drift guard)', () => { const schemaSources = [ fs.readFileSync( @@ -75,6 +117,10 @@ describe('rpcMethods catalog', () => { path.resolve(__dirname, '../../../../src/openhuman/embeddings/schemas.rs'), 'utf8' ), + fs.readFileSync( + path.resolve(__dirname, '../../../../src/openhuman/mcp_registry/schemas.rs'), + 'utf8' + ), fs.readFileSync( path.resolve(__dirname, '../../../../src/openhuman/health/schemas.rs'), 'utf8' @@ -93,9 +139,11 @@ describe('rpcMethods catalog', () => { ? 'embeddings' : methodRoot.startsWith('providers_') ? 'providers' - : methodRoot.startsWith('health_') - ? 'health' - : 'config'; + : methodRoot.startsWith('mcp_clients_') + ? 'mcp_clients' + : methodRoot.startsWith('health_') + ? 'health' + : 'config'; const fnName = methodRoot.slice(`${namespace}_`.length); expect(schemaSources).toContain(`namespace: "${namespace}"`); expect(schemaSources).toContain(`function: "${fnName}"`); diff --git a/app/src/services/rpcMethods.ts b/app/src/services/rpcMethods.ts index f6b665ea29..0086744b9e 100644 --- a/app/src/services/rpcMethods.ts +++ b/app/src/services/rpcMethods.ts @@ -35,12 +35,21 @@ export const CORE_RPC_METHODS = { embeddingsClearApiKey: 'openhuman.embeddings_clear_api_key', embeddingsEmbed: 'openhuman.embeddings_embed', embeddingsTestConnection: 'openhuman.embeddings_test_connection', + mcpClientsInstalledList: 'openhuman.mcp_clients_installed_list', + mcpClientsToolCall: 'openhuman.mcp_clients_tool_call', healthSnapshot: 'openhuman.health_snapshot', } as const; export type CoreRpcMethod = (typeof CORE_RPC_METHODS)[keyof typeof CORE_RPC_METHODS]; export const LEGACY_METHOD_ALIASES: Record = { + // MCP clients — old method names that appeared in Sentry (CORE-RUST-DR/DS/DT/DV/DW). + // See src/core/legacy_aliases.rs for the Rust-side mirror of this table. + 'mcp_clients.list': CORE_RPC_METHODS.mcpClientsInstalledList, + 'openhuman.mcp_clients_list': CORE_RPC_METHODS.mcpClientsInstalledList, + 'openhuman.mcp_list': CORE_RPC_METHODS.mcpClientsInstalledList, + 'openhuman.mcp_servers_list': CORE_RPC_METHODS.mcpClientsInstalledList, + 'openhuman.tool_registry_call': CORE_RPC_METHODS.mcpClientsToolCall, 'openhuman.get_analytics_settings': CORE_RPC_METHODS.configGetAnalyticsSettings, 'openhuman.get_composio_trigger_settings': CORE_RPC_METHODS.configGetComposioTriggerSettings, 'openhuman.get_config': CORE_RPC_METHODS.configGet, diff --git a/src/core/legacy_aliases.rs b/src/core/legacy_aliases.rs index 644e392c1c..c3196bf4e1 100644 --- a/src/core/legacy_aliases.rs +++ b/src/core/legacy_aliases.rs @@ -21,6 +21,13 @@ /// Order doesn't matter for correctness, but is kept alphabetical by legacy /// key for easier diffing against the frontend table. const LEGACY_ALIASES: &[(&str, &str)] = &[ + // MCP clients — old method names that appeared in Sentry (CORE-RUST-DR/DS/DT/DV/DW). + // Callers used dotted namespace, bare `mcp_list`, `mcp_servers_list`, and + // `mcp_clients_list` before the canonical `mcp_clients_installed_list` was + // introduced in PR #2409. `tool_registry_call` was an early mis-spelling of + // `mcp_clients_tool_call` that shipped in at least one older bundle. + // `mcp_clients.list` sorts before all `openhuman.*` entries (m < o). + ("mcp_clients.list", "openhuman.mcp_clients_installed_list"), ( "openhuman.get_analytics_settings", "openhuman.config_get_analytics_settings", @@ -34,11 +41,24 @@ const LEGACY_ALIASES: &[(&str, &str)] = &[ "openhuman.get_runtime_flags", "openhuman.config_get_runtime_flags", ), + ( + "openhuman.mcp_clients_list", + "openhuman.mcp_clients_installed_list", + ), + ("openhuman.mcp_list", "openhuman.mcp_clients_installed_list"), + ( + "openhuman.mcp_servers_list", + "openhuman.mcp_clients_installed_list", + ), ("openhuman.ping", "core.ping"), ( "openhuman.set_browser_allow_all", "openhuman.config_set_browser_allow_all", ), + ( + "openhuman.tool_registry_call", + "openhuman.mcp_clients_tool_call", + ), ( "openhuman.update_analytics_settings", "openhuman.config_update_analytics_settings",