{"slug": "rag-vs-mcp-which-one-should-your-agent-use", "title": "RAG vs. MCP: Which One Should Your Agent Use", "summary": "OpenRouter tested vector RAG, hybrid RAG and an MCP-tool agent on the same 40-question product-catalog benchmark on October 22, 2026, using OpenAI GPT-6 Luna and DeepSeek V4.1 Flash, and concluded that RAG and MCP are complementary rather than competing: RAG decides which text enters a prompt while MCP gives the model tools to fetch data itself. The 3,000-product catalog (about 340K tokens) and 80-product catalog (about 9K tokens) were queried with 16 single-fact lookups, 12 two-hop lookups and 12 whole-catalog counts or extremes, with plain vector RAG taking the top 30 chunks and hybrid RAG taking 15 vector plus 15 BM25 matches before reranking with mongodb/rerank-3-lite. OpenRouter also reported that a tool-design bug broke one of the models, and said its @openrouter/agent SDK and @openrouter/mcp package (remote Streamable HTTP with SSE fallback, no local stdio servers) run the tool loop.", "body_md": "# RAG vs MCP: Which One Should Your Agent Use?\n\nOpenRouter ·\n\nWhen you connect an agent to company data, the RAG vs MCP choice comes down to who does the fetching. With [retrieval-augmented generation (RAG)](https://openrouter.ai/docs/cookbook/evaluate-and-optimize/rag), your application pulls matching text from an index once, before the model sees the question. With the [Model Context Protocol](https://modelcontextprotocol.io) (MCP), the model calls tools during its turn and asks for exactly the records it needs, as many times as it needs.\n\nTo see how that difference plays out, we gave vector RAG, hybrid RAG, and an agent with two MCP tools the same product catalog and the same 40 questions, and ran each setup on two models. This article covers how each approach works, what the test showed, and the tool-design bug that broke one of the models, so you can decide when to use RAG, MCP tools, or both.\n\n## What is the difference between RAG and MCP?\n\nRAG is a pattern for putting retrieved text into a prompt before you call the model. MCP is a protocol for describing tools so the model can fetch data itself.\n\nIn a RAG pipeline, you split documents into chunks and embed them into an index ahead of time with an [embeddings API](https://openrouter.ai/docs/api/api-reference/embeddings/submit-an-embedding-request). For each question, you retrieve the most similar chunks, narrow them down with a [rerank model](https://openrouter.ai/docs/api/api-reference/rerank/submit-a-rerank-request), and send what’s left to the LLM. Retrieval happens once. If the chunks miss a detail, the model has no way to ask for more.\n\nWith MCP, a server advertises tools, each with a name, a description, and a JSON schema for its arguments. The model picks a tool and fills in the arguments, the client runs the call against a database, API, or search index, and the result goes back to the model. The model can then call another tool or answer. It gets the data at the moment it asks for it.\n\nRAG and MCP don’t compete. RAG decides which text goes into a prompt, and MCP gives the model tools to call. An MCP server can even wrap a RAG index as a search tool.\n\nOur Agent SDK (@openrouter/agent) runs the tool loop for you. The @openrouter/mcp package connects to [remote MCP servers](https://openrouter.ai/docs/agent-sdk/call-model/mcp-tools) over Streamable HTTP, falling back to Server-Sent Events (SSE), and its createMCPTools helper passes their tools to callModel. Local stdio servers aren’t supported.\n\n## How we tested RAG vs MCP\n\nWe ran all three setups through our API on October 22, 2026, against a generated catalog for a fictional outdoor brand. The catalog comes in two sizes: 3,000 products (about 340K tokens) and 80 products (about 9K tokens). Each product has one short page with its name, SKU, category, price, weight, warranty, and first year sold. Some pages also have a “Compatible with” line naming other products.\n\nWe wrote 40 questions with exact answers for the 3,000-product catalog (37 for the smaller one), in three types:\n\n- 16 single-fact lookups, such as “What is the warranty on product CX-10101?” and “How many grams does the Tundra Ridge Tent weigh?”\n- 12 two-hop lookups, such as “What is the list price of the backpack that the Willow Cedar Trekking Pole lists first under Compatible with?”\n- 12 whole-catalog counts or extremes, such as “How many tents have a warranty of exactly 2 years?” and “What is the SKU of the lightest sleeping bag?”\n\nEvery test ran on two answer models with reasoning.effort: “low”: [OpenAI GPT-6 Luna](https://openrouter.ai/openai/gpt-6-luna) (openai/gpt-6-luna) and [DeepSeek V4.1 Flash](https://openrouter.ai/deepseek/deepseek-v4.1-flash) (deepseek/deepseek-v4.1-flash).\n\nFor RAG, we embedded the pages with mongodb/voyage-4-lite. Plain vector RAG took the top 30 chunks by vector similarity. Hybrid RAG took the top 15 vector matches plus the top 15 BM25 keyword matches. Both then used mongodb/rerank-3-lite to cut their candidates down to 5 chunks for the model.\n\nFor MCP, we wrote a small server over the same catalog, served over Streamable HTTP, with two tools:\n\n- get_product(sku_or_name) returns one product’s full record, including the names and SKUs of compatible products.\n- find_products(category?, warranty_years?, first_sold_year?, name_contains?, sort_by?, limit) filters and sorts the catalog. It returns the total number of matches and up to limit rows (max 50).\n\nThe agent called the Agent SDK’s callModel with those tools, the same answer rule as RAG, and a [stop condition](https://openrouter.ai/docs/agent-sdk/call-model/stop-conditions) of stopWhen: stepCountIs(8). Token and cost figures come from getUsage() across every model call in the loop. RAG totals include the embedding and rerank calls.\n\n## Which approach answered more questions?\n\nOn the 3,000-product catalog, the agent with two MCP tools, which we built for these three question types, answered all 40 questions on both models. Vector RAG answered 8 or 9, and hybrid RAG answered 16.\n\n| Approach | GPT-6 Luna correct | DeepSeek V4.1 Flash correct | Cost per 1,000 questions (Luna / DeepSeek) | Input tokens per question (Luna / DeepSeek) | Time per question (Luna / DeepSeek) | \n|---|---|---|---|---|---|\n| RAG | 8/40 | 9/40 | $0.21 / $1.43 | 633 / 683 | 7.8 s / 12.2 s | \n| Hybrid RAG | 16/40 | 16/40 | $0.19 / $0.91 | 638 / 688 | 5.6 s / 9.9 s | \n| MCP tools | 40/40 | 40/40 | $0.18 / $0.39 | 1,479 / 2,178 | 4.1 s / 3.8 s | \n\nSplitting the scores by question type shows where RAG fell short (GPT-6 Luna / DeepSeek V4.1 Flash):\n\n| Question type | RAG | Hybrid RAG | MCP tools | \n|---|---|---|---|\n| Single fact (16) | 8 / 9 | 16 / 16 | 16 / 16 | \n| Two-hop (12) | 0 / 0 | 0 / 0 | 12 / 12 | \n| Whole-catalog (12) | 0 / 0 | 0 / 0 | 12 / 12 | \n\nThe smaller catalog told the same story. MCP tools scored 37/37 on both models, at $0.11 per 1,000 questions on GPT-6 Luna and $0.29 on DeepSeek V4.1 Flash, while vector RAG scored 26/37 and 27/37.\n\nThe agent sent two to three times as many input tokens as RAG. It averaged 2.3 to 2.4 model calls per question, and each call resends the conversation and the tool definitions. Even so, it cost about the same as hybrid RAG on GPT-6 Luna and less on DeepSeek V4.1 Flash, because every RAG question also pays for an embedding call and a rerank call. RAG cost far more on DeepSeek V4.1 Flash than on GPT-6 Luna with similar input tokens. That gap likely comes from output and reasoning tokens, which the table doesn’t show.\n\nThe agent was also faster on both models. The RAG timings include the embedding and rerank calls, which may account for part of the gap.\n\n## Why RAG missed SKU lookups, two-hop questions, and counts\n\nRAG retrieves five chunks once, before the model runs. Our three question types each ran into a different limit of that design.\n\nEight of the 16 single-fact questions named a product by SKU, such as CX-10101. A SKU is a string with no meaning for an embedding model to match on. For those questions, the right product page ranked anywhere from 276th to 2,718th of 3,000 by vector similarity, so it never made the top 30 sent to the reranker. GPT-6 Luna missed all 8, and DeepSeek V4.1 Flash missed 7. Adding BM25 keyword search fixed this, and hybrid RAG scored 16/16 on single facts with both models. Our [Reranking in RAG](https://openrouter.ai/blog/tutorials/reranking-rag/) article measures the same hybrid search and rerank fix.\n\nNeither RAG setup answered any two-hop or whole-catalog question. Take the trekking pole question. Retrieval runs once, on the question text, so it can find the trekking pole’s page but not the backpack’s, which only becomes relevant after you’ve read the first page. Counts fail for a simpler reason. There are 375 tents in the catalog, and five retrieved chunks can’t tell you how many of them carry a 2-year warranty.\n\nThe MCP agent worked through the same questions one step at a time. For the trekking pole question, it called find_products to locate the pole by name, then get_product to read its record and get the compatible backpack’s SKU, then get_product again to read the backpack’s price. For the tent count, it made a single find_products call with category and warranty_years and read total_matches from the response.\n\nThat 40/40 depends on the tools fitting the questions. Our catalog is structured, and a question that get_product and find_products can’t express would still fail.\n\n## What broke our MCP server on one model\n\nThe 40/40 didn’t come on the first run. With the first version of our server, GPT-6 Luna scored 0 of 12 on whole-catalog questions (27 of 39 completed questions; one two-hop request hit a socket error), while DeepSeek V4.1 Flash had no trouble.\n\nThe trace showed why. Our original find_products described every filter as optional, and its JSON schema marked none as required. GPT-6 Luna filled them all in anyway, sending 0 or an empty string whenever it meant “no filter”. Here’s its call for “How many tents have a warranty of exactly 2 years?”:\n\nfind_products({“category”:“tent”,“warranty_years”:2,“first_sold_year”:0,“name_contains”:\"\",“sort_by”:“weight_asc”,“limit”:50}) -> {“total_matches”:0,“rows”:[]}\n\nThe server treated first_sold_year: 0 and name_contains: \"\" as real filters and found no matches. GPT-6 Luna read total_matches and answered 0. The true answer is 79.\n\nDeepSeek V4.1 Flash never sent a 0 or empty filter in any of its 117 test questions (40 against each server version, plus 37 on the small catalog), and it scored 40/40 against both versions of the server. The tools and schema were identical, so the difference came down to how each model fills in optional arguments.\n\nWe fixed it on the server. It now treats 0, empty strings, and negative numbers as “no filter”, and the tool description says so:\n\nleave out any filter you do not need (0 or an empty string also means no filter)\n\nWith that change, GPT-6 Luna went from 0/12 to 12/12 on whole-catalog questions and 40/40 overall.\n\nTool descriptions and schemas work like prompts, and models read them differently. Test your MCP tools with every model you plan to run, check the arguments each one sends in your logs, and make your server forgiving of default values. We only caught this bug because we ran the same tool set on two models through one OpenRouter API key.\n\n## When to use RAG, MCP, or both\n\nUse MCP tools when your data is structured or sits behind an API, such as a database or a product catalog. Tools also fit when questions need exact lookups, counts, or filters, or when the data changes and has to be read live.\n\nUse RAG for unstructured text where the question is about meaning, such as policies, documentation, or support articles. Make it hybrid so exact identifiers like SKUs still get found.\n\nUse both when questions over unstructured text need more than one lookup. Expose your RAG index as an MCP search tool, and the model can search, read the chunks, and search again.\n\nWhichever you choose, measure it on your own questions with exact answers, on each model you plan to run.\n\n## Next steps\n\nTo expose your own data as tools, start with the [Agent SDK MCP tools documentation](https://openrouter.ai/docs/agent-sdk/call-model/mcp-tools), which covers connecting remote Streamable HTTP and SSE servers, and the [stop conditions](https://openrouter.ai/docs/agent-sdk/call-model/stop-conditions) page for settings like stepCountIs. If your data is unstructured text, see the API reference for [embeddings](https://openrouter.ai/docs/api/api-reference/embeddings/submit-an-embedding-request) and [rerank](https://openrouter.ai/docs/api/api-reference/rerank/submit-a-rerank-request), and follow our [RAG with Embeddings & Rerank cookbook](https://openrouter.ai/docs/cookbook/evaluate-and-optimize/rag) for the full code. Our [RAG vs CAG comparison](https://openrouter.ai/blog/insights/rag-vs-cag/) runs on the same catalog. You can also connect the [OpenRouter MCP server](https://openrouter.ai/docs/guides/overview/mcp-server) to your editor or coding assistant while you build.\n\n## Frequently asked questions\n\n### Is RAG obsolete with MCP?\n\nNo. RAG retrieves unstructured text, while MCP is a protocol for giving a model tools, so they solve different problems. Documentation, policy manuals, and other large bodies of prose still need embeddings, keyword search, and reranking. You can wrap that index in an MCP tool so the model searches it on demand.\n\n### Is MCP better than RAG?\n\nMCP tools beat single-pass RAG when questions need exact lookups, counts, or filters over structured data. In our test on a 3,000-product catalog, an agent with two MCP tools built for the test’s question types answered 40 of 40 questions for $0.18 to $0.39 per 1,000 questions. Hybrid RAG answered 16 of 40 for $0.19 to $0.91. When one semantic search over unstructured text finds the right paragraph, hybrid RAG works well on its own.\n\n### Do RAG pipelines use MCP?\n\nNot by default. A standard RAG pipeline runs retrieval in your application code before it calls the model. You can, however, expose a RAG retriever as a tool on an MCP server, which turns retrieval from one up-front step into a search tool the model can call as often as it needs.", "url": "https://wpnews.pro/news/rag-vs-mcp-which-one-should-your-agent-use", "canonical_source": "https://openrouter.ai/blog/insights/rag-vs-mcp/", "published_at": "2026-12-06 01:14:26+00:00", "updated_at": "2026-12-06 01:46:09.407660+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "large-language-models"], "entities": ["OpenRouter", "Model Context Protocol", "OpenAI GPT-6 Luna", "DeepSeek V4.1 Flash", "mongodb/voyage-4-lite", "mongodb/rerank-3-lite", "@openrouter/agent", "@openrouter/mcp"], "also_reported_by": [], "takeaway": "RAG and MCP are complementary — RAG fixes which chunks reach the prompt while MCP lets the model call tools for the records it needs — and OpenRouter's 40-question catalog benchmark on GPT-6 Luna and DeepSeek V4.1 Flash compared top-30 vector RAG against 15-vector-plus-15-BM25 hybrid RAG reranked to", "recommendation": {"advice": "When agents need exact catalog records, pair a reranked hybrid index (15 vector + 15 BM25 candidates) with MCP search tools so the model can re-query instead of relying on a single top-30 retrieval pass.", "playbook": "rag-retrieval", "playbook_url": "https://wpnews.pro/playbooks/rag-retrieval"}, "alternates": {"html": "https://wpnews.pro/news/rag-vs-mcp-which-one-should-your-agent-use", "markdown": "https://wpnews.pro/news/rag-vs-mcp-which-one-should-your-agent-use.md", "text": "https://wpnews.pro/news/rag-vs-mcp-which-one-should-your-agent-use.txt", "jsonld": "https://wpnews.pro/news/rag-vs-mcp-which-one-should-your-agent-use.jsonld"}}