MCP server answers /mcp with an empty tool registry during portal rollouts — get/search calls fail with "Unknown tool"

Chiusa
#6,199 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
api, backend

Direzione di ricerca

Start with Plugins/Mcp/src/MeshWeaver.Mcp/McpMeshPlugin.cs and trace when tools are registered relative to publication of the /mcp route. Then inspect module activation and readiness handling for store-installed modules, using the cited [ModuleActivation] SKIPPED portal logs and the linked architecture note as context. Done when rollout requests cannot reach an MCP server with an empty tool registry, with tests covering activation and route readiness.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug sev:M

What is failing

The portal's MCP tool surface (/mcp, backed by the MeshWeaver.Mcp module) rejected core tool calls — get and search, the first verbs every external client (Claude Code, Copilot harnesses) calls — with McpProtocolException: Unknown tool. The stack runs entirely through the ModelContextProtocol SDK's composed call-tool pipeline, which throws this only when the requested name is absent from the server's tool registry. So for the affected calls the server was answering /mcp with an empty (or near-empty) tool set — the route was up, the tools were not.

Probable cause (moderate confidence)

The tool registry is populated by McpMeshPlugin inside the MeshWeaver.Mcp module. The burst spans two ReplicaSets of the portal deployment (7c494b54c8 ×3 pods, 65ccb7c796 ×1) within a single 8-minute window — consistent with a rolling portal update during which the /mcp route was published before the module's tools were registered (module not yet loaded/activated, or activation declined on those pods). Portal ops logs show this deployment family doing exactly that: [ModuleActivation] SKIPPED store-installed module 'MeshWeaver.Mcp': declined entries exist on these pods historically, and successful [ModuleLoad] MeshWeaver.Mcp ← /app/modules/MeshWeaver.Mcp/... lines appear adjacent to the incident window. Either readiness does not gate the /mcp route on module activation, or a declined/stale module leaves the SDK server up with zero tools. A contributing suspect is version skew: Mcp 1.4.1–1.4.3 are held behind the platform floor on both memex and memex-cloud (memex runs Mcp 1.4.0; memex-cloud runs 1.3.19 on platform 3.0.0-ci.9984, needing ≥ ci.9995 for 1.4.3), and earlier refusals show module/platform mismatch causes activation declines. I could not read McpMeshPlugin's source from the mesh, so the exact registration/activation ordering is not pinned down — the empty-registry-at-call-time conclusion is what the stack proves.

Impact

13 failures over 8 minutes on 4 pods, all on the MCP surface used by external assistant clients; confined to the rollout window and self-resolved by 07:04. Clients fail loudly and can retry; the REST mirror at /api/mesh/* is deliberately outside the module and kept working as a workaround. Developer-tooling surface, no data loss.

Where to look

  • McpMeshPlugin tool registration (Plugins/Mcp → src/MeshWeaver.Mcp/McpMeshPlugin.cs) — when tools enter the SDK's tool collection relative to the route being published.
  • Module activation / readiness gating for store-installed modules: the /mcp route should not answer (or should answer with a clean error) until the module's tools are registered — see [ModuleActivation] SKIPPED store-installed module 'MeshWeaver.Mcp' entries in Ops/Logs on the portal pods.
  • Architecture: Doc/WhatsNew/2026-08-17-the-mcp-server-is-a-module (tools come from the module; /api/mesh is the unaffected mirror).
  • Held-update skew: Hosting/Triage/package-update-held/memex-cloud-mcp-1-4-3-floor-3-0-0-ci-9995 and the memex equivalents.

Not a duplicate of the September TypeLoadException MCP incident (Admin/_LogIncident/e4b839320c7da0e2, fixed August class) — that failure was a type-load failure inside the tool target's constructor; this one is the registry itself being empty at dispatch.


Evidence
Fingerprint d16005925bb669e0
Category ModelContextProtocol.Server.McpServer
Severity Error
Exception ModelContextProtocol.McpProtocolException
Top frame ModelContextProtocol.Server.McpServerImpl.<>c.<<ConfigureTools>b__83_1>d.MoveNext()
Namespace memex-cloud
Pods memex-portal-deployment-7c494b54c8-4qpm6, memex-portal-deployment-7c494b54c8-9p2h4, memex-portal-deployment-65ccb7c796-gkmmr, memex-portal-deployment-7c494b54c8-bv2zn, memex-portal-deployment-65ccb7c796-hq7t4, memex-portal-deployment-7c494b54c8-58564
Occurrences 39
First seen 2026-10-06 06:56:09Z
Last seen 2026-10-06 07:22:46Z
Routing not determined — no configured route matches the category ModelContextProtocol.Server.McpServer. This repository is the configured fallback, not a finding about who owns the fault; the category names the LOGGER, which may not be the subject.
Recent log lines
2026-10-06 07:10:15Z memex-portal-deployment-65ccb7c796-gkmmr fail: ModelContextProtocol.Server.McpServer[1433779783]
      "get_versions" threw an unhandled exception.
      ModelContextProtocol.McpProtocolException: Unknown tool: 'get_versions'
         at ModelContextProtocol.Server.McpServerImpl.<>c.<<ConfigureTools>b__83_1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_1.<<BuildComposedCallToolHandler>g__InvokeOrdinaryPipelineAsync|1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.AspNetCore.AuthorizationCallToolFilterGuardSetup.<>c.<<PostConfigure>b__2_0>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_0.<<BuildComposedCallToolHandler>b__0>d.MoveNext()
2026-10-06 07:10:43Z memex-portal-deployment-65ccb7c796-gkmmr fail: ModelContextProtocol.Server.McpServer[1433779783]
      "create" threw an unhandled exception.
      ModelContextProtocol.McpProtocolException: Unknown tool: 'create'
         at ModelContextProtocol.Server.McpServerImpl.<>c.<<ConfigureTools>b__83_1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_1.<<BuildComposedCallToolHandler>g__InvokeOrdinaryPipelineAsync|1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.AspNetCore.AuthorizationCallToolFilterGuardSetup.<>c.<<PostConfigure>b__2_0>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_0.<<BuildComposedCallToolHandler>b__0>d.MoveNext()
2026-10-06 07:10:47Z memex-portal-deployment-65ccb7c796-gkmmr fail: ModelContextProtocol.Server.McpServer[1433779783]
      "create" threw an unhandled exception.
      ModelContextProtocol.McpProtocolException: Unknown tool: 'create'
         at ModelContextProtocol.Server.McpServerImpl.<>c.<<ConfigureTools>b__83_1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_1.<<BuildComposedCallToolHandler>g__InvokeOrdinaryPipelineAsync|1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.AspNetCore.AuthorizationCallToolFilterGuardSetup.<>c.<<PostConfigure>b__2_0>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_0.<<BuildComposedCallToolHandler>b__0>d.MoveNext()
2026-10-06 07:10:57Z memex-portal-deployment-65ccb7c796-hq7t4 fail: ModelContextProtocol.Server.McpServer[1433779783]
      "search" threw an unhandled exception.
      ModelContextProtocol.McpProtocolException: Unknown tool: 'search'
         at ModelContextProtocol.Server.McpServerImpl.<>c.<<ConfigureTools>b__83_1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_1.<<BuildComposedCallToolHandler>g__InvokeOrdinaryPipelineAsync|1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.AspNetCore.AuthorizationCallToolFilterGuardSetup.<>c.<<PostConfigure>b__2_0>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_0.<<BuildComposedCallToolHandler>b__0>d.MoveNext()
2026-10-06 07:11:04Z memex-portal-deployment-65ccb7c796-gkmmr fail: ModelContextProtocol.Server.McpServer[1433779783]
      "get" threw an unhandled exception.
      ModelContextProtocol.McpProtocolException: Unknown tool: 'get'
         at ModelContextProtocol.Server.McpServerImpl.<>c.<<ConfigureTools>b__83_1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_1.<<BuildComposedCallToolHandler>g__InvokeOrdinaryPipelineAsync|1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.AspNetCore.AuthorizationCallToolFilterGuardSetup.<>c.<<PostConfigure>b__2_0>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_0.<<BuildComposedCallToolHandler>b__0>d.MoveNext()
2026-10-06 07:11:04Z memex-portal-deployment-65ccb7c796-hq7t4 fail: ModelContextProtocol.Server.McpServer[1433779783]
      "get" threw an unhandled exception.
      ModelContextProtocol.McpProtocolException: Unknown tool: 'get'
         at ModelContextProtocol.Server.McpServerImpl.<>c.<<ConfigureTools>b__83_1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_1.<<BuildComposedCallToolHandler>g__InvokeOrdinaryPipelineAsync|1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.AspNetCore.AuthorizationCallToolFilterGuardSetup.<>c.<<PostConfigure>b__2_0>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_0.<<BuildComposedCallToolHandler>b__0>d.MoveNext()
2026-10-06 07:12:01Z memex-portal-deployment-65ccb7c796-gkmmr fail: ModelContextProtocol.Server.McpServer[1433779783]
      "search" threw an unhandled exception.
      ModelContextProtocol.McpProtocolException: Unknown tool: 'search'
         at ModelContextProtocol.Server.McpServerImpl.<>c.<<ConfigureTools>b__83_1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_1.<<BuildComposedCallToolHandler>g__InvokeOrdinaryPipelineAsync|1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.AspNetCore.AuthorizationCallToolFilterGuardSetup.<>c.<<PostConfigure>b__2_0>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_0.<<BuildComposedCallToolHandler>b__0>d.MoveNext()
2026-10-06 07:12:18Z memex-portal-deployment-65ccb7c796-hq7t4 fail: ModelContextProtocol.Server.McpServer[1433779783]
      "get" threw an unhandled exception.
      ModelContextProtocol.McpProtocolException: Unknown tool: 'get'
         at ModelContextProtocol.Server.McpServerImpl.<>c.<<ConfigureTools>b__83_1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_1.<<BuildComposedCallToolHandler>g__InvokeOrdinaryPipelineAsync|1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.AspNetCore.AuthorizationCallToolFilterGuardSetup.<>c.<<PostConfigure>b__2_0>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_0.<<BuildComposedCallToolHandler>b__0>d.MoveNext()
2026-10-06 07:12:30Z memex-portal-deployment-65ccb7c796-gkmmr fail: ModelContextProtocol.Server.McpServer[1433779783]
      "get" threw an unhandled exception.
      ModelContextProtocol.McpProtocolException: Unknown tool: 'get'
         at ModelContextProtocol.Server.McpServerImpl.<>c.<<ConfigureTools>b__83_1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_1.<<BuildComposedCallToolHandler>g__InvokeOrdinaryPipelineAsync|1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.AspNetCore.AuthorizationCallToolFilterGuardSetup.<>c.<<PostConfigure>b__2_0>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_0.<<BuildComposedCallToolHandler>b__0>d.MoveNext()
2026-10-06 07:22:46Z memex-portal-deployment-7c494b54c8-58564 fail: ModelContextProtocol.Server.McpServer[1433779783]
      "search" threw an unhandled exception.
      ModelContextProtocol.McpProtocolException: Unknown tool: 'search'
         at ModelContextProtocol.Server.McpServerImpl.<>c.<<ConfigureTools>b__83_1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_1.<<BuildComposedCallToolHandler>g__InvokeOrdinaryPipelineAsync|1>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.AspNetCore.AuthorizationCallToolFilterGuardSetup.<>c.<<PostConfigure>b__2_0>d.MoveNext()
      --- End of stack trace from previous location ---
         at ModelContextProtocol.Server.McpServerImpl.<>c__DisplayClass85_0.<<BuildComposedCallToolHandler>b__0>d.MoveNext()

Opened automatically from Admin/_LogIncident/d16005925bb669e0. Recurrences are folded into this issue rather than opening new ones.
It also stands for the whole log site e0fab99dfdca02ea: other fingerprints of this site fold in here as comments rather than opening tickets of their own.

Lingua principale
C#
Stelle
12
Fork
5
Merge medio
5h 10m
PR unite (30g)
980

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Systemorph/MeshWeaver

Tutte le issue di Systemorph/MeshWeaver

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.