MoonshotAI / MoonshotAI/kimi-code
Bug: MCP tools with top-level oneOf inputSchema receive empty args ({}), rejected by local validation (CLI 0.40.1)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
Bug Report: kimi-cu-win MCP tools with top-level oneOf schema receive empty args ({}) — client-side validation rejects all calls
Summary
When calling kimi-cu-win MCP tools whose inputSchema uses a top-level oneOf (e.g. get_app_state, activate_window, click, scroll, drag), the arguments emitted by the model are dropped before reaching the MCP server: the session wire log records "args":{}, and the call fails local validation with:
Invalid args for tool "mcp__kimi-cu__get_app_state": must have required property 'pid';
must have required property 'app'; must have required property 'window_id';
must match exactly one schema in oneOf
Tools whose schema has top-level required fields (e.g. type_text with snapshot_id/text) pass arguments through correctly and reach the MCP runtime, so the issue is specific to schemas where required exists only inside oneOf branches.
Environment
- Kimi Code CLI: 0.40.1 (standalone install at
~/.kimi-code/bin/kimi, Windows) - OS: Windows 11 (10.0.26200)
- Plugin:
kimi-cu-win0.2.17; runtimekimi-cu.exe0.2.17 (doctorall green, agent running)
Evidence
-
Wire log (
wire.jsonl) shows the model's tool calls arrive at the harness with empty args:"mcp__kimi-cu__get_app_state","args":{},"time":1788920322774 "mcp__kimi-cu__get_app_state","args":{},"time":1788920333296 ... "mcp__kimi-cu__type_text","args":{"snapshot_id":"diag-probe","text":"probe"},"time":1788921554319get_app_state/activate_window: every attempt (8+) recordedargs:{}→ rejected by local schema validation, never reached the MCP server.type_text(top-levelrequired: ["snapshot_id","text"]): args passed through, reached the runtime, and got a real runtime error (type_text requires a target window...), proving the transport works.
-
Runtime is healthy and the same call works when sent directly: piping JSON-RPC over stdio into
kimi-cu.exe mcp:{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_app_state","arguments":{"window_id":65948,"mode":"text","max_chars":500}}}returns a full, valid
get_app_stateresult. So the runtime, plugin manifest, and MCP server are all fine — arguments are lost in the CLI harness layer.
Affected tools
All kimi-cu-win tools with top-level oneOf and no top-level required: get_app_state, activate_window, click, scroll, select_text, drag (and possibly MCP tools from other servers with the same schema shape).
Steps to reproduce
- Install kimi-cu-win plugin 0.2.17 + runtime 0.2.17 on Windows, CLI 0.40.1.
- In a session, call
mcp__kimi-cu__get_app_statewith{"window_id": <any valid HWND>}. - Observe
Invalid args ... must match exactly one schema in oneOf, and"args":{}inwire.jsonl.
Suspected cause
The CLI's MCP tool-schema handling (validation and/or the schema presented to the model) mishandles top-level oneOf when required is declared only inside branches — arguments not matching a flattened property set are stripped, so the validator then sees {} and reports every branch's required as missing.
Attachments
- Debug ZIP exported via
kimi export(containswire.jsonlwith the evidence above).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the CLI's MCP tool-schema handling, especially the validation or model-schema path for tools using a top-level oneOf. Reproduce with get_app_state and compare its empty args with type_text's preserved arguments; done means branch arguments reach validation and the MCP server without breaking existing top-level required schemas.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100