mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-29 01:25:33 +08:00
0be596afb5
- Show not-installed MCP presets directly in the list, consistent with existing UI (no modal) - Toggle now supports enabling presets by writing to ~/.claude.json (mcpServers) and refreshing list - Keep installed MCP entries unchanged (edit/delete/toggle) fix(mcp): robust error handling and pre-submit validation - Use extractErrorMessage in MCP panel and form to surface backend details - Prevent pasting full config (with mcpServers) into single-server JSON field - Add required-field checks: stdio requires non-empty command; http requires non-empty url i18n: add messages for single-server validation and preset labels chore: add data-only MCP presets file (no new dependencies)
39 lines
970 B
TypeScript
39 lines
970 B
TypeScript
import { McpServer } from "../types";
|
|
|
|
export type McpPreset = {
|
|
id: string;
|
|
name: string;
|
|
description: string;
|
|
tags?: string[];
|
|
server: McpServer;
|
|
homepage?: string;
|
|
docs?: string;
|
|
requiresEnv?: string[];
|
|
};
|
|
|
|
// 预设库(数据文件,当前未接入 UI,便于后续“一键启用”)
|
|
export const mcpPresets: McpPreset[] = [
|
|
{
|
|
id: "github-issues",
|
|
name: "GitHub Issues",
|
|
description: "查询与管理 GitHub Issues(示例)",
|
|
tags: ["productivity", "dev"],
|
|
server: { type: "http", url: "https://mcp.example.com/github-issues" },
|
|
docs: "https://example.com/mcp/github-issues",
|
|
requiresEnv: ["GITHUB_TOKEN"],
|
|
},
|
|
{
|
|
id: "local-notes",
|
|
name: "本地笔记",
|
|
description: "访问本地笔记数据库(示例)",
|
|
tags: ["local"],
|
|
server: {
|
|
type: "stdio",
|
|
command: "/usr/local/bin/notes-mcp",
|
|
args: ["--db", "~/.notes/notes.db"],
|
|
},
|
|
},
|
|
];
|
|
|
|
export default mcpPresets;
|