MCP 服务器
基于 TypeScript 的模型上下文协议 (MCP) 服务器实现,为 JIRA 和 TODO 管理等各种服务提供集成工具。
🚀 功能
多工具集成:支持多工具集成的模块化架构
类型安全:通过 Zod 模式验证全面支持 TypeScript
ESM 支持:现代 ES 模块实现
可扩展:易于添加新工具和集成
Related MCP server: JIRA MCP Server
📦 当前工具
JIRA 集成
使用可自定义字段创建问题
自动响应格式
问题创建的架构验证
TODO管理
创建具有优先级和截止日期的待办事项
支持可选字段的灵活模式
格式化的响应消息
🛠 项目结构
src/
├── config/ # Tool configurations
│ ├── jira-tool.config.ts
│ └── todo-tool.config.ts
├── constant/ # Constant definitions
│ └── tool-name.ts
├── schema/ # Zod schemas for validation
│ ├── jira.ts
│ └── todo.ts
├── server/ # Server management
│ └── mcp-server-tool-manager.ts
├── tools/ # Tool implementations
│ ├── jira/
│ │ └── create-issue.ts
│ └── todo/
│ └── create-todo.ts
└── index.ts # Main entry point
🔌 添加新工具
在
constant/tool-name.ts中定义工具常量在
schema/目录中创建架构在
tools/目录中实现工具处理程序在
config/目录中添加配置在
index.ts中注册工具
例子:
// 1. Add constant
export const NEW_TOOL = {
ACTION: "action_name"
} as const;
// 2. Create schema
export const newToolSchema = z.object({
// ... schema definition
});
// 3. Implement handler
export const handleAction = async (
args: z.infer<typeof newToolSchema>,
extra: RequestHandlerExtra
): Promise<CallToolResult> => {
// ... implementation
};
// 4. Add configuration
export const newToolConfig = {
name: "New Tool",
version: "1.0.0",
tools: [
{
name: NEW_TOOL.ACTION,
schema: newToolSchema,
handler: handleAction,
},
],
};
🔄 开发工作流程
创建功能分支
实施变革
运行测试(实施时)
构建项目
提交 PR
📝 注释
使用 ES 模块实现更好的模块化
实现模型上下文协议以实现标准化通信
遵循 TypeScript 最佳实践
Zod 模式验证以确保类型安全
🛣️ 路线图
[ ] 添加更多 JIRA 操作
[ ] 实现 TODO 持久化
[ ] 添加身份验证
[ ] 添加测试框架
[ ] 添加更多集成(GitHub、Slack 等)
📄 许可证
麻省理工学院