AI-powered test automation for code changes using OpenTester MCP Server.
- Claude Code (CLI) - Via
SKILL.md+ HTTP MCP - Claude Desktop - Via STDIO MCP
- Cursor (IDE) - Via
.cursor/rules/opentester.mdc - Windsurf (IDE) - Via
.windsurf/config.json - Generic MCP (Any MCP-compatible tool)
- AI-Generated Tests: Agent analyzes code and generates DSL test cases
- DSL Validation: Real-time validation with helpful error messages
- Test Execution: Run tests via MCP tools
- Results Analysis: Automatic failure analysis and suggestions
- Control Flow: Support for conditional steps in tests
- Multiple Examples: API, CLI, and TUI test examples
Install OpenTester via PyPI:
pip install opentesterOr download standalone executable from GitHub Releases.
npx skills add https://github.com/kznr02/OpenTester-Skills --skill opentester-
Install skill files:
mkdir -p ~/.claude/skills/opentester cp SKILL.md ~/.claude/skills/opentester/ cp -r examples/ ~/.claude/skills/opentester/
-
Start OpenTester server:
opentester start
-
Configure MCP in
.claude/settings.json:{ "mcpServers": { "opentester": { "url": "http://localhost:8001/mcp" } } }
Add to settings.json:
Windows: %APPDATA%\Claude\settings.json
macOS: ~/Library/Application Support/Claude/settings.json
Linux: ~/.config/Claude/settings.json
{
"mcpServers": {
"opentester": {
"command": "opentester",
"args": ["mcp"]
}
}
}-
Copy
.cursor/rules/opentester.mdcto~/.cursor/rules/ -
Configure MCP in Cursor Settings > MCP:
{ "mcpServers": { "opentester": { "url": "http://localhost:8001/mcp" } } }
Merge .windsurf/config.json into ~/.windsurf/config.json:
{
"mcp": {
"servers": {
"opentester": {
"url": "http://localhost:8001/mcp"
}
}
}
}| Command | Description |
|---|---|
/test or /t |
Create and run tests for current changes |
/test-quick |
Quick test without PRD |
/test-with-prd |
Comprehensive tests using PRD |
run tests |
Execute existing tests |
validate dsl |
Check test syntax |
list projects |
Show all test projects |
delete project <id> |
Delete a project and all its test cases |
delete case <id> |
Delete a specific test case |
list templates |
Show all DSL templates |
use template <id> |
Create test from a template |
save template |
Save test case as template |
# Make some code changes
git diff
# Start OpenTester (in another terminal)
opentester start
# Ask AI to create tests
/test user authentication
# AI will:
# 1. Call opentester.listProjects
# 2. Analyze code changes
# 3. Generate DSL test cases
# 4. Validate and save them
# 5. Execute the tests
# 6. Report results
# Run tests again later
run testsopentester-skills/
├── SKILL.md # Claude Code skill definition
├── setup.json # Setup configuration
├── EXAMPLES.md # Usage examples
├── REFERENCE.md # DSL reference
├── examples/ # Example test files
│ ├── cli_test.yaml
│ ├── api_test.yaml
│ └── control_flow.yaml
├── .cursor/
│ └── rules/
│ └── opentester.mdc # Cursor rules
├── .windsurf/
│ └── config.json # Windsurf MCP config
├── install.ps1 # Windows installer
└── install.sh # macOS/Linux installer
version: "1.0"
meta:
name: "Test Name"
description: "What this test verifies"
steps:
- name: "Execute command"
action: exec
command: echo "Hello World"
- name: "Verify output"
action: assert
assertion:
type: stdout_contains
expected: "Hello World"See REFERENCE.md for complete DSL documentation.
listProjects- List all test projectsgetProject- Get project details with test casescreateProject- Create a new projectdeleteProject- Delete a projectvalidateDSL- Validate DSL YAML syntaxsaveCase- Save a test casedeleteCase- Delete a test caserunCase- Execute a single test caserunProject- Execute all cases in a projectstopExecution- Stop a running executiongetExecutionStatus- Get execution statusgetExecutionLog- Get detailed execution loglistTemplates- List all templatesgetTemplate- Get template detailscreateTemplate- Create a new templateupdateTemplate- Update a templatedeleteTemplate- Delete a templateinstantiateTemplate- Create test from templatecreateTemplateFromCase- Convert case to template
- FastAPI (Web UI / REST API): http://localhost:8000
- MCP Server: http://localhost:8001/mcp
- API Docs: http://localhost:8000/docs
- Check skill is in correct directory
- Verify SKILL.md has correct frontmatter
- Restart AI coding tool
- Verify OpenTester is running:
opentester status
- Start OpenTester:
opentester start
- Check MCP configuration
- Restart AI coding tool
Common errors:
- YAML syntax errors (indentation)
- Invalid action types
- Missing required fields
MIT