用TypeScript编写的Codecov模型上下文协议服务器。
get_commit_coverage_totals - 返回给定提交的覆盖率总计,并按文件细分覆盖率总计。使用此API。suggest_tests - 根据Codecov报告建议要编写的测试。使用:让您的AI代理在聊天中“运行get_commit_coverage_totals工具”。
配置:无需安装任何东西,只需使用npx运行,并从这里输入您的Codecov API密钥 - 转到设置 -> 访问。
以及git URL:git remote get-url origin
光标命令:npx -y codecov-mcp-server --api-key XXX --git-url XXX
(在Windows上)光标命令:cmd.exe /c npx -y codecov-mcp-server --api-key XXX --git-url XXX
要与Claude(或任何AI)一起使用,请添加服务器配置:
{
"mcpServers": {
"codecov-mcp-server": {
"command": "npx",
"args": [
"-y",
"codecov-mcp-server",
],
"env": {
"CODECOV_API_KEY": "XXX",
"GIT_URL": "XXX"
}
}
}
}
由于MCP服务器通过stdio通信,调试可能会很困难。我们推荐使用MCP Inspector,它作为包脚本提供:
npm run inspector
Inspector将提供一个URL,以便您可以在浏览器中访问调试工具。
安装依赖项:
npm install
构建服务器:
npm run build
用于开发并自动重建:
npm run watch