MCP
Part 5 of 5MCP standardizes communication between an application and external capabilities. Function calling lets a model request a named operation; the application still executes it. RAG retrieves evidence for an answer. These responsibilities can work together in one system.
This is part 5 of the MCP series. In part 3, we built an inventory server and verified its capabilities without a model. Part 4 explained how a host uses an MCP client to discover capabilities and route requests. Now we place that connection in a complete application: what does MCP handle, and what still belongs to retrieval and model tool calling?
Suppose you are building an employee assistant. It must explain a reimbursement policy, check a claim's current status, and submit a new claim. These sound like one feature: answer questions and help employees. Underneath, they require different operations.
RAG finds evidence for an answer. Function calling lets a model request an operation. MCP standardizes how an application connects to external capabilities. You can combine all three, but you do not need all three for every task.
The distinction matters when a demo becomes an application. Choosing MCP does not decide how documents are searched. Choosing RAG does not give the assistant permission to submit expenses.
What is the difference between MCP and RAG?
Retrieval-augmented generation (RAG) is a pattern: retrieve relevant information, include it in a model request, and generate an answer using that evidence. The retrieval could use keyword search, vector search, a combination of both, or a database query. A vector database is one implementation option, not the definition of RAG. Microsoft's RAG overview describes the separation between retrieval and answer generation.
Model Context Protocol (MCP) is an interface protocol. An AI application can connect to an MCP server, discover what it exposes, and request data or operations. The server might wrap a search engine, a database, a ticketing API, or a local calculation. The MCP architecture specification assigns orchestration to the host application and external capabilities to servers.
| Question | RAG | MCP | Function calling |
|---|---|---|---|
| What does it describe? | Retrieval followed by generation | Communication between an application and a server | A model requesting a named operation with arguments |
| Typical input | A question and searchable information | Protocol requests to a server | Tool definitions and conversation context |
| Typical output | Retrieved evidence used in an answer | Tool results, resources, or prompt templates | A tool name and structured arguments |
| Does it require a vector database? | No | No | No |
| Does it perform writes by itself? | No; writes need application code | A server can expose write tools | The application executes the requested operation |
| Does it guarantee correct answers? | No | No | No |
This table compares responsibilities, rather than ranking one approach above another. Their usefulness depends on the operation the assistant needs to perform.
The inventory lookup from part 3 makes the distinction concrete: get_stock performs a dictionary lookup, and MCP carries the request and result. That example has neither document retrieval nor a model. Replacing the dictionary with a search index would add retrieval; connecting a model would add decisions about when to request the tool.
What does function calling do?
In a tool-enabled application, the model receives definitions for available operations. It can produce a request such as this illustrative object:
{ "name": "get_claim_status", "arguments": { "claim_id": "EXP-1042" } }
The exact envelope varies by model API. Your application receives the request, validates it, checks the user's access, runs the implementation, and returns the result to the model. The model can then explain the result.
Function calling does not require MCP. A single application can dispatch requests directly to ordinary functions or REST APIs. If multiple AI applications need the same capabilities, an MCP server can provide a shared interface. That adds a service boundary and compatibility requirements, so it is a design choice rather than an automatic upgrade.
For the protocol side, MCP defines tool discovery and invocation using methods such as tools/list and tools/call. A host can adapt those tool definitions to its model API.
Can MCP replace RAG?
No: adding an MCP connection does not remove the need to find relevant information. It can change where retrieval happens and how the application accesses it.
Consider an MCP tool named search_reimbursement_policy. Its implementation searches an index and returns relevant passages. The assistant uses those passages to answer a question. That remains a retrieval-augmented workflow; MCP carries the tool request and result.
You still need to decide:
- Which documents are indexed and which policy version applies.
- How a question becomes a search query.
- How results are ranked and filtered for the user's access.
- How edits, withdrawals, and deleted documents propagate.
- What the assistant says when it finds insufficient evidence.
If a complete policy fits comfortably in the model's context, you may provide the document directly instead of building a retrieval system. MCP is optional in that design too. Start with the actual information problem, not a required list of technologies.
A concrete RAG use case: reimbursement policy questions
The question “Can I expense a taxi after a late shift?” needs a policy passage, not a transaction.
An illustrative workflow is:
Employee question → identify applicable company, country, and policy date → retrieve passages the employee may access → pass passages and source references to the model → answer with citations, or explain that evidence is missing
A useful retrieval result might contain this fictional policy excerpt:
{ "document_id": "transport-policy-example", "section": "Late shifts", "effective_from": "2026-01-01", "text": "Taxi reimbursement after a late shift requires manager approval.", "source_url": "https://policies.example.com/transport#late-shifts" }
The example is invented to show the data contract, not to give reimbursement advice. The assistant should explain the approval condition and cite the passage. It should not invent a reimbursement amount or infer that approval has already been granted.
This is why the policy chatbot is a stronger RAG example than “schedule a meeting” or “book travel.” Scheduling and booking need operations against external systems. Retrieval may help explain the rules, but it cannot perform the booking.
When should you use MCP instead of RAG?
A more useful question is: does this request need document evidence, current state, or an action?
| User request | Needed operation | Possible implementation |
|---|---|---|
| “What expenses are allowed?” | Find applicable policy passages | Retrieval, optionally behind an MCP search tool |
| “Has my claim been paid?” | Read authoritative transaction state | A scoped API lookup, optionally exposed through MCP |
| “Submit this claim.” | Write a transaction | A validated tool with authorization and confirmation |
| “Why was my claim rejected?” | Combine the claim record with policy evidence | Live lookup plus retrieval |
For a claim status, embedding yesterday's transactions into a search index introduces avoidable freshness and identity problems. An authenticated lookup by claim ID is usually a better starting point. For policy interpretation, a status API cannot supply the missing document evidence.
Use MCP when a standard interface across compatible hosts and servers is useful. Use direct function calling when a small application can maintain its own tool bindings comfortably. Either path needs explicit access checks.
How MCP, RAG, and function calling work together
Here is a proposed design for the combined request “Explain the rejection and help me resubmit”:
- The application establishes the employee's identity outside the model.
- A claim lookup returns a record only if the employee can access it.
- A search tool retrieves the policy that applied to that claim.
- The model explains the rejection using the record and cited policy passages.
- The application presents a proposed correction for review.
- A submission tool validates and writes the approved change.
The lookup, search, and submission can all be MCP tools. Only the search-and-answer portion needs retrieval augmentation. The model's requests can use its provider's function calling interface.
The submission handler should independently check allowed fields, ownership, and duplicate submissions. A convincing model explanation is not proof that the write is authorized.
What these approaches do not guarantee
MCP is not a permission engine. The protocol includes authorization-related specifications, but connecting a server does not establish row-level access to your data. The server and downstream APIs must enforce that access.
RAG is not inherently stale or permissionless. A retrieval system can filter results by identity and update its index frequently. It can also fail at both. These are implementation properties, not reasons to label all RAG systems insecure.
A tool is not necessarily a write. Search, calculations, and read-only API lookups can be tools. An MCP resource provides readable data through a URI; that does not mean its underlying contents can never change. See the resource specification.
Retrieved text and tool output are not trusted instructions. Treat document text as evidence. A passage telling the assistant to ignore rules must not acquire authority merely because it came from search.
How I would choose for a first implementation
For a policy assistant, I would start with retrieval and a small set of representative questions. Check that answers cite applicable passages, acknowledge ambiguity, and withhold claims unsupported by the sources. Add live lookups when users need account-specific state. Add write operations only when the product actually needs them.
I would introduce MCP when sharing those capabilities across applications justifies maintaining a protocol endpoint. For one application with a few stable functions, direct integration may be simpler.
This completes the five-part foundation: introduction, core concepts, server implementation, client responsibilities, and this architectural comparison.
Apply the series in the companion guides on giving an LLM real-time information and finding a remote MCP endpoint.
Quick Recap
What is the difference between MCP and RAG?
RAG retrieves information and supplies it to a model to ground an answer. MCP standardizes how an application discovers and accesses external tools, resources, and prompts. A retrieval system can be exposed through MCP.
Can MCP replace RAG?
MCP does not replace retrieval. An MCP tool may call a search service that performs retrieval, but the search index, ranking, permissions, and document updates still need an implementation.
When should you use MCP instead of RAG?
For a live lookup or action, such as checking a claim status or creating a ticket, use an API or tool, optionally exposed through MCP. For finding relevant passages in a document collection, use retrieval. Applications often need both.
Which use case is suitable for RAG?
A chatbot answering questions from reimbursement policies is a suitable RAG use case because its answers need evidence from documents. Booking travel or submitting a claim additionally requires executable tools and authorization.
Comments
Share your thoughts and questions below