Understanding AI Context: MCP, RAG, Tools & Context Explained


0:00
0:00

Understanding AI Context: MCP, RAG, Tools & Context Explained

Component Definitions

ComponentWhat It IsKey FeaturesExample
ContextAll 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
MCPModel 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
RAGRetrieval-Augmented Generation β€” combines semantic search with LLM outputβ€’ Embeds user query
β€’ Searches vector DB
β€’ Injects relevant docs into context
LLM retrieves legal cases β†’ summarizes
ToolsExternal 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

ComponentFeeds IntoPurpose
ContextLLMHolds all runtime inputs
MCPContext via tool resultsStandardized tool & data access
RAGContext via retrieved docsDomain-specific semantic enrichment
ToolsContext via live resultsReal-time functionality (e.g., code, APIs)

Current Industry Adoption

ProviderStatus
AnthropicCreator & lead maintainer of MCP
OpenAINative function calling API; MCP support via community
GoogleFunction calling capabilities in Gemini API
MicrosoftMCP 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.


Last updated on July 18, 2025

πŸ” Explore More Topics

Discover related content that might interest you

TwoAnswers Logo

Providing innovative solutions and exceptional experiences. Building the future.

Β© 2025 TwoAnswers.com. All rights reserved.

Made with by the TwoAnswers.com team