MCP Server Integration
The shiptested-mcp package exposes ShipTested's test generation, fixing, and analysis capabilities as an MCP server. This lets you use ShipTested natively inside Cursor, Claude Code, Claude Desktop, and any MCP-compatible tool.
Configuration#
All requests are routed through the ShipTested API. Set your API key via the SHIPTESTED_API_KEY environment variable:
SHIPTESTED_API_KEY=sk_live_...
SHIPTESTED_API_URL=https://api.shiptested.app # optional, this is the defaultIDE Setup#
Claude Code#
Create a .mcp.json file in your project root:
{
"mcpServers": {
"shiptested": {
"command": "npx",
"args": ["shiptested-mcp"],
"env": {
"SHIPTESTED_API_KEY": "sk_live_..."
}
}
}
}Cursor#
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"shiptested": {
"command": "npx",
"args": ["shiptested-mcp"],
"env": {
"SHIPTESTED_API_KEY": "sk_live_..."
}
}
}
}Claude Desktop#
Add to your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"shiptested": {
"command": "npx",
"args": ["shiptested-mcp"],
"env": {
"SHIPTESTED_API_KEY": "sk_live_..."
}
}
}
}Do not commit files containing API keys to version control.
Available Tools#
Once connected, the following tools become available to your AI assistant.
analyze_project#
Analyze a project's structure, detecting language, framework, test framework, and testable files.
| Parameter | Type | Required | Description |
|---|---|---|---|
projectPath | string | No | Path to the project root. Defaults to cwd. |
list_testable_files#
List files in the project that can have tests generated. Optionally filter to only untested files.
| Parameter | Type | Required | Description |
|---|---|---|---|
projectPath | string | No | Path to the project root. Defaults to cwd. |
untestedOnly | boolean | No | If true, only return files without existing tests. |
generate_tests#
Generate a test file for a given source file using AI.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath | string | Yes | Path to the source file to generate tests for. |
projectPath | string | No | Path to the project root. Defaults to cwd. |
fix_tests#
Fix a failing test file given the error output from the test runner.
| Parameter | Type | Required | Description |
|---|---|---|---|
testFilePath | string | Yes | Path to the failing test file. |
errorOutput | string | Yes | The error output from the test runner. |
sourceFilePath | string | Yes | Path to the source file being tested. |
projectPath | string | No | Path to the project root. Defaults to cwd. |
run_tests#
Run a test file and return pass/fail status, test counts, and error output.
| Parameter | Type | Required | Description |
|---|---|---|---|
testFilePath | string | Yes | Path to the test file to run. |
projectPath | string | No | Path to the project root. Defaults to cwd. |
generate_and_run#
Full test generation loop: generate tests, run them, fix failures, and iterate until they pass.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePaths | string[] | Yes | Array of source file paths to generate tests for. |
projectPath | string | No | Path to the project root. Defaults to cwd. |
maxFixAttempts | number | No | Maximum fix iterations per file. Defaults to 3. |
Resources#
MCP resources provide contextual data that AI assistants can read.
| URI | Description |
|---|---|
shiptested://analysis | Cached project analysis including language, framework, test framework, and testable files. Cached for the session. |
shiptested://runs/latest | Latest test run results from the dashboard. Proxy mode only. |
Prompts#
Pre-built prompts that help AI assistants provide better testing advice.
| Prompt | Argument | Description |
|---|---|---|
test_strategy | filePath | Analyze a source file and suggest a comprehensive testing strategy. |
review_test | testFilePath | Review an existing test file for completeness and correctness. |
Requirements#
- Node.js 18 or later
- A ShipTested API key (
SHIPTESTED_API_KEY)
Next Steps#
- CLI Reference - full command reference for the ShipTested CLI
- Configuration - customize config files, formats, and environment variables
- CI/CD Integration - automate test generation in your pipeline
Was this page helpful?