模型上下文协议服务器

一个基于TypeScript的服务器实现,用于模型上下文协议(MCP),提供与JIRA和TODO管理等服务的集成工具。

  • by RahulRana0707
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 rahulrana0707/mcp-server

使用说明

MCP服务器

基于TypeScript的模型上下文协议(MCP)服务器实现,为JIRA和TODO管理等各种服务提供集成工具。

🚀 特性

  • 多工具集成:支持多种工具集成的模块化架构
  • 类型安全:通过Zod模式验证完全支持TypeScript
  • ESM支持:现代ES模块实施
  • 可扩展:易于添加新工具和集成

📦 当前工具

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

🔌 添加新工具

  1. 在中定义工具常数 constant/tool-name.ts
  2. 在中创建架构 schema/ 目录
  3. 在中实现工具处理程序 tools/ 目录
  4. 在中添加配置 config/ 目录
  5. 在中注册工具 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,
    },
  ],
};

🔄 开发工作流程

  1. 创建特征分支
  2. 实施变更
  3. 运行测试(实施时)
  4. 生成项目
  5. 提交PR

📝 备注

  • 使用ES模块实现更好的模块化
  • 实现标准化通信的模型上下文协议
  • 遵循TypeScript的最佳实践
  • 用于类型安全的Zod模式验证

🛣️ Roadmap

  • []添加更多JIRA操作
  • []实现TODO持久化
  • []添加身份验证
  • []添加测试框架
  • []添加更多集成(GitHub、Slack等)

📄 许可证

麻省理工学院