这是一个MCP(模型上下文协议)服务器,支持运行Bruno集合。该服务器允许LLMs通过Bruno执行API测试,并通过标准化接口获取详细的测试结果。
要通过Smithery自动安装Bruno MCP服务器到Claude桌面:
npx -y @smithery/cli install @hungthai1401/bruno-mcp --client claude
# 安装依赖
npm install
# 构建项目
npm run build
在Claude桌面配置文件~/Library/Application Support/Claude/claude_desktop_config.json中添加服务器:
{
"mcpServers": {
"bruno-runner": {
"command": "npx",
"args": ["-y", "bruno-mcp"],
}
}
}
运行一个Bruno集合并返回测试结果。
参数:
collection(必需):Bruno集合的路径environment(可选):环境文件的路径variables(可选):键值对形式的环境变量示例响应:
{
"success": true,
"summary": {
"total": 5,
"failed": 0,
"passed": 5
},
"failures": [],
"timings": {
"started": "2024-03-14T10:00:00.000Z",
"completed": "2024-03-14T10:00:01.000Z",
"duration": 1000
}
}
您可以在Claude中使用此服务器来运行Bruno集合:
"运行位于/path/to/collection.bru的Bruno集合,并告诉我所有测试是否都通过了"
Claude将:
src/
├── index.ts # 入口点
├── server.ts # MCP服务器实现
├── runner.ts # Bruno运行器实现
└── types.ts # 类型定义
# 运行测试
npm test
# 运行带有覆盖率的测试
npm test:coverage
# 构建项目
npm run build
# 清理构建产物
npm run clean
MIT