Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

config: V2 silently ignores MCP servers defined directly under `mcp` instead of `mcp.servers`

Chiusa Adatta ai principianti
#56,602 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
Mezza giornata
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Inizia riproducendo la configurazione V1 di mcp con lo schema JSON documentato, poi traccia il caricamento della configurazione e il comando opencode mcp list. Aggiungi un controllo di regressione che verifichi il supporto per la struttura esistente oppure un avviso che indichi la chiave non riconosciuta e il percorso previsto mcp.servers.<name>. Il lavoro è completo quando il server definito non viene più ignorato silenziosamente e l'errore è visibile.

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

Descrizione

Summary

V2 config silently ignores an MCP server placed directly under mcp instead of mcp.servers, with no warning. opencode mcp list reports "No MCP servers configured" while the config file clearly contains one, so a broken integration looks like a working config.

Environment

  • opencode version: 2.0.32
  • OS: Windows_NT 10.0.26300 (win32 x64)
  • Terminal: desktop app (OpenCode.exe) + opencode-cli.exe
  • Shell: n/a (desktop app)
  • Install/channel: latest (desktop, @opencodedesktop)
  • Active plugins: none configured

Reproduction

  1. Put an MCP server under mcp (the V1 shape):
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "roam": {
      "type": "local",
      "command": ["node", "/path/to/server.mjs", "serve"]
    }
  }
}
  1. Restart OpenCode (or restart the service).
  2. Run opencode mcp list.

Expected Behavior

Either the server connects, or OpenCode tells me the key is wrong — for example a warning that mcp.roam is not a recognised shape and that V2 expects mcp.servers.roam. The V1-to-V2 migration guide notes V1 config files "are intended to remain compatible", so silently dropping an entire server definition leaves the user with a config file that looks correct and a tool that has been unavailable for weeks.

Actual Behavior

No error, no warning, no migration hint:

$ opencode mcp list
No MCP servers configured

The agent simply has no tools from that server. In my case this went unnoticed for a long time because the missing tool's absence looked like the agent choosing a different approach, rather than a config mistake.

For contrast, moving the identical block one level deeper made it appear immediately:

"mcp": { "servers": { "roam": { "type": "local", "command": [...] } } }

Additional Context

  • Reproducible every time; 100% deterministic.
  • Worth considering: when an object key sits directly under mcp and is not servers/timeout, log a warning naming the key and the expected mcp.servers.<name> path. A one-line warning at config load would have saved hours here.
  • Related: opencode mcp list returning "No MCP servers configured" while a config file visibly contains an mcp block could echo which files were loaded, which would also help when config is present but ignored for other reasons.
Lingua principale
TypeScript
Stelle
215k
Fork
28.9k
Merge medio
8h 27m
PR unite (30g)
282

Preparare l'ambiente

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 anomalyco/opencode

Tutte le issue di anomalyco/opencode

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.