You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "Shkin1 (via GitHub)" <gi...@apache.org> on 2026/08/31 08:03:55 UTC

[I] bug(desktop): MCP proxy tools crash capability refresh because native provider requires Zod schema [maka]

Shkin1 opened a new issue, #4334:
URL: https://github.com/apache/maka/issues/4334

   ### What happened
   
   
   When Maka Desktop refreshes MCP capabilities, the runtime host crashes while loading MCP proxy tools such as `mcp__memory__create_entities`.
   
   The native capability layer currently treats every tool `parameters` value as a Zod schema, but MCP proxy tools are built with `ai.jsonSchema()` wrappers instead. As a result, capability refresh fails with:
   
   - `Desktop native capability tool has an invalid schema: mcp__memory__create_entities`
   
   - `RuntimeHostProtocolError: Invalid inputSchema`
   
   This breaks the desktop startup flow and leaves the UI showing a generic error/toast instead of loading normally.
   
   
   ### How to reproduce
   
   1. Configure Maka with an MCP server that exposes memory tools.
   2. Launch Maka Desktop.
   3. Let the runtime host load MCP capabilities.
   4. Notice that startup fails when `mcp__memory__create_entities` is processed.
   5. Check the logs for `Desktop native capability tool has an invalid schema`.
   
   ### Environment
   
   - Maka: 0.2.0
   - Build: dev
   - Electron: 43.4.1
   - Node: 24.18.1
   - OS: Windows 11
   - Locale: zh-CN
   - Renderer locale: zh-CN
   
   ### Logs, screenshots, or additional context
   
   Relevant log excerpt:
   
   `Desktop native capability tool has an invalid schema: mcp__memory__create_entities`
   
   This happens because `packages/runtime/src/mcp-tools.ts` builds MCP proxy tools with `ai.jsonSchema(descriptor.inputSchema)`, while `apps/desktop/src/main/runtime-host-native-capabilities.ts` currently expects `tool.parameters` to be a Zod schema instance.
   
   A local fix that accepts MCP JSON Schema wrappers and cleans the schema for capability transport restores startup successfully.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] bug(desktop): MCP proxy tools crash capability refresh because native provider requires Zod schema [maka]

Posted by "Shkin1 (via GitHub)" <gi...@apache.org>.
Shkin1 commented on issue #4334:
URL: https://github.com/apache/maka/issues/4334#issuecomment-5489509463

   > [@Shkin1](https://github.com/Shkin1) are you still working on this? I don't want to duplicate your effort.
   > 
   > I arrived at this issue independently and have a fix that passes locally, but you called it first, so it's yours if you're still on it. Two findings from my run that may save you time either way:
   > 
   > 1. The Zod assumption breaks the **call path** as well, not only capability refresh. `invokeNativeTool` (`apps/desktop/src/main/runtime-host-native-capabilities.ts:332`) also goes through `requireZodSchema` before `parseAsync`, so a fix that only repairs `toolInputSchema` publishes the offer and then fails every MCP tool invocation.
   > 2. Accepting the `jsonSchema()` wrapper is not sufficient on its own — that is where the reported `RuntimeHostProtocolError: Invalid inputSchema` comes from. `validateToolInputSchema` admits a closed keyword allowlist (`packages/runtime-host/src/protocol/client-capability.ts`), and ordinary MCP server schemas carry `$schema`, `$id`, `patternProperties` and similar. The published schema has to be projected onto that vocabulary before it can ride a capability offer.
   > 
   > If you'd rather hand it over, or if I don't hear back in the next couple of days, I'll post `take` and open a PR. Happy either way — just say the word.
   > 
   > _Disclosure: this comment and the accompanying analysis were produced with Claude Code (Claude Opus 5); I am the human contributor of record and have reviewed them._
   
   Thanks for the extra notes — I’m still actively working on this, and I’ll make sure both points are handled together.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] bug(desktop): MCP proxy tools crash capability refresh because native provider requires Zod schema [maka]

Posted by "Shkin1 (via GitHub)" <gi...@apache.org>.
Shkin1 commented on issue #4334:
URL: https://github.com/apache/maka/issues/4334#issuecomment-5475566700

   I can take this bug and work on a fix. I have already reproduced the issue locally and identified the schema contract mismatch between MCP proxy tools and the desktop native capability layer.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] bug(desktop): MCP proxy tools crash capability refresh because native provider requires Zod schema [maka]

Posted by "lizheng220 (via GitHub)" <gi...@apache.org>.
lizheng220 commented on issue #4334:
URL: https://github.com/apache/maka/issues/4334#issuecomment-5488586299

   @Shkin1 are you still working on this? I don't want to duplicate your effort.
   
   I arrived at this issue independently and have a fix that passes locally, but you called it first, so it's yours if you're still on it. Two findings from my run that may save you time either way:
   
   1. The Zod assumption breaks the **call path** as well, not only capability refresh. `invokeNativeTool` (`apps/desktop/src/main/runtime-host-native-capabilities.ts:332`) also goes through `requireZodSchema` before `parseAsync`, so a fix that only repairs `toolInputSchema` publishes the offer and then fails every MCP tool invocation.
   
   2. Accepting the `jsonSchema()` wrapper is not sufficient on its own — that is where the reported `RuntimeHostProtocolError: Invalid inputSchema` comes from. `validateToolInputSchema` admits a closed keyword allowlist (`packages/runtime-host/src/protocol/client-capability.ts`), and ordinary MCP server schemas carry `$schema`, `$id`, `patternProperties` and similar. The published schema has to be projected onto that vocabulary before it can ride a capability offer.
   
   If you'd rather hand it over, or if I don't hear back in the next couple of days, I'll post `take` and open a PR. Happy either way — just say the word.
   
   _Disclosure: this comment and the accompanying analysis were produced with Claude Code (Claude Opus 5); I am the human contributor of record and have reviewed them._
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] bug(desktop): MCP proxy tools crash capability refresh because native provider requires Zod schema [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han closed issue #4334: bug(desktop): MCP proxy tools crash capability refresh because native provider requires Zod schema
URL: https://github.com/apache/maka/issues/4334


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org