Skip to content

fix(mcp): use normalizeMcpConfig in codeCommand to support mcpServers#1603

Merged
esengine merged 1 commit into
esengine:mainfrom
Bernardxu123:fix/mcp-config-read
May 23, 2026
Merged

fix(mcp): use normalizeMcpConfig in codeCommand to support mcpServers#1603
esengine merged 1 commit into
esengine:mainfrom
Bernardxu123:fix/mcp-config-read

Conversation

@Bernardxu123

Copy link
Copy Markdown
Collaborator

Fixes #1568

Problem

When users configure MCP servers using the \mcpServers\ object format in config.json (without the legacy \mcp\ string array), the servers do not start when using
easonix code.

Root Cause

In \code.tsx\ line 178, the \codeCommand\ function was directly reading
eadConfig().mcp, which only handles the legacy string array format:

\\ ypescript
// Before (broken)
mcp: readConfig().mcp,
\\

When users configured only \mcpServers\ (the object format),
eadConfig().mcp\ returns \undefined\ or [], so no MCP servers were started.

Fix

Use
ormalizeMcpConfig()\ which processes both \mcp\ and \mcpServers\ formats, then converts back to string array via \specToRaw():

\\ ypescript
// After (fixed)
mcp: normalizeMcpConfig(readConfig()).map(specToRaw),
\\

This matches how
esolveDefaults()\ in
esolve.ts\ handles MCP configuration.

Files Changed

  • \src/cli/commands/code.tsx: Added imports for
    ormalizeMcpConfig\ and \specToRaw, fixed MCP config reading

Testing


  • pm run lint\ ✅

  • pm run typecheck\ ✅

…esengine#1568)

codeCommand was directly reading readConfig().mcp which only handles
the legacy string array format. When users configured mcpServers
(the object format) without the mcp array, MCP servers would not start.

Fixed by using normalizeMcpConfig() which processes both mcp and
mcpServers formats, then converts back to string array via specToRaw().

Fixes esengine#1568
@minatoAI

Copy link
Copy Markdown

found the same bug, even made the same fix too, using reasonix.

@esengine esengine merged commit 3daafde into esengine:main May 23, 2026
4 checks passed
@Bernardxu123 Bernardxu123 deleted the fix/mcp-config-read branch May 23, 2026 13:22
esengine pushed a commit that referenced this pull request May 24, 2026
…moved, persisted usage stats, plan dispatch gate

Headline themes:
- Desktop: bundle the CLI-hosted React dashboard, retire Tauri+Preact duplicate (#1418)
- Config: drop preset abstraction; flash/pro are direct model selections (#1657, #1630)
- Stats: persist cumulative usage to session meta + auto-restore on startup (#1667, #1680, #1643, #1628)
- Plans: editMode="plan" enforced at the ToolRegistry dispatch gate (#1681); step advance fix (#1629)
- Context: fold once at turn start, drop pre-flight + byte-ceiling (#1642, #1646); collapsible compacted card (#1649)
- Subagents: per-skill flash/pro override + Settings UI (#1632)
- Desktop polish: sidebar drag-resize (#1688), responsive collapse (#1585), copy/edit overlay + msg-history nav (#1645), Esc closes modal not turn (#1685), QQ tab isolation (#1672), DiffCard for edits (#1662), theme-aware highlighting (#1655), system events toggle (#1654/#1650), macOS TCC inheritance (#1614), dashboard.enabled (#1612)
- Dashboard polish: persistent session URL (#1586, #1589, #1599), theme-aware highlighting (#1664), IME confirm-enter guard (#1689), code-fence lang fix (#1677), vendor chunk split (#1587), markdown table h-scroll (#1562)
- TUI: Alt+S input stash/recall; static history isolated from input rerenders (#1635); legacy mouse drop (#1637, #1648); multi-edit gated in review (#1647)
- Diff: SplitDiff column border holds under CJK (#1686)
- MCP: workspace roots passed to servers (#1625); codeCommand honors mcpServers (#1603)
- Config plumbing: (baseUrl, apiKey) resolved as a tuple (#1658); stale model id self-heal (#1663)

See CHANGELOG for the full list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp设置问题

3 participants