OpenTester
MCP-First 测试执行基础设施
OpenTester 是专为 AI 编码工具(Claude Code、Cursor、OpenCode 等)设计的测试执行引擎。它提供统一的 DSL 格式和 MCP 接口,让 Agent 能够生成、执行和管理测试用例,实现"编码-测试-修复"的自动化闭环。
核心定位
┌─────────────────────────────────────────┐
│ AI Agent (Claude Code / Cursor / ...) │
│ ├─ 生成 DSL 测试用例 │
│ ├─ 决策测试策略 │
│ └─ 分析失败原因 │
├─────────────────────────────────────────┤
│ OpenTester (MCP Server) │
│ ├─ 验证 DSL 语法 │
│ ├─ 执行测试 (CLI/GUI/TUI) │
│ ├─ 存储用例/项目 │
│ └─ 返回结构化结果 │
├─────────────────────────────────────────┤
│ Web UI (辅助观察面板) │
│ ├─ 查看执行进度 │
│ ├─ 调试用例(创建/编辑) │
│ └─ 查看历史报告 │
└─────────────────────────────────────────┘
安装
pip install opentester
快速开始
启动服务
# 一键启动 FastAPI + MCP(前台模式)
opentester start
# 后台运行
opentester start --daemon
# 只启动 API
opentester start --api
# 只启动 MCP
opentester start --mcp
# 查看状态
opentester status
# 停止服务
opentester stop
# 环境检查
opentester doctor
配置 Claude Code
在 .claude/settings.json 中添加 MCP 配置:
{
"mcpServers": {
"opentester": {
"url": "http://localhost:8001/mcp"
}
}
}
核心功能
- DSL 验证: YAML 格式的测试定义语言验证
- 测试执行: 当前实现 CLI、WEB(GUI/TUI 为实验性阶段能力)
- 项目管理: 项目存储于 XDG 数据目录(Windows 为
%LOCALAPPDATA%\\opentester\\) - 实时监控: WebSocket 实时推送执行进度
MCP 工具列表
| 工具 | 描述 |
|---|---|
list_projects |
列出所有测试项目 |
get_project |
获取项目详情 |
create_project |
创建项目 |
delete_project |
删除项目 |
validate_dsl |
验证 DSL 语法 |
save_case |
保存用例 |
delete_case |
删除用例 |
run_case |
执行单个用例 |
run_project |
执行整个项目 |
stop_execution |
停止执行 |
get_execution_status |
获取执行状态 |
get_execution_log |
获取详细日志 |
list_templates |
列出模板 |
create_template |
创建模板 |
instantiate_template |
从模板创建用例 |
端口
- FastAPI: http://localhost:8000
- MCP Server: http://localhost:8001/mcp
- API Docs: http://localhost:8000/docs
数据存储
- 项目数据:
~/.opentester/projects/{project_id}.json - 执行日志:
~/.opentester/executions/ - PID 文件:
~/.opentester/pids/
开源协议
MIT License
Metadata
Release files for opentester 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| opentester-0.2.0.tar.gz | 144.9 kB | Without provenance | Details for opentester-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| opentester-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for opentester-0.2.0-py3-none-any.whl |
Total release size: 234.8 kB
Release files / opentester-0.2.0.tar.gz
| Download URL | opentester-0.2.0.tar.gz |
|---|---|
| Size | 144.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bfe88dac31a578f24282c4fbad46e940cc9637d5d387912f677d3d04c915354
|
|
BLAKE2b-256 checksum How to use checksums |
433fd05b232f731e6e41e2812503d641ac80744607cd5d82e0fa43c70b411982
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Release files / opentester-0.2.0-py3-none-any.whl
| Download URL | opentester-0.2.0-py3-none-any.whl |
|---|---|
| Size | 90.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
942ed48f935657d98b2551b75430fd2886aa12ad73c8fd045916b04227c621d8
|
|
BLAKE2b-256 checksum How to use checksums |
28320ea1839e60c64cd654e6fa7531abf91d0cb9574753f4992d49b4bcfc3e21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Security for opentester 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.