2025-10-12 00:08:37 +08:00
|
|
|
|
import { McpServer, McpServerSpec } from "../types";
|
2025-10-09 17:21:03 +08:00
|
|
|
|
|
2025-10-12 16:34:32 +08:00
|
|
|
|
export type McpPreset = Omit<McpServer, "enabled" | "description">;
|
2025-10-09 17:21:03 +08:00
|
|
|
|
|
2025-10-10 22:34:38 +08:00
|
|
|
|
// 预设 MCP(逻辑简化版):
|
|
|
|
|
|
// - 仅包含最常用、可快速落地的 stdio 模式示例
|
2025-10-12 00:08:37 +08:00
|
|
|
|
// - 不涉及分类/模板/测速等复杂逻辑,默认以 disabled 形式"回种"到 config.json
|
2025-10-10 22:34:38 +08:00
|
|
|
|
// - 用户可在 MCP 面板中一键启用/编辑
|
2025-10-12 16:34:32 +08:00
|
|
|
|
// - description 字段使用国际化 key,在使用时通过 t() 函数获取翻译
|
2025-10-10 22:34:38 +08:00
|
|
|
|
export const mcpPresets: McpPreset[] = [
|
|
|
|
|
|
{
|
|
|
|
|
|
id: "fetch",
|
|
|
|
|
|
name: "mcp-server-fetch",
|
2025-10-12 00:08:37 +08:00
|
|
|
|
tags: ["stdio", "http", "web"],
|
2025-10-10 22:34:38 +08:00
|
|
|
|
server: {
|
|
|
|
|
|
type: "stdio",
|
|
|
|
|
|
command: "uvx",
|
|
|
|
|
|
args: ["mcp-server-fetch"],
|
2025-10-12 00:08:37 +08:00
|
|
|
|
} as McpServerSpec,
|
|
|
|
|
|
homepage: "https://github.com/modelcontextprotocol/servers",
|
|
|
|
|
|
docs: "https://github.com/modelcontextprotocol/servers/tree/main/src/fetch",
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: "time",
|
|
|
|
|
|
name: "@modelcontextprotocol/server-time",
|
|
|
|
|
|
tags: ["stdio", "time", "utility"],
|
|
|
|
|
|
server: {
|
|
|
|
|
|
type: "stdio",
|
|
|
|
|
|
command: "npx",
|
|
|
|
|
|
args: ["-y", "@modelcontextprotocol/server-time"],
|
|
|
|
|
|
} as McpServerSpec,
|
|
|
|
|
|
homepage: "https://github.com/modelcontextprotocol/servers",
|
|
|
|
|
|
docs: "https://github.com/modelcontextprotocol/servers/tree/main/src/time",
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: "memory",
|
|
|
|
|
|
name: "@modelcontextprotocol/server-memory",
|
|
|
|
|
|
tags: ["stdio", "memory", "graph"],
|
|
|
|
|
|
server: {
|
|
|
|
|
|
type: "stdio",
|
|
|
|
|
|
command: "npx",
|
|
|
|
|
|
args: ["-y", "@modelcontextprotocol/server-memory"],
|
|
|
|
|
|
} as McpServerSpec,
|
|
|
|
|
|
homepage: "https://github.com/modelcontextprotocol/servers",
|
|
|
|
|
|
docs: "https://github.com/modelcontextprotocol/servers/tree/main/src/memory",
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: "sequential-thinking",
|
|
|
|
|
|
name: "@modelcontextprotocol/server-sequential-thinking",
|
|
|
|
|
|
tags: ["stdio", "thinking", "reasoning"],
|
|
|
|
|
|
server: {
|
|
|
|
|
|
type: "stdio",
|
|
|
|
|
|
command: "npx",
|
|
|
|
|
|
args: ["-y", "@modelcontextprotocol/server-sequential-thinking"],
|
|
|
|
|
|
} as McpServerSpec,
|
|
|
|
|
|
homepage: "https://github.com/modelcontextprotocol/servers",
|
|
|
|
|
|
docs: "https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking",
|
2025-10-10 22:34:38 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: "context7",
|
2025-10-12 11:31:36 +08:00
|
|
|
|
name: "@upstash/context7-mcp",
|
2025-10-12 00:08:37 +08:00
|
|
|
|
tags: ["stdio", "docs", "search"],
|
2025-10-10 22:34:38 +08:00
|
|
|
|
server: {
|
|
|
|
|
|
type: "stdio",
|
2025-10-12 00:08:37 +08:00
|
|
|
|
command: "npx",
|
2025-10-12 11:31:36 +08:00
|
|
|
|
args: ["-y", "@upstash/context7-mcp"],
|
2025-10-12 00:08:37 +08:00
|
|
|
|
} as McpServerSpec,
|
|
|
|
|
|
homepage: "https://context7.com",
|
2025-10-12 11:31:36 +08:00
|
|
|
|
docs: "https://github.com/upstash/context7/blob/master/README.md",
|
2025-10-10 22:34:38 +08:00
|
|
|
|
},
|
|
|
|
|
|
];
|
2025-10-09 17:21:03 +08:00
|
|
|
|
|
2025-10-12 16:34:32 +08:00
|
|
|
|
// 获取带国际化描述的预设
|
|
|
|
|
|
export const getMcpPresetWithDescription = (
|
|
|
|
|
|
preset: McpPreset,
|
|
|
|
|
|
t: (key: string) => string,
|
|
|
|
|
|
): McpServer => {
|
|
|
|
|
|
const descriptionKey = `mcp.presets.${preset.id}.description`;
|
|
|
|
|
|
return {
|
|
|
|
|
|
...preset,
|
|
|
|
|
|
description: t(descriptionKey),
|
|
|
|
|
|
} as McpServer;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2025-10-09 17:21:03 +08:00
|
|
|
|
export default mcpPresets;
|