
Testing
io.github.rog0x由 GitHub 账号 rog0x 发布v1.0.2更新于 Oct 27, 2026
Test generation, mocks, coverage analysis for AI agents
概览
本地 MCP 服务器,为助手提供面向 JavaScript/TypeScript 项目的测试生成、模拟数据和覆盖率分析工具。
- 可以做什么
- 根据函数签名生成 Jest 或 Vitest 测试用例,覆盖正常路径、边界情况、错误情况和极值
- 生成姓名、邮箱、地址、UUID、电话等模拟数据记录,也可混合多字段生成
- 根据字段结构生成模拟 REST API 响应数据,可设置方法、状态码和包装格式
- 分析源码与测试代码,找出未被测试的函数,并按导出状态、复杂度和异步特性排序
- 对比期望值与实际值 JSON,生成 Jest、Vitest 或 Chai 的逐字段断言代码
- 适用场景
- 适合为 JS/TS 代码库编写或补全单元测试、快速获得逼真的测试夹具或 API 模拟数据,以及初步了解哪些函数缺少测试覆盖。
- 运行要求
- 以本地 stdio 进程运行,来自 npm 包 @rog0x/mcp-testing-tools;README 的安装步骤会安装依赖并构建,然后在客户端配置中用 node 指向构建产物 dist/index.js。未声明认证、环境变量或请求头。
安装
在 SourceWeft 中
- 打开 控制台中的 Testing,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@rog0x/mcp-testing-tools
Testing and quality assurance tools for AI agents, exposed via the Model Context Protocol (MCP).
Tools
generate_tests
Generate test cases from a function signature. Produces four categories of tests as ready-to-run Jest or Vitest code:
- Happy path -- valid inputs, expected outputs
- Edge cases -- empty strings, zero values, null parameters
- Error cases -- missing arguments, wrong types
- Boundary values -- extreme numbers, large arrays, NaN
Parameters:
generate_mock_data
Generate realistic mock data for testing. Supported types:
name, email, address, date, uuid, phone, company, credit_card, ip
Parameters:
generate_api_mock
Generate mock API responses from a schema definition. Creates realistic JSON payloads for REST endpoints by inferring values from field names and types.
Parameters:
analyze_test_coverage
Analyze source code and test code to find untested functions. Prioritizes suggestions by:
- Export status (public API surface)
- Cyclomatic complexity estimate
- Parameter count
- Async functions (more error paths)
Parameters:
generate_assertions
Generate detailed assertion code by comparing expected and actual values. Performs deep diff and produces per-field assertions with descriptive comments.
Parameters:
Setup
Usage with Claude Desktop
Add to your claude_desktop_config.json:
License
MIT
来源:README.md,提交 738b43e
工具
0版本历史
1- v1.0.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分