MCP 服务器是一个基于 TypeScript 的 Model Context Protocol (MCP) 服务器实现,它作为一款集成工具,可提供多种服务,如 JIRA 和待办事项管理等,能有效解决多工具集成管理的问题,为用户带来便捷、高效的使用体验。
MCP 服务器是一个强大的集成工具,以下将为你详细介绍它的使用。
暂未提供安装步骤相关内容,若有需要可后续补充。
src/
├── config/ # 工具配置
│ ├── jira-tool.config.ts
│ └── todo-tool.config.ts
├── constant/ # 常量定义
│ └── tool-name.ts
├── schema/ # Zod 模式验证
│ ├── jira.ts
│ └── todo.ts
├── server/ # 服务器管理
│ └── mcp-server-tool-manager.ts
├── tools/ # 工具实现
│ ├── jira/
│ │ └── create-issue.ts
│ └── todo/
│ └── create-todo.ts
└── index.ts # 主入口点
constant/tool-name.ts 中定义工具常量。schema/ 目录中创建模式。tools/ 目录中实现工具处理程序。config/ 目录中添加配置。index.ts 中注册工具。示例:
// 1. 添加常量
export const 新工具 = {
ACTION: "action_name"
} as const;
// 2. 创建模式
export const newToolSchema = z.object({
// ... 模式定义
});
// 3. 实现处理程序
export const handleAction = async (
args: z.infer<typeof newToolSchema>,
extra: RequestHandlerExtra
): Promise<CallToolResult> => {
// ... 实现逻辑
};
// 4. 添加配置
export const newToolConfig = {
name: "新工具",
version: "1.0.0",
tools: [
{
name: 新工具.ACTION,
schema: newToolSchema,
handler: handleAction,
},
],
};
本项目采用 MIT 许可证。