Add MCP server config editor UI with validation #4

Merged
kubus merged 1 commit from t3code/mcp-server-config-ui into main 2026-09-29 15:33:45 +00:00
Owner

Summary

  • Add McpSettings.tsx, a structured editor for MCP servers in plugin settings, replacing the raw config form for the mcp plugin.
  • Support per-server name, transport (stdio/http), command, one-arg-per-line args, KEY=value env, URL, and optional bearer token, with collapsible cards and a live tool-name prefix preview.
  • Validate names (required, no duplicates), required command for stdio, and http(s):// URL for HTTP; surface per-card issues and block saving until fixed.
  • Keep a requireApproval toggle and an advanced raw-JSON editor that applies back into the cards.
  • Persist both structured servers and legacy serversJson so older clients keep working.
  • Extend packages/mcp/src/plugin.ts with mcpServerSchema, normalizeServer, validateServers, and a parseServers overload accepting structured config or the legacy JSON string, with clearer parse/validation errors.
  • Add MCP editor styles, including a responsive single-column layout under 560px.

Testing

  • Not run (no automated checks executed as part of this change).
  • Manual: add stdio and HTTP servers, confirm validation errors block Save config, fix them, and verify the config round-trips after save.
  • Manual: toggle the raw JSON editor, apply valid and invalid JSON, and confirm cards update or an error is shown.
  • Manual: confirm legacy serversJson-only configs still load and activate.
## Summary - Add `McpSettings.tsx`, a structured editor for MCP servers in plugin settings, replacing the raw config form for the `mcp` plugin. - Support per-server name, transport (stdio/http), command, one-arg-per-line args, KEY=value env, URL, and optional bearer token, with collapsible cards and a live tool-name prefix preview. - Validate names (required, no duplicates), required command for stdio, and `http(s)://` URL for HTTP; surface per-card issues and block saving until fixed. - Keep a `requireApproval` toggle and an advanced raw-JSON editor that applies back into the cards. - Persist both structured `servers` and legacy `serversJson` so older clients keep working. - Extend `packages/mcp/src/plugin.ts` with `mcpServerSchema`, `normalizeServer`, `validateServers`, and a `parseServers` overload accepting structured config or the legacy JSON string, with clearer parse/validation errors. - Add MCP editor styles, including a responsive single-column layout under 560px. ## Testing - Not run (no automated checks executed as part of this change). - Manual: add stdio and HTTP servers, confirm validation errors block Save config, fix them, and verify the config round-trips after save. - Manual: toggle the raw JSON editor, apply valid and invalid JSON, and confirm cards update or an error is shown. - Manual: confirm legacy `serversJson`-only configs still load and activate.
- Add McpSettings editor with per-server cards, stdio/http transports, args/env editors, JSON mode, and approval toggle
- Emit structured `servers` config while keeping legacy `serversJson` in sync
- Validate servers in mcp plugin (schema, duplicate names, url/command) and block saving invalid config
kubus merged commit 203090a960 into main 2026-09-29 15:33:45 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kubus/hatchat!4
No description provided.