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 default

IDE 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.

ParameterTypeRequiredDescription
projectPathstringNoPath 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.

ParameterTypeRequiredDescription
projectPathstringNoPath to the project root. Defaults to cwd.
untestedOnlybooleanNoIf true, only return files without existing tests.

generate_tests#

Generate a test file for a given source file using AI.

ParameterTypeRequiredDescription
filePathstringYesPath to the source file to generate tests for.
projectPathstringNoPath to the project root. Defaults to cwd.

fix_tests#

Fix a failing test file given the error output from the test runner.

ParameterTypeRequiredDescription
testFilePathstringYesPath to the failing test file.
errorOutputstringYesThe error output from the test runner.
sourceFilePathstringYesPath to the source file being tested.
projectPathstringNoPath to the project root. Defaults to cwd.

run_tests#

Run a test file and return pass/fail status, test counts, and error output.

ParameterTypeRequiredDescription
testFilePathstringYesPath to the test file to run.
projectPathstringNoPath 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.

ParameterTypeRequiredDescription
filePathsstring[]YesArray of source file paths to generate tests for.
projectPathstringNoPath to the project root. Defaults to cwd.
maxFixAttemptsnumberNoMaximum fix iterations per file. Defaults to 3.

Resources#

MCP resources provide contextual data that AI assistants can read.

URIDescription
shiptested://analysisCached project analysis including language, framework, test framework, and testable files. Cached for the session.
shiptested://runs/latestLatest test run results from the dashboard. Proxy mode only.

Prompts#

Pre-built prompts that help AI assistants provide better testing advice.

PromptArgumentDescription
test_strategyfilePathAnalyze a source file and suggest a comprehensive testing strategy.
review_testtestFilePathReview an existing test file for completeness and correctness.

Requirements#

  • Node.js 18 or later
  • A ShipTested API key (SHIPTESTED_API_KEY)

Next Steps#

Was this page helpful?