Skip to content

AI 201 · Module 4

MCP vs API vs RAG

Three ways AI gets what it needs, and how to choose the right one

Start Section 1
0 / 5 completed
Sync my progressJoin a session to keep progress across devices and share it with your instructor

Info

After you join, your completed lesson numbers are sent to your instructor together with your learner code, so they can see your progress. Use the codes your instructor gave you, and do not enter your name, company secrets or other personal data. Progress is kept with the rest of that session's data.

Learning objectives

  • Describe the flow of an API call, an MCP tool call and a RAG retrieval, step by step
  • Explain why MCP is not an "API replacement" and how the two relate
  • Choose between RAG/Search, MCP Tool, API-backed Tool, Prompt and Authenticated Tool for a given scenario
  • Justify when a human confirmation step is required

Three Patterns

10 min

Three Answers to One Question

An AI application often needs something it does not already have: today's course list, the exact wording of a regulation, a colleague's research area. API, MCP and RAG are three different answers to "how does the AI get it?". They solve different problems and often work together.

  • API: how a system exposes a capability to developers and programs
  • MCP: a standardized interface that lets AI applications discover, understand and use tools
  • RAG: retrieve relevant content first, then let the model answer with that content as context

Warning

MCP is not an "API replacement". An API defines how a system provides a capability. MCP provides a standardized interface for AI applications to discover, understand and use tools. A single MCP tool is very often backed by an API.

Key takeaway: API, MCP and RAG answer different questions, and MCP sits on top of APIs rather than replacing them.

14 min

API and MCP: Two Flows Compared

API: developer-oriented flow
  1. Developer reads the API documentation
  2. Developer picks an endpoint
  3. Developer writes code that sends the arguments
  4. System returns a response
  5. Developer's code handles the response
MCP: AI/tool-oriented discovery flow
  1. AI client connects and discovers the available tools
  2. AI client reads each tool's description and schema
  3. AI client invokes a capability with schema-valid arguments
  4. Tool returns a structured result
  5. The human verifies the result before relying on it

The key difference is who does the discovering. With an API, a developer reads documentation ahead of time and writes the integration by hand. With MCP, the AI client can ask the server what it offers and how to call it, because the description and schema are part of the interface.

Info

Illustrative example: an MCP tool find_research_experts may call an ordinary internal API behind the scenes. The API defines the capability; MCP presents it in a form an AI application can discover and use.
Check yourself

Which statement about MCP and APIs is most accurate?

Which statement about MCP and APIs is most accurate?

Key takeaway: APIs are read by developers in advance; MCP lets an AI client discover tools and their schemas at run time.

12 min

RAG: Retrieve, Then Answer

RAG: knowledge retrieval flow
  1. A question arrives
  2. The system retrieves the most relevant content from a document collection
  3. The retrieved content is placed in the model's context
  4. The model generates a response grounded in that content

RAG is a good fit when

  • The answer lives in text: regulations, handbooks, FAQs
  • You want the reply to quote or summarize known documents
  • The content changes slowly

RAG is a poor fit when

  • You need live, structured values such as today's seat count
  • The task is an action, such as submitting or updating something
  • The retrieved passages are outdated and nobody checks their date

Info

RAG and MCP are not rivals either. A search tool exposed through MCP can perform the retrieval step of a RAG flow.
Check yourself

A learner asks what the exact wording of a university regulation says. Which pattern fits best?

A learner asks what the exact wording of a university regulation says. Which pattern fits best?

Key takeaway: RAG suits questions whose answer is in documents; it retrieves first and answers second.

Choosing a Pattern

12 min

Which Pattern for Which Job

Scenario matrix (recommended pattern)
ScenarioRecommended pattern
Look up regulation textRAG/Search
Look up live course dataMCP Tool / API-backed Tool
Find a researcher by expertiseMCP Tool
Draft an articlePrompt
Perform a privileged system operationAuthenticated Tool + Human confirmation
  • Text that already exists in documents: retrieve it (RAG/Search)
  • Live or structured data from a trusted system: call a tool
  • Creative or generative work that needs no external data: a good prompt is enough
  • Anything that changes something: authentication and a human confirmation step

Warning

Do not reach for a tool when a prompt is enough, and do not rely on a prompt when the task needs trusted, current data.
Check yourself

Which task should always include an explicit human confirmation step?

Which task should always include an explicit human confirmation step?

Key takeaway: Match the pattern to the job: retrieve text, call a tool for live data, prompt for drafting, and confirm any change.

Scenario Exercise

12 min

Scenario Exercise

Decide for each scenario which pattern fits best, then say why. Try it yourself before reading the suggested answers.

  • A student asks what a regulation says about late assignment submission
  • A student asks which sections of a course still have seats this week
  • A staff member wants to find colleagues who work on AI and education
  • A teacher wants a first draft of a newsletter article
  • A staff member asks the AI to change another user's access level
Suggested answers

Regulation: RAG/Search. Seats this week: MCP Tool or API-backed Tool (live data). Colleagues by expertise: MCP Tool. Newsletter draft: Prompt. Access level change: Authenticated Tool with Human confirmation, because it modifies permissions.

Info

Chain of responsibility: a human defines the intent, AI selects a capability, the tool retrieves trusted data, and a human verifies the result.
Check yourself

A student asks which course sections still have seats this week. What is the best approach?

A student asks which course sections still have seats this week. What is the best approach?

Key takeaway: Ask two questions: where does the answer live, and does the task change anything?

What next?