使用说明
@aegis ai/mcp工具选择
一个MCP服务器,为给定的任务推荐使用哪些工具。它从使用模式中学习,并根据成功率随时间调整建议。
安装
bun install @aegis-ai/mcp-toolselect
或者克隆并直接运行:
git clone https://github.com/aegis-ai/mcp-toolselect.git
cd mcp-toolselect
bun install
bun src/index.ts
配置
添加到MCP客户端配置中(例如。 claude_desktop_config.json):
{
"mcpServers": {
"toolselect": {
"command": "bunx",
"args": ["@aegis-ai/mcp-toolselect"]
}
}
}
或者,如果从源代码运行:
{
"mcpServers": {
"toolselect": {
"command": "bun",
"args": ["/path/to/mcp-toolselect/src/index.ts"]
}
}
}
工具
推荐工具
获取任务描述的排名工具建议。返回置信度得分、优先级和历史成功率。
参数:
task(字符串,必填)-任务描述max_results(数字,可选)-要返回的最大建议值(默认值:5)
例子:
{
"task": "Write integration tests for the payment API",
"max_results": 3
}
答复:
{
"task": "Write integration tests for the payment API",
"analysis": {
"keywords": ["testing", "coding", "api"],
"complexity": "medium",
"estimatedDuration": "medium"
},
"recommendations": [
{
"tool": "jest",
"confidence": 0.85,
"reason": "matches keyword \"testing\"; strength \"integration tests\" found in task",
"priority": "required",
"successRate": 0.92,
"timesUsed": 47
}
]
}
注册表工具
注册一个工具及其功能,以便为未来的任务推荐它。
参数:
name(字符串,必填)-唯一工具名称description(string,必填)-工具的功能category(字符串,必填)-类别(例如编码、测试、部署、研究、分析)strengths(string[],必填)-该工具擅长什么use_cases(string[],必填)-工具发光的典型场景
例子:
{
"name": "playwright",
"description": "Browser automation and end-to-end testing framework",
"category": "testing",
"strengths": ["browser automation", "e2e testing", "cross-browser", "screenshot comparison"],
"use_cases": ["end-to-end tests", "visual regression testing", "web scraping", "form automation"]
}
记录_用法
记录工具用于任务以及是否成功。这种反馈推动了未来的推荐质量。
参数:
tool(字符串,必填)-工具名称task(字符串,必填)-任务描述success(boolean,必填)-工具是否成功完成任务duration_ms(数字,可选)-执行时间(毫秒)notes(字符串,可选)-其他上下文
例子:
{
"tool": "playwright",
"task": "Run e2e tests for checkout flow",
"success": true,
"duration_ms": 12500,
"notes": "All 15 tests passed"
}
get_tool_stats
获取已注册工具的使用统计数据和成功率。
参数:
tool(字符串,可选)-特定工具名称。忽略获取所有统计数据。
示例响应:
{
"totalTools": 8,
"totalUsages": 142,
"tools": [
{
"name": "playwright",
"timesUsed": 47,
"successCount": 43,
"failCount": 4,
"avgDurationMs": 11200,
"overallSuccessRate": 0.91,
"contextSuccessRates": {
"testing": 0.94,
"debugging": 0.78
}
}
]
}
list_tools
按类别列出所有已注册的工具。
参数:
category(字符串,可选)-按类别筛选
运作原理
- 注册工具 凭借其能力和用例
- 征求建议 通过描述你的任务
- 记录结果 使用工具后(成功/失败)
- 系统学习哪些工具最适合哪种类型的任务,并相应地调整未来的置信度得分
推荐引擎:
- 分析任务描述以提取关键字并估计复杂性
- 将关键字与注册的工具优势和用例相匹配
- 使用历史成功率(指数移动平均线)调整信心
- 返回按相关性排序的优先建议
数据存储
所有数据都存储在本地 ~/.mcp-toolselect/:
tool-registry.json-已注册的工具及其元数据tool-stats.json-汇总使用统计数据usage-log.jsonl-仅附加使用日志进行审核
许可证
麻省理工学院-版权所有2026 AEGIS人工智能合作社