Add MCP section to config web UI#2770
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new MCP section to the web config UI so users can manage MCP discovery settings and server definitions from the visual editor instead of editing raw config.
Changes:
- Added MCP-related form fields and config serialization/parsing for discovery settings and server lists.
- Added a new MCP section in the config page with controls for enabling discovery and editing stdio/http servers.
- Added English and Chinese locale strings for the new MCP UI.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
web/frontend/src/i18n/locales/zh.json |
Adds Chinese translations for the new MCP config section and fields. |
web/frontend/src/i18n/locales/en.json |
Adds English translations for the new MCP config section and fields. |
web/frontend/src/components/config/form-model.ts |
Extends the visual config form model to load/store MCP settings and server entries. |
web/frontend/src/components/config/config-sections.tsx |
Introduces the MCP UI section and server editor controls. |
web/frontend/src/components/config/config-page.tsx |
Wires MCP form state into save/reset flows and builds the MCP patch payload. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ection Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| <SelectTrigger | ||
| aria-label={t("pages.config.mcp_server_discovery_mode")} | ||
| > |
| function buildStringMapMergePatch( | ||
| next: Record<string, string>, | ||
| previous: Record<string, string>, | ||
| ): Record<string, string | null> { | ||
| const patch: Record<string, string | null> = { ...next } | ||
|
|
||
| for (const key of Object.keys(previous)) { | ||
| if (!(key in next)) { | ||
| patch[key] = null | ||
| } | ||
| } | ||
|
|
||
| return patch |
| const mcpServersPatch = Object.fromEntries([ | ||
| ...upsertServerEntries, | ||
| ...removedServerEntries, | ||
| ]) |
📝 Description
Add a dedicated MCP section to the web Config page so users can manage MCP enable/discovery settings and MCP servers directly from the UI.
This removes the need to edit raw config for common MCP setup tasks and fixes server removal persistence by sending null entries in patch payloads.
🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
N/A
📚 Technical Context (Skip for Docs)
🧪 Test Environment
📸 Evidence (Optional)
Click to view Logs/Screenshots
Frontend build succeeded after changes (vite build completed successfully).
☑️ Checklist