Decide Test MCP
Enables Claude to generate executable test cases from decision tables in CSV, JSON, or Markdown formats. Provides intelligent test planning guidance and generates Playwright/API test code with TypeScript support.
README
Decide Test MCP
Claude-driven testing workflow that generates test cases from decision tables, provides intelligent guidance for test planning, and generates executable test code.
Features
- π€ Claude-Driven Test Planning: Works with Claude via MCP for intelligent test guidance
- π Decision Table Parsing: Supports CSV, JSON, and Markdown formats
- π Playwright Integration: Generates executable Playwright tests
- π API Testing: Creates API test suites with proper authentication
- π§ MCP Server: Integrates seamlessly with Claude Code
- π TypeScript Support: Generates type-safe test code
- π° Zero Cost: No external API keys required
Installation
As MCP Server (for Claude Code)
- Build the package:
pnpm install
pnpm build
- Add to Claude Code MCP config (
~/.claude-code/mcp.json):
{
"mcpServers": {
"decide-test": {
"command": "node",
"args": ["/absolute/path/to/dist/index.js"]
}
}
}
- Restart Claude Code
As Standalone Package
pnpm install
pnpm build
Usage
Via Claude Code
Once the MCP server is installed, you can use it in Claude Code:
Generate test cases from the decision table at docs/examples/decision-tables/login-decision-table.csv
Claude Code will:
- Parse the decision table
- Explore each test case with AI agents
- Generate Playwright test code
- Save to
tests/e2e/generated/
Programmatic Usage
import {
decisionTableParser,
WebAgent,
testCodeGenerator
} from 'decide-test-mcp';
// 1. Parse decision table
const table = await decisionTableParser.parse(
'docs/examples/decision-tables/login-decision-table.csv'
);
// 2. Get guidance for test planning (you provide the steps)
const webAgent = new WebAgent();
const testSteps = [];
for (const testCase of table.test_cases) {
// Get guidance (example steps and recommendations)
const guidance = webAgent.getExplorationGuidance({
url: 'http://localhost:3000',
test_case: testCase,
objective: testCase.name,
});
console.log(guidance.suggested_approach);
console.log('Example steps:', guidance.example_steps);
// You define the actual test steps based on guidance
const steps = [
{ action: 'navigate', target: 'http://localhost:3000/login', description: 'Go to login' },
{ action: 'fill', selector: 'input[name="email"]', value: 'test@example.com', description: 'Enter email' },
{ action: 'click', selector: 'button[type="submit"]', description: 'Click login' },
];
testSteps.push({
test_case_id: testCase.id,
type: 'web',
steps,
});
}
// 3. Generate test code
const generated = await testCodeGenerator.generate({
test_cases: table.test_cases,
steps: testSteps,
framework: 'playwright',
output_path: 'tests/e2e/generated/',
language: 'typescript',
});
console.log(`Generated ${generated.files_generated.length} test files`);
MCP Tools
1. parse_decision_table
Parse a decision table and generate test case specifications.
Example:
{
"table_path": "docs/examples/decision-tables/login-decision-table.csv",
"format": "csv"
}
2. get_web_test_guidance
Get guidance and example steps for planning web tests. Claude uses this to understand what test steps to create.
Example:
{
"url": "http://localhost:3000",
"test_case": {...},
"objective": "Login with valid credentials"
}
Returns: Suggested approach, example steps, and guidance for Claude to plan the actual test steps.
3. execute_web_test
Execute predefined web test steps using Playwright.
Example:
{
"url": "http://localhost:3000",
"test_case": {...},
"objective": "Login with valid credentials",
"steps": [
{ "action": "navigate", "target": "http://localhost:3000/login", "description": "Go to login" },
{ "action": "fill", "selector": "input[name='email']", "value": "test@example.com", "description": "Enter email" },
{ "action": "click", "selector": "button[type='submit']", "description": "Click login" }
],
"headless": true,
"screenshot_dir": "./screenshots"
}
4. get_api_test_guidance
Get guidance and example steps for planning API tests.
Example:
{
"base_url": "http://localhost:3000/api",
"test_case": {...},
"objective": "Create trip via API",
"auth": {
"type": "bearer",
"credentials": {"token": "..."}
}
}
Returns: Suggested approach, example API steps, and guidance for Claude to plan the actual API test steps.
5. execute_api_test
Execute predefined API test steps.
Example:
{
"base_url": "http://localhost:3000/api",
"test_case": {...},
"objective": "Create trip via API",
"steps": [
{ "method": "POST", "endpoint": "/auth/login", "body": {...}, "expected_status": 200 },
{ "method": "POST", "endpoint": "/trips", "body": {...}, "expected_status": 201 }
],
"auth": {
"type": "bearer"
}
}
6. generate_test_code
Generate executable test code from test cases and steps.
Example:
{
"test_cases": [...],
"steps": [...],
"framework": "playwright",
"output_path": "tests/e2e/generated/",
"language": "typescript"
}
7. run_generated_tests
Execute generated tests and return results.
Example:
{
"test_path": "tests/e2e/generated/login.spec.ts",
"framework": "playwright",
"reporter": "list"
}
Decision Table Formats
CSV Format
Email,Password,Action,Expected Result,Priority
valid@example.com,ValidPass123,Click Login,Login successful,high
invalid@example.com,ValidPass123,Click Login,Show error message,medium
JSON Format
{
"feature": "User Login",
"rules": [
{
"id": "TC001",
"conditions": {
"email": "valid",
"password": "valid"
},
"actions": ["click_login"],
"expected": ["redirect_to_dashboard"]
}
]
}
Markdown Format
# User Login
| Email | Password | Action | Expected Result |
|-------|----------|--------|----------------|
| valid | valid | Click Login | Login successful |
| invalid | valid | Click Login | Show error |
Examples
See docs/examples/decision-tables/ for complete examples:
login-decision-table.csv- User authentication teststrip-creation-decision-table.json- Trip creation with tier limitscollaboration-decision-table.md- Collaboration & permissions
Development
# Install dependencies
pnpm install
# Build
pnpm build
# Run in development mode
pnpm dev
# Run tests
pnpm test
Architecture
βββββββββββββββββββββββββββββββββββββββ
β MCP Server β
β (Model Context Protocol) β
βββββββββββββββββββββββββββββββββββββββ
β
βββββββββββΌββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββ ββββββββ ββββββββββββ
β Parser β βAgentsβ βGenerator β
ββββββββββ ββββββββ ββββββββββββ
Troubleshooting
MCP Server Not Appearing in Claude Code
- Check MCP config path is correct
- Verify Node.js is accessible
- Check server logs:
~/.claude-code/logs/mcp-ai-testing.log - Restart Claude Code
Test Execution Failing
- Check application is running at specified URL
- Review test steps for correctness
- Try with
headless: falseto see browser in action - Check selector specificity
Test Generation Issues
- Ensure test cases and steps are complete
- Check output directory permissions
- Review generated code for syntax errors
License
MIT
Support
For issues and questions:
- Documentation:
docs/AI_TESTING_WORKFLOW.md
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.