fix(mcp): update MCP wizard to support http type and improve args input

- Replace deprecated 'sse' type with 'http' (as per Claude Code official docs)
- Add HTTP-specific fields: url (required) and headers (optional)
- Implement dynamic UI: show different fields based on selected type
- Improve args input: support multi-line input (one argument per line)
- Add headers parsing supporting both 'KEY: VALUE' and 'KEY=VALUE' formats
- Update backend validation to enforce type-specific required fields
- Update i18n translations (zh/en) with new HTTP-related labels
This commit is contained in:
Jason
2025-10-09 12:04:37 +08:00
parent d0fe9d7533
commit 9471cb0d19
5 changed files with 216 additions and 91 deletions

View File

@@ -55,11 +55,16 @@ export interface Settings {
// MCP 服务器定义(宽松:允许扩展字段)
export interface McpServer {
type: "stdio" | "sse";
command: string;
type: "stdio" | "http";
// stdio 字段
command?: string;
args?: string[];
env?: Record<string, string>;
cwd?: string;
// http 字段
url?: string;
headers?: Record<string, string>;
// 通用字段
enabled?: boolean; // 是否启用该 MCP 服务器,默认 true
[key: string]: any;
}