AI Context: MCP, RAG, & Tools Explained
0:000:00
Understanding AI Context: MCP, RAG, Tools & Context Explained
Component Definitions
| Component | What It Is | Key Features | Example | 
|---|---|---|---|
| Context | All information used by the LLM during generation | β’ Chat, user input, RAG, tool results β’ Bounded by token limit β’ Temporary session memory  | "My name is Raj" remembered during session | 
| MCP | Model Context Protocol β open-source protocol for LLM β system interaction | β’ JSON-RPC 2.0 spec β’ 1,000+ MCP servers by early 2025 β’ Standardizes tool execution, resource access  | Claude or GPT calls company CRM via MCP server | 
| RAG | Retrieval-Augmented Generation β combines semantic search with LLM output | β’ Embeds user query β’ Searches vector DB β’ Injects relevant docs into context  | LLM retrieves legal cases β summarizes | 
| Tools | External APIs or code the LLM can run | β’ Accessed via MCP or native tool APIs (like OpenAI's function calling) β’ Enables live queries, code, search  | getWeather("Hyderabad") fetches live data | 
System Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β                       CONTEXT WINDOW                        β
β  ββββββββββββββ  βββββββββββββββ  ββββββββββββββββ          β
β  β User Input β  β Retrieved   β  β Tool Results β          β
β  β & History  β  β Documents   β  β (Live Data)  β          β
β  ββββββββββββββ  βββββββββββββββ  ββββββββββββββββ          β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
                              β²
                              β Context feeds the model
                              βΌ
                    βββββββββββββββββββββββ
                    β        LLM          β
                    β (Claude / GPT /     β
                    β  Gemini / Mistral)  β
                    βββββββββββββββββββββββ
                              β
              βββββββββββββββββΌββββββββββββββββ
              βΌ               βΌ               βΌ
       βββββββββββββββ βββββββββββββββ βββββββββββββββ
       β     MCP     β β     RAG     β β Native APIs β
       β (Protocol)  β β (Retrieval) β β / Services  β
       ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ
              βΌ               βΌ               βΌ
     βββββββββββββββ  ββββββββββββββββ ββββββββββββββββ
     β MCP Servers β  β Vector DBs   β β External APIsβ
     β β’ Tools     β  β β’ Pinecone   β β β’ Weather    β
     β β’ Resources β  β β’ Chroma     β β β’ Search     β
     β β’ Prompts   β  β β’ FAISS      β β β’ Code Exec  β
     βββββββββββββββ  ββββββββββββββββ ββββββββββββββββ
Component Relationships
| Component | Feeds Into | Purpose | 
|---|---|---|
| Context | LLM | Holds all runtime inputs | 
| MCP | Context via tool results | Standardized tool & data access | 
| RAG | Context via retrieved docs | Domain-specific semantic enrichment | 
| Tools | Context via live results | Real-time functionality (e.g., code, APIs) | 
Current Industry Adoption
| Provider | Status | 
|---|---|
| Anthropic | Creator & lead maintainer of MCP | 
| OpenAI | Native function calling API; MCP support via community | 
| Function calling capabilities in Gemini API | |
| Microsoft | MCP integrated into Azure OpenAI Studio and Foundry (Preview) | 
Key Note: While MCP is gaining adoption, each provider also maintains their own tool calling mechanisms (like OpenAI's function calling API) alongside MCP support.