Skip to content
MCP vs RAG: 100-Query Benchmark Reveals the Costly Winner

MCP vs RAG: 100-Query Benchmark Reveals the Costly Winner

MCP vs RAG: MCP-based retrieval beats a vector-indexed RAG on grounding and citation depth, but it's slower and more expensive. Use it for correctness-critical requests; keep RAG for high-volume, latency-sensitive ones.

9 min read

Abstract

MCP vs RAG is the architectural question behind this post: should an AI documentation agent retrieve context from a static vector index, or query documentation and API metadata through tool calls at request time?

We benchmarked both approaches head-to-head – a Model Context Protocol (MCP) server [2] against an AWS Bedrock vector Knowledge Base (RAG) [3] – across 100 matched developer queries spanning component how-tos, exact API/type lookups, theming, feature-freshness checks, and code generation, using the same Claude model as the orchestrating LLM in both arms. MCP produced the higher-confidence answer in 52% of head-to-head comparisons versus 38% for RAG (10% ties), with its largest wins concentrated in exact API interface lookups (+50 to +67 confidence points), at a cost of 2.5x higher latency and roughly 36x higher per-query spend.

Architects deciding between these two retrieval strategies for an internal documentation agent will find, below, the specific query categories where each wins, why the cost gap exists, and a decision matrix for making the call. This post summarizes the full research report for MCP vs RAG [1]; the complete methodology, raw benchmark tables, and query-by-query data there.



Introduction

Ignite UI ships four framework variants – Angular, React, Blazor, Web Components – each with an independent API surface, and its documentation changes on every minor release. The AI Agent Gateway behind Ignite UI’s support and docs chat originally answered from a Bedrock Knowledge Base: a vector index built from periodic documentation snapshots. That architecture has one structural weakness – hallucinations caused by index staleness. A property shipped in a patch release doesn’t exist in the vector store until the next re-index job runs, and the model has no signal that the gap exists. It just answers confidently from what it has.

The alternative tested here replaces the vector index with an MCP server from the Ignite UI CLI MCP exposing four tools – search_docs, get_doc, search_api, get_api_reference – that query documentation and generated API reference at request time. Claude drives this as an agentic loop: decide which tool to call, read the result, repeat until there’s enough grounding to answer.

Most MCP vs RAG comparisons in the wild are qualitative – “it feels more accurate.” This post is built from a fixed 100-query set, an LLM-judge scoring rubric, and per-query cost and latency telemetry pulled from both pipelines’ production logs, documented in full in the underlying research report [1].


Methodology

The MCP vs RAG comparison below is built on a fixed, repeatable test harness. Full detail – exact versions, scoring weights, and excluded scope – is in the research report [1]; the short version:

  • Systems under test: AWS Bedrock Knowledge Base (single-turn vector retrieval) vs. an MCP server (multi-turn tool-use loop, capped at 20 turns) – same Claude model family driving both
  • Query set: 100 queries across component how-to, API/type lookups, theming/SCSS, recent-feature freshness, and code generation.
  • Scoring: a composite 0–100 confidence score per answer, weighted across Retrieval Relevance, Answer Clarity, and Answer Grounding, judged by the same LLM rubric on both arms.
  • Head-to-head: the higher-scoring answer wins unless the gap is ≤1 point (tie), evaluated on 96 of the 100 queries with valid scores on both sides.
  • Explicitly out of scope: concurrent-session throughput (this ran single-session, sequential) and a direct measurement of how stale the RAG snapshot was at test time.

Benchmarks

The MCP vs RAG numbers below are all figures from the 100-query run, single sequential session, no concurrent load [1].

MetricBedrock RAGIgnite UI CLI MCPDelta
Avg total latency12,715 ms31,932 ms+151%
Avg time to first token 6,314 ms29,372 ms+365%
Avg cost per query$0.0047$0.1691+3500%
Avg confidence (composite)70.373.9+3.6 pts
Avg citations per answer2.24.5+2.3
Head-to-head win rate38%52%10% ties
Limitation: this measures single-session, cold-cache latency and cost. It does not measure how prompt-caching economics shift under sustained concurrent multi-user load, which would likely lower MCP’s effective per-query cost in production.

Findings

The MCP vs RAG gap is not uniform across query types – it concentrates in specific categories.

1. MCP wins big on exact API surface lookups, not general how-to questions.** Asking for the full property list of a TypeScript interface or event-args class is where RAG most often fails outright – two of the largest MCP wins in the dataset were interface-definition questions where RAG’s answer amounted to “I don’t have the complete information,” while MCP retrieved the complete member list with types and optionality markers [1].

2. Tool-call turn count predicts MCP’s latency almost linearly. Queries resolved in 2–4 turns finished in 7–11 seconds, on par with RAG. Queries needing 18–20 exploratory turns took 45–75 seconds – one loading-overlay how-to burned 21 tool calls and 75 seconds because the agent kept re-searching instead of recognizing it already had enough to answer [1].

3. MCP’s grounding advantage is structural, not just topical relevance. Of the three scored sub-components, Answer Grounding – whether claims are actually backed by retrieved content – showed the largest gap in MCP’s favor. Structured API type data is harder to hallucinate against than free-text prose that has to be paraphrased [1].

4. RAG wins on stable, well-documented styling and theming content. The largest RAG wins in the dataset were all styling questions, where dense embedding search matched a thin documentation page more directly than MCP’s keyword-oriented search – proof that MCP retrieval isn’t automatically better when the underlying docs are hard to search rather than stale [1].

5. The “recently added feature” category didn’t show a decisive MCP advantage at this sample size. Individual queries favored MCP, others favored RAG – directionally consistent with the staleness hypothesis but not statistically conclusive with only 15 queries in that category [1].

Taken together, these five findings are why the MCP vs RAG decision can’t be settled with a single aggregate score.


Decision Matrix: MCP vs RAG by Scenario

Use this table to resolve the MCP vs RAG question for your own workload by matching it to the closest scenario row.

ScenarioBedrock RAGIgnite UI CLI MCP
High query volume, cost-sensitive (support chat)✅ ~36x cheaper, sub-15s typical latency❌ $0.17/query and 30s+ average is uneconomical at scale
Exact API/type reference lookups (IDE assistant, SDK bot)⚠️ Fails or hedges when the interface isn’t in the snapshot✅ Retrieves complete type definitions
Latency-sensitive, streaming chat UI✅ TTFT ~5–6s median❌ TTFT ~29s median unless intermediate tool status streams to the client
Stable, well-documented styling/theming questions✅ Dense embedding search matches thin doc pages well⚠️ Keyword search can miss under-indexed pages
*Guidance: if your workload mixes both patterns, route by query intent – API/type lookups to MCP, general how-to and styling to RAG – rather than picking one architecture for everything [1].*

Code Examples

Whatever side of the MCP vs RAG decision you land on, two implementation details are worth encoding directly if you deploy MCP: bound the tool-call loop, and don’t let a zero-result tool call produce a confident answer.

Bounding the multi-turn loop

Finding 2 showed unconstrained queries hitting 18–20 turns. An explicit budget with an early-exit instruction caps the p95 tail without hurting queries that resolve quickly.

async function runMcpQuery(question: string, maxTurns = 10) {
  let turns = 0;
  let messages = [{ role: "user", content: question }];

  while (turns < maxTurns) {
    const response = await claude.messages.create({
      model: MODEL,
      tools,
      messages,
      system:
        "If you have already retrieved content sufficient to answer " +
        "with grounded confidence, answer now instead of issuing another tool call.",
    });

    if (response.stop_reason !== "tool_use") return response;

    messages.push({ role: "assistant", content: response.content });
    const toolResults = await Promise.all(
      response.content.filter((b) => b.type === "tool_use").map(executeTool)
    );
    messages.push({ role: "user", content: toolResults });
    turns++;
  }

  throw new Error(`MCP query exceeded ${maxTurns} turns without resolving`);
}

Refusing to answer on zero-grounding

Finding 4’s styling losses share a root cause: tools return no useful match, and the model answers anyway. Detecting that and forcing an explicit “insufficient grounding” response closes the gap. a small guardrail that matters regardless of which side of the MCP vs RAG split your production traffic falls on.

function checkGrounding(toolResults: ToolResult[]): boolean {
  const hasContent = toolResults.some((r) => r.matches?.length > 0);
  if (!hasContent) {
    throw new InsufficientGroundingError(
      "No documentation or API matches found; escalate or return explicit no-answer."
    );
  }
  return hasContent;
}

Conclusion: MCP vs RAG, the Verdict

Use MCP when the workload is dominated by exact API/type reference questions, documentation changes faster than a re-index cycle can track, and query volume is low enough that $0.17/query and ~32s average latency are acceptable – an internal SDK reference assistant or IDE copilot fits this profile.

Use RAG when query volume is high, latency has to stay under a few seconds, and the underlying content is stable prose (styling guides, conceptual how-tos) that a vector index already retrieves well.

Default to a hybrid if your traffic mixes both intents – the two systems’ advantages sit in nearly opposite query categories rather than one dominating uniformly, which makes intent-based routing more useful than an either/or architectural choice on the MCP vs RAG question. The MCP approach can be also utilized for a “deeper thinking” mode – for additional questions in an existing session where the initial RAG based answer wasn’t able to resolve the user’s question.

The open question this post doesn’t answer: whether MCP’s cost and latency profile improves under sustained concurrent load with cache reuse across similar questions. That requires a concurrent-load test the current dataset can’t answer – see the full report [1] for the complete list of exclusions.

If you’re running your own MCP vs RAG evaluation, the query-category breakdown above is the fastest way to predict which architecture your workload favors before you spend a single dollar on infrastructure.


References

## References

[1] “MCP vs RAG: AI Documentation Retrieval Benchmark,” research report, https://ko.infragistics.com/blogs/mcp-vs-rag-benchmark, Ignite UI, July 2026.

[2] Model Context Protocol specification, Anthropic, https://modelcontextprotocol.io

[3] AWS Bedrock Knowledge Bases documentation, Amazon Web Services, https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html

Request a Demo