Guides

MCP for Testing: How to Connect AI Agents to QA

Shiplight AI Team

Updated on May 19, 2026

View as Markdown

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 Plugin works, and how to connect it to the AI coding agents your team already uses.

What Is MCP (Model Context Protocol)?

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

How Shiplight Plugin Works

Shiplight Plugin is purpose-built for the AI-native QA loop. Your agent uses Shiplight Plugin to verify every code change in a real browser. Skills encode the testing expertise — guiding your agent to generate thorough, self-healing regression tests and run automated reviews across security, performance, accessibility, and more. The plugin 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 full browser interaction that mirrors what a real user does. Verification with built-in agent skills. Skills encode QA expertise that guides the agent through verification workflows — not just "click and check" but structured reviews covering UI correctness, security headers, performance metrics, accessibility compliance, and more. The agent doesn't need to know testing best practices — the skills provide that knowledge. 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 self-healing and 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.

Connecting to Claude Code

Claude Code is Anthropic's CLI-based coding agent. Connecting Shiplight Plugin to Claude Code requires adding the server configuration to your project. Step 1: Install the Shiplight MCP package.

npm install -g @shiplight/mcp-server

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

claude

Claude 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:

  • "Open the app at localhost:3000 and verify the login page renders correctly"
  • "Generate an E2E test for the checkout flow"
  • "Run the E2E tests and fix any failures"

Claude Code will use Shiplight's MCP tools to execute these tasks, providing a complete testing layer for AI coding agents. For a deeper walkthrough specific to Claude Code, see How to QA Code Written by Claude Code.

Connecting to Cursor and Codex

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.

MCP Testing Capabilities: What Your Agent Can Do

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.

The AI-Native QA Loop

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.

Get Started with MCP for Testing

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.

Frequently Asked Questions

What is MCP (Model Context Protocol)?

MCP is an open standard that lets AI models interact with external tools and data sources through a standardized interface. For testing, it means AI coding agents like Claude Code, Cursor, and Codex can open a real browser, run tests, and inspect results — all as part of their development workflow.

Which AI coding agents support MCP for testing?

Claude Code, Cursor, and OpenAI Codex all support MCP servers. Shiplight Plugin works with all three using the same configuration format. Any MCP-compatible agent can connect to Shiplight's testing tools.

Do I need a Shiplight account to use the MCP server?

No account is required to get started. The MCP server and browser automation tools are free to use. A Shiplight account is needed for cloud test execution, CI/CD integration, and the no-code test editor.

How is MCP testing different from traditional test automation?

Traditional test automation requires developers to manually write and maintain test scripts. With MCP-connected testing, the AI agent writes code, verifies it in a real browser, and generates tests automatically — all within the same development session. The tests are self-healing, so they adapt when the UI changes rather than breaking on every refactor.

Can the agent fix failing tests automatically?

Yes. When a test fails, the agent receives the failure details — which step failed, what was expected, and what was found. It can use that context to diagnose the issue, fix the underlying code, and re-run the test to confirm the fix — without human intervention for routine failures.

---

References: Playwright Documentation