Skip to content

[Bug] 2.6.3: MCP tools are registered but never reach the model — every mcp__* tool is missing from tools[] (regression vs 2.5.3) #5083

Open

Description

@defaultuser233

Summary

Since 2.6.3, tools coming from an MCP server are registered by the CLI but never reach the model: the LLM request contains zero mcp__* entries, so the agent cannot call any MCP tool at all. The exact same configuration works on 2.5.3.

This is not specific to deferred / default_deferred / the tool-select experimental flag — with a completely default config.toml and a default mcp.json (no deferred field at all), MCP tools are still dropped in 2.6.3.

Environment

  • Kimi Code CLI 2.6.3 (regression) — 2.5.3 works with a byte-identical config

  • Platform: Linux 5.10.246-android12-9-g9c94fefc2317-dirty aarch64 unknown (Android 16 / Termux, CLI launched through the Termux glibc loader)

  • Subscription: custom OpenAI-compatible gateway (no managed Kimi Code plan)

  • Model: custom gateway model, capabilities = ["image_in", "thinking", "tool_use"] (no dynamically_loaded_tools)

  • MCP server: one HTTP server in ~/.kimi-code/mcp.json:

    { "mcpServers": { "mt": { "url": "http://127.0.0.1:8787/mcp" } } }

    67 tools. The server itself is healthy — initialize, tools/list and tools/call all succeed over raw JSON-RPC (curl).

Steps to reproduce

  1. Install 2.5.3, configure the MCP server as above, run a one-shot prompt (kimi -p "...") → the agent has all 67 MCP tools.
  2. Upgrade to 2.6.3, run the same command with the same config → the agent has 0 MCP tools.

Both runs are print mode against the same MCP server, same model, same config.toml.

Actual behaviour

Session journal agents/main/wire.jsonl of the 2.6.3 run:

record content
mcp.tools_discovered 67 tools discovered, all enabled
tool_select.initialized 94 entries = 27 built-in + 67 mcp__mt__*; every MCP entry carries "source": "mcp", "origin": "initial", "disclosure": "inline"
llm.tools_snapshot 26 entries — built-in only, zero mcp__* entries

So the registry knows about the tools and reports them as active, but the request that reaches the provider carries none of them. The schemas are absent, so the model cannot call them even by name.

The same journal on 2.5.3 shows llm.tools_snapshot with 93 entries = 26 built-in + 67 MCP.

Expected behaviour

Per docs/en/customization/mcp.md:

By default, every tool of a server goes straight into the model's top-level tool list.

Servers without deferred take the global default (false unless changed).

With no deferred field in mcp.json and no [mcp] default_deferred in config.toml, all 67 tools must be present in the request's tools[].

Things I tried that did not help

  • Adding dynamically_loaded_tools to the model's capabilities → still 26 tools / 0 MCP.
  • Enabling the experimental tool-select (KIMI_CODE_EXPERIMENTAL_TOOL_SELECT=1) → 27 tools (select_tools is added), still 0 MCP, and the session is told "No tools are currently available for dynamic loading in this session."
  • Moving the server to a project-level .kimi-code/mcp.json with KIMI_CODE_TRUST_WORKSPACE=1 → still 26 / 0.
  • Adding an explicit global allowlist [tools] enabled = [..., "mcp__mt__mt_apk_build"] → still 26 / 0.
  • The MCP server itself is not at fault: a raw tools/call for mt_apk_workspace_list / mt_apk_list_installed_apps returns correct results at the same moment the CLI is dropping the tools.

Where I would look

In packages/agent-core-v2 the request tool list is assembled through the tool-select service, and 2.6.3 changed that path — the 2.5.3 bundle contains no requestTools( at all:

  • toolSelectService.requestTools(base, disclosure, dynamic = true, ...); dynamicTools: true is hard-wired in agent/loop/requester.ts.
  • operationTools(baseline, capabilities) filters baseline down to the names present in defaultTools(disclosure).
  • capableTools(includeRuntime) only appends origin === "runtime" tools when includeRuntime is true — and includeRuntime is the disclosure argument.
  • shapeToolsForDisclosure() returns all active entries unchanged when disclosure === false, so the drop must happen either in capableTools() / state.initial classification (MCP entries ending up classified as runtime tools) or in the policy filter (activeEntries() → toolPolicy.isToolActive(name, "mcp")).

With disclosure === false (model without dynamically_loaded_tools, tool-select flag off) the MCP entries have to be part of state.initial to survive; if they are classified as runtime tools they vanish from the request entirely. When disclosure === true they are hidden as "dynamically loadable", but select_tools cannot materialise them for a model without dynamically_loaded_tools — which matches the "No tools are currently available for dynamic loading in this session" reminder.

For reference, the profile's activeToolNames in this setup does contain the wildcard mcp__*, and picomatch.isMatch("mcp__mt__mt_apk_build", "mcp__*") is true with the bundled picomatch@4.0.4, so the plain policy matcher does not appear to be the blocker.

Related issues

Workaround

Run 2.5.3 — the auto-updater keeps the previous binary as ~/.kimi-code/bin/kimi.bak, and with that binary all 67 MCP tools are exposed to the model again. Alternatively call the MCP endpoint directly over JSON-RPC.

Activity

  1. defaultuser233 commented on Nov 19, 2026

    @defaultuser233
    Author

    Thanks for the report — reproduced on the same setup (2.6.3, Termux/glibc loader, custom OpenAI-compatible gateway, capabilities = ["image_in", "thinking", "tool_use"], the same 67-tool mt HTTP server). The journal lines match exactly: mcp.tools_discovered 67 tools → tool_select.initialized 94 entries (27 built-in + 67 mcp__mt__*) → llm.tools_snapshot 26 entries, 0 mcp__*.

    A workaround does work on 2.6.3 without downgrading: mark the server deferred, so its tools land in the tool-select manifest instead of the (broken) top-level path.

    // ~/.kimi-code/mcp.json
    {
      "mcpServers": {
        "mt": {
          "url": "http://127.0.0.1:8787/mcp",
          "deferred": true
        }
      }
    }
    # config.toml
    [experimental]
    tool-select = true
    
    [models."<your-model>"]
    capabilities = ["image_in", "thinking", "tool_use", "dynamically_loaded_tools"]

    Verified end to end: llm.tools_snapshot goes from 26 to 27 entries (the extra one being select_tools), the model calls select_tools, and the MCP tool then executes — mcp__mt__mt_file_list returned real directory entries in the same run.

    Two notes that may help with the fix:

    1. The No tools are currently available for dynamic loading reminder seen with KIMI_CODE_EXPERIMENTAL_TOOL_SELECT=1 is what the client emits when the tool-select manifest is empty. With no deferred field, 2.6.3 places the entries in neither the top-level list nor the manifest, so tool-select has nothing to materialize. Setting deferred: true populates the manifest and the path works.
    2. The capability check does not appear to be the gate for the manifest: with the tool-select flag on and dynamically_loaded_tools absent from the model, the load still succeeded in my runs. So [Bug] default_deferred = true drops all MCP tools on models without dynamically_loaded_tools, instead of falling back #5008 (default_deferred = true drops all MCP tools on models without dynamically_loaded_tools instead of falling back) may share this root cause — the non-disclosure fallback that should copy the entries into state.initial looks missing.

    Note for anyone trying this: the tools are still not in the top-level tools[]; they are materialized on demand through select_tools, so the model has to load them explicitly before the first call.

    Local binary versions for reference: ~/.kimi-code/bin/kimi = 2.6.3, ~/.kimi-code/bin/kimi.bak = 2.5.3 (MCP tools exposed correctly there).

  2. defaultuser233 commented on Nov 19, 2026

    @defaultuser233
    Author

    One more data point that may help with the root cause: whether the session is fresh or resumed changes the outcome, so "MCP tools missing" and "MCP tools present" can both be true in the same journal.

    All timestamps below are UTC; 2.6.3 landed on this device at 2026-11-19 03:32 (binary mtime). Read from the session journals (<session>/agents/main/wire.jsonl):

    session kind tool_select.initialized mcp.tools_discovered llm.tools_snapshot mcp__* in snapshot version
    6 sessions created 03:36–07:31 fresh 94 67 26 0 2.6.3
    session created 07:37 fresh, deferred: true 94 67 27 (+select_tools) 0 top-level, 67 materialised via select_tools 2.6.3
    session resumed with --continue resumed 94 67 93 67 2.6.3

    The resumed session still exposes all 67 MCP tools under 2.6.3, while every freshly created session under 2.6.3 drops them from the request. The resumed session's tool_select.initialized / mcp.tools_discovered (94 / 67) are carried over from the persisted manifest written by the older binary, so those entries are already classified as initial and survive into tools[].

    That is consistent with the hypothesis that in 2.6.3 a fresh session never classifies the MCP entries as initial (they end up as runtime), which is exactly the symptom: present in tool_select.initialized, absent from llm.tools_snapshot. If so, the fix may be the non-disclosure fallback that copies the entries into state.initial — the same fallback #5008 seems to be missing.

    The deferred: true workaround is confirmed working locally: with deferred: true on the server, [experimental] tool-select = true and dynamically_loaded_tools in the model capabilities, the model calls select_tools, the following <tools_added> block lists all 67 mcp__mt__* tools, and they execute (verified with mcp__mt__mt_file_list).

  3. picolino commented on Nov 20, 2026

    @picolino

    Same problem, checked in 2.7.1. Omg, it's critical issue guys, MCP servers are completely gone from usage on latest kimi code versions.

    Only workaround that works for me is to launch subagent from session, all MCP tools are available there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions