feat(mcp): add configuration wizard and simplify form modal

- Simplify McpFormModal to 3 inputs: title (required), description (optional), and JSON config (optional)
- Add JSON validation similar to ProviderForm (must be object, real-time error display)
- Create McpWizardModal component for quick configuration:
  - 5 input fields: type (stdio/sse), command (required), args, cwd, env
  - Real-time JSON preview
  - Emerald theme color (consistent with MCP button)
  - Z-index 70 (above McpFormModal's 60)
- Add "or use configuration wizard" link next to JSON config label
- Update i18n translations (zh/en) for form and wizard
- All changes pass TypeScript typecheck and Prettier formatting
This commit is contained in:
Jason
2025-10-09 11:30:28 +08:00
parent 59c13c3366
commit d0fe9d7533
4 changed files with 431 additions and 125 deletions

View File

@@ -265,6 +265,30 @@
"template": {
"fetch": "Quick Template: mcp-fetch"
},
"form": {
"title": "Server Title",
"titlePlaceholder": "my-mcp-server",
"description": "Description",
"descriptionPlaceholder": "Optional description",
"jsonConfig": "JSON Configuration",
"jsonPlaceholder": "{\n \"type\": \"stdio\",\n \"command\": \"uvx\",\n \"args\": [\"mcp-server-fetch\"]\n}",
"useWizard": "or use configuration wizard"
},
"wizard": {
"title": "MCP Configuration Wizard",
"hint": "Quickly configure MCP server and auto-generate JSON configuration",
"type": "Type",
"command": "Command",
"commandPlaceholder": "uvx",
"args": "Arguments",
"argsPlaceholder": "mcp-server-fetch",
"cwd": "Working Directory",
"cwdPlaceholder": "/path/to/project",
"env": "Environment Variables",
"envPlaceholder": "KEY=VALUE\n(one per line)",
"preview": "Configuration Preview",
"apply": "Apply Configuration"
},
"id": "Identifier (unique)",
"type": "Type",
"cwd": "Working Directory (optional)",
@@ -287,6 +311,7 @@
},
"error": {
"idRequired": "Please enter identifier",
"jsonInvalid": "Invalid JSON format",
"commandRequired": "Please enter command",
"saveFailed": "Save failed",
"deleteFailed": "Delete failed"