Kirha Smithery门户
A configurable MCP (Model Context Protocol) server for Kirha tool planning ready to use with Smithery
Features
- JSON配置:轻松配置工具、垂直产品和API端点
- 动态工具注册:工具根据配置进行注册
- 基于会话的API密钥:每个会话都有自己的API密钥,用于安全执行工具
- 调试模式:用于开发的可选调试日志记录
- 模块化架构:使用单独文件中的工具将关注点彻底分离
配置
环境配置(smithery.yaml)
runtime: "container"
startCommand:
type: "http"
configSchema:
type: "object"
properties:
apiKey:
type: "string"
description: "Your API key"
debug:
type: "boolean"
description: "Enable debug logging"
default: false
configPath:
type: "string"
description: "Path to custom configuration file"
required: ["apiKey"]JSON配置(config.JSON)
{
"mcp": {
"name": "kirha-crypto",
"version": "1.0.0"
},
"tool": {
"name": "execute-crypto-tool-planning",
"title": "Crypto Tool Planning",
"description": "Execute crypto-related tool planning",
"enabled": true
},
"vertical": "crypto",
"api": {
"executeToolPlanningUrl": "https://api.kirha.ai/chat/v1/tool-planning/execute",
"summarization": {
"enable": true,
"model": "kirha-flash"
}
}
}创建叉子
要为不同的垂直方向创建叉:
- 复制
config.example.json向config.json - 更新配置:
- 改变 mcp.name 到你的垂直名称 - 更新 vertical 到您的垂直ID - 修改 tool 使用您的特定工具创建对象 - 更新 tool.name, tool.title,以及 tool.description
项目结构
src/
├── index.ts # Main server entry point
├── types.ts # Type definitions
└── tools/
└── toolPlanning.ts # Tool planning implementation发展
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build for production
npm run build
# Start built server
npm start添加新工具
- 在中创建新文件
src/tools/(例如。,newTool.ts) - 按照以下步骤执行刀具注册功能
ToolRegistrationFunction类型 - 将工具添加到
availableTools在中映射src/index.ts - 更新您的
config.json包括新工具
会话管理
- 每个客户端连接都从Smithery获得自己的API密钥
- 配置在连接时绑定
- 工具可以访问特定于会话的配置
- API密钥安全地传递给工具执行函数
调试模式
通过设置启用调试模式 debug: true 在会话配置中:
GET /mcp?apiKey=your-key&debug=true这将记录:
- 配置加载
- 工具注册
- 工具执行
- 错误详细信息
