Skip to content

MCP schemas for local models are gated on a hardcoded English keyword list #5603

Description

@Ninthkitten

Prerequisites

  • I searched open issues and discussions and did not find an existing report of this bug.
  • This is not a security vulnerability.
  • I am running the latest code from the dev branch.

Install Method

Docker

Operating System

macOS (Apple Silicon), Docker Desktop

Steps to Reproduce

  1. Connect a remote MCP server and enable its tools.
  2. Use a local model in agent mode.
  3. Ask it, in a language other than English, to do something with that server — or ask in short imperative English that avoids the gate words.

Expected Behaviour

The MCP tools are offered when they are relevant to the request, the same way native tools are selected.

Actual Behaviour

For local models, MCP schemas are attached only when the latest user message contains a word from a hardcoded list (_MCP_KEYWORDS, src/agent_loop.py ~line 689). The decision is all-or-nothing:

all_tool_schemas = mcp_schemas if _wants_mcp else []

The list is English-centric (mcp, browse, browser, calendar, email, rss, …). Consequences:

  • A non-English user gets zero MCP tools and a model that cannot comply, with no indication why. We are a Swedish-speaking household; our own instructions never matched, and the connected server was unreachable in practice.
  • Even in English, phrasing decides. "check the queue" missed; a longer sentence containing a listed word hit.
  • It is invisible: the model simply behaves as though the server does not exist.

We had to patch our own domain words into the list to make a correctly connected, enabled server reachable at all.

Additional Information

Suggestions, in order of preference:

  1. Route MCP tools through the same intent/RAG tool selection already used for native tools, instead of a keyword gate.
  2. Failing that, make the list configurable per install.
  3. At minimum, log when the gate suppresses MCP schemas, so the failure is diagnosable rather than silent.

Related: #5519 (tool selector capping) is the same family of problem — the model's toolbox being narrowed by a heuristic it cannot see or report on.

Are you willing to submit a fix?

Yes — the fix described above is running in production here and I can open a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready for reviewDescription complete — ready for maintainer review

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions