If you are building AI-powered test automation, you may eventually run into this question:
Should we use RAG or MCP?
The question sounds reasonable, but it is slightly misleading.
RAG and MCP solve very different problems.
In testing, you will probably need both.
LLMs can already generate Selenium, Cypress, and Playwright tests from natural-language prompts.
Ask:
Test the login flow with valid credentials.
and an AI can produce a reasonable script.
But there is a problem.
The AI does not automatically know:
It knows how testing works, but not necessarily how your product works.
That is where RAG becomes useful.
RAG gives the AI access to project-specific information.
Instead of working from a generic prompt, the model can retrieve relevant:
Requirements
Test Cases
API Docs
Bug History
Business Rules
Existing Automation
Test Data
Now consider the same request:
Test the checkout flow.
Without RAG, the AI may create a fairly standard checkout process.
With RAG, it could first learn:
The generated test becomes much more relevant.
But there is still a limitation.
Knowing what should happen does not mean the AI can actually test it.
MCP gives an AI system access to external tools.
For browser testing, that could mean allowing an AI agent to use Playwright capabilities to:
Open Page
↓
Inspect UI
↓
Enter Data
↓
Click
↓
Observe Result
↓
Validate
So the difference is simple:
RAG gives the AI context.
MCP gives the AI capabilities.
Or even shorter:
RAG = What does the AI know?
MCP = What can the AI do?
Imagine an AI receives this instruction:
Check whether the new checkout release is working correctly.
RAG could help it retrieve:
The AI can use this information to decide what should be tested.
MCP can then allow the agent to interact with testing tools and execute those checks.
The workflow becomes:
Requirement
↓
Retrieve Relevant QA Knowledge
↓
AI Plans Test
↓
Use Testing Tools
↓
Execute
↓
Analyse Result
This is fundamentally different from:
Prompt
↓
Generate Playwright Code
The second workflow gives you code.
The first starts moving towards an actual testing agent.
Probably neither.
At least not in isolation.
RAG without tool access can produce informed test plans but cannot necessarily execute them.
MCP without strong application context can give an AI powerful tools, but the agent may still make poor testing decisions.
The more interesting architecture combines:
RAG
Knowledge
+
LLM
Reasoning
+
MCP
Tool Access
+
Playwright
Execution
Each layer has a different responsibility.
That separation matters because AI testing systems become unreliable when one component is expected to do everything.
The future of AI testing may not be about finding an LLM that writes better automation code.
We already have models capable of generating useful test scripts.
The more interesting problem is building systems that can:
Understand the product, decide what matters, use testing tools, observe what happens, and react to the result.
That is where RAG and MCP fit together.
They are not competing approaches.
They are two pieces of a much larger AI testing architecture.
And that distinction may become increasingly important as QA moves from AI-generated tests towards AI-executed testing workflows.
What do you think?
Will most AI testing platforms eventually combine RAG and MCP, or will another architecture become the standard?