MCP for Testing: How to Connect AI Agents to QA
Shiplight AI Team
Updated on April 1, 2026
Shiplight AI Team
Updated on April 1, 2026
AI coding agents are changing how software gets built. Claude Code generates features, Cursor autocompletes complex logic, and Codex refactors entire modules. But there is a gap in the workflow: these agents write code, but they cannot verify that the code actually works in a browser.
Model Context Protocol (MCP) closes that gap. It gives AI agents the ability to interact with external tools — including browsers, test runners, and QA platforms — through a standardized interface. When an AI agent has access to an MCP server for testing, it can open a browser, verify UI behavior, and generate E2E tests as part of its development workflow.
This guide explains what MCP is, how Shiplight's MCP server works, and how to connect it to the AI coding agents your team already uses.
Model Context Protocol is an open standard that lets AI models interact with external tools and data sources. Think of it as a universal adapter between AI agents and the services they need to use.
Without MCP, an AI agent is limited to reading and writing files. It can generate test code, but it cannot run those tests, inspect their results, or verify that the application behaves correctly. MCP extends the agent's capabilities by providing structured access to tools that the agent can invoke during its workflow.
An MCP server exposes a set of tools — functions that the AI agent can call. Each tool has a defined interface: what parameters it accepts and what it returns. The AI agent discovers available tools, decides when to use them, and interprets the results.
For testing, this means an AI agent can go beyond "generate a test file" to "generate a test, run it against the live application, check the results, and fix any issues."
Shiplight's MCP server is purpose-built for the AI-native QA loop. It exposes testing-specific tools that AI agents can use to interact with your application and your test suite.
The server runs locally alongside your development environment. When an AI agent connects to it, the agent gains access to several capabilities.
Browser automation. The agent can open a Playwright-powered browser, navigate to URLs, click elements, fill forms, and take screenshots. This is not a headless screenshot service — it is full browser interaction that mirrors what a real user does.
UI verification. The agent can verify that specific elements are visible, that text content matches expectations, and that the page is in the expected state. This lets the agent check its own work after making code changes.
Test generation. The agent can create YAML-based E2E test files by observing the application and generating step-by-step test flows. These tests are immediately runnable through Shiplight's test runner.
Test execution. The agent can run existing tests and read the results. If a test fails, the agent sees the failure details — which step failed, what was expected, what was found — and can use that information to fix the underlying code.
Test debugging. When tests fail, the agent can inspect screenshots, trace logs, and error messages to diagnose issues. This creates a closed loop: code, test, fix, repeat — all within the agent's context.
Claude Code is Anthropic's CLI-based coding agent. Connecting Shiplight's MCP server to Claude Code requires adding the server configuration to your project.
Step 1: Install the Shiplight MCP package.
npm install -g @shiplight/mcp-serverStep 2: Add the MCP server to your Claude Code configuration.
Create or edit .mcp.json in your project root:
{
"mcpServers": {
"shiplight": {
"command": "shiplight-mcp",
"args": ["--port", "3100"],
"env": {
"SHIPLIGHT_API_KEY": "your-api-key"
}
}
}
}Step 3: Start Claude Code in your project directory.
claudeClaude Code automatically discovers the MCP server configuration and connects to it. You can verify the connection by asking Claude to list available tools — you should see Shiplight's testing tools in the list.
Step 4: Use testing tools in your workflow.
Once connected, you can prompt Claude Code with instructions like:
Claude Code will use Shiplight's MCP tools to execute these tasks, providing a complete testing layer for AI coding agents.
Cursor and OpenAI's Codex CLI both support MCP servers using the same configuration format. In Cursor, open Settings and navigate to the MCP section. In Codex, add the server to your project configuration file. The server definition is identical:
{
"name": "shiplight",
"command": "shiplight-mcp",
"args": ["--port", "3100"],
"env": {
"SHIPLIGHT_API_KEY": "your-api-key"
}
}Once connected, both agents can access Shiplight's testing tools. Ask them to verify your changes in the browser, generate tests for new features, or run your existing test suite.
Once connected, the AI agent has access to a practical set of QA capabilities that fit naturally into the development workflow.
During feature development: The agent writes code for a new feature, then immediately opens a browser to verify the feature works. If something is wrong, it sees the problem in the browser and fixes the code — without you switching context.
During code review: The agent can run E2E tests against a PR branch and report results. This turns test execution into part of the review process, not a separate step.
During test creation: Instead of manually writing tests after the fact, the agent generates YAML-based E2E tests while building the feature. The tests are committed alongside the code, ready for CI/CD.
During debugging: When a test fails in CI, the agent can reproduce the failure locally, inspect the browser state, and propose a fix.
MCP-connected testing creates the AI-native QA loop: the agent writes code, tests it, and iterates — without human intervention for routine verification. This does not replace QA engineers. It handles repetitive checks so QA teams can focus on test strategy, edge cases, and exploratory testing.
For teams adopting this workflow, the Shiplight adoption guide covers organizational and technical steps. The plugin system handles integration with your existing tools and CI/CD pipeline.
The fastest way to see MCP-connected testing in action is through the Shiplight demo. It walks through the setup, shows the agent using browser tools, and demonstrates test generation in a live environment.
For teams already using AI coding agents, adding the MCP server is a 10-minute setup that immediately expands what your agent can do. The testing tools are free to use with the MCP server — no separate QA platform subscription required.
References: Playwright Documentation