mcp: "enabled": false is dropped at parse, so the server still starts

Abierto Apto para principiantes
#61,589 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@HoneyPaptan ya está trabajando en esto.

Desde el 4/11/2026.

  • #61760 de @HoneyPaptan — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
backend

Línea de trabajo

Empieza por seguir el análisis de la configuración del servidor MCP y la comprobación de inicio descrita en el informe. Después, inspecciona el esquema de configuración para la opción documentada enabled. Reprodúcelo con opencode --standalone debug config usando las cuatro entradas del issue. El trabajo está terminado cuando enabled: false se conserva o se asigna de modo que el servidor figure como deshabilitado, mientras las otras entradas mantienen el comportamiento indicado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Description

The docs list enabled as the way to turn a server off without deleting it ("You can also disable a server by setting enabled to false"), and both option tables carry enabled | Boolean | "Enable or disable the MCP server on startup". The key is dropped during config parsing, while startup gates on disabled, which the docs never mention. So "enabled": false is inert and the server connects.

// opencode.json
{
  "mcp": { "servers": {
    "a-enabled-only":  { "type": "remote", "url": "http://127.0.0.1:1/mcp", "enabled": false },
    "b-disabled-only": { "type": "remote", "url": "http://127.0.0.1:2/mcp", "disabled": true },
    "c-both":          { "type": "remote", "url": "http://127.0.0.1:3/mcp", "enabled": false, "disabled": true },
    "d-plain":         { "type": "remote", "url": "http://127.0.0.1:4/mcp" }
  } }
}

opencode --standalone debug config prints a-enabled-only with no enabled key at all, and keeps disabled: true on the other two.

Plugins

none

OpenCode version

2.2.5

Steps to reproduce
  1. Write the config above into opencode.json in an empty directory.
  2. opencode --standalone debug config — enabled is gone from a-enabled-only.
  3. opencode serve --hostname 127.0.0.1 --port 49399 with OPENCODE_PASSWORD set, then curl -u "opencode:$OPENCODE_PASSWORD" http://127.0.0.1:49399/api/mcp.
entry in config status from /api/mcp
"enabled": false failed — it tried to connect
"disabled": true disabled
both keys disabled
neither key failed — it tried to connect

Expected: enabled: false behaves like disabled: true.

The published config schema carries enabled with the description "Enable or disable the MCP server on startup", while the MCP layer's config classes declare disabled and its startup loop tests config.disabled. Nothing maps one to the other, so the documented key does nothing and the undocumented one is the only lever. Not a duplicate of #55419, which covers invalid entries being dropped.

Operating System

Ubuntu 24.04 (container)

Terminal

xterm-256color

Lenguaje dominante
TypeScript
Estrellas
224k
Forks
30k
Merge medio
6 h 16 min
PR fusionados (30 d)
507

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de anomalyco/opencode

Todos los issues de anomalyco/opencode

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.