May 8, 2025
LLMs are no longer just text predictors — they're turning into reasoning engines. But while model performance improves, our ability to manage their context has lagged behind. As we build richer GenAI systems — personalized shopping assistants, agentic workflows, retrieval-augmented copilots — we're increasingly duct-taping memory, tools, user state, and business logic into brittle prompt strings. It works, until it doesn't.
Model Context Protocol (MCP) is a response to this architectural gap. It offers a way to define, structure, and operationalize context so that models reason more intelligently — and systems scale more reliably. This isn't just about prompt templates. It's about a design philosophy that treats context as data, not prose.
In this article, we'll break down:
Let's get into it.
Model Context Protocol (MCP) is a proposed standard way to define, share, and manage the context that LLMs use during inference. It's meant to solve a growing problem: As we build complex GenAI systems — think multi-agent workflows, RAG pipelines, or tools interacting with LLMs — we need a reliable and interpretable way to pass "context" into models.
LLMs don't work in isolation anymore. Modern AI products involve:
Each component needs clear, structured context to work well. But today, most developers just… shove it all into a prompt. MCP aims to bring order and clarity.
In MCP, context is any information that guides the model's behaviour, such as:
It defines a structured format (usually JSON or similar) to organize these components. Think of it as a schema or protocol — like how HTTP structures web communication, MCP structures LLM interaction.
Here's a simplified example:
{ "system_instruction": "You are a helpful personal shopping assistant.", "user_goal": "Find waterproof sneakers under €150 in a minimalist style.", "retrieved_documents": [...], "tools": ["price_tracker", "style_matcher"], "chat_history": [...], "memory": { "name": "Pranav", "shoe_size": "EU 43", "style": ["Minimalist", "Neutral colors"] } }
Then, an MCP interpreter or router translates this context into a full prompt the LLM understands.
It's being explored and developed by folks in the open-source AI infra community — particularly people behind projects like LangChain, LlamaIndex, and agent frameworks like AutoGen or CrewAI. It's not yet a universal standard, but momentum is growing.
Let's walk through an end-to-end Model Context Protocol (MCP)-style flow in a GenAI-powered e-commerce assistant. Think of it as a personal shopping concierge that can:
As with everything, examples best illustrate the concepts I've mentioned before. So let's drill down with an e-commerce scenario.
User goal: "Find me stylish, waterproof sneakers under €150 for city use. I prefer neutral colors and minimalist design."
Let's break this into an MCP-style flow with structured context, tools, memory, and model behavior.
{ "system_instruction": "You are a stylish personal shopping assistant. Always recommend relevant, high-quality, fashion-forward products.", "user_goal": "Find stylish, waterproof sneakers under €150 for city use in neutral colors and minimalist design.", "user_profile": { "name": "Pranav", "style": ["minimalist", "neutral", "luxury-but-practical"], "shoe_size": "EU 43", "past_purchases": ["Common Projects", "On Cloudnova", "Nike Air Max 1"], "preferred_price_range": "100-200 EUR" }, "retrieved_documents": [ { "source": "ProductCatalog", "query": "waterproof sneakers neutral minimalist under 150", "results": [ { "name": "Vessi Cityscape", "price": "€135", "color": "Slate Grey", "features": ["Waterproof", "Lightweight", "Minimalist"], "image_url": "...", "product_link": "..." }, { "name": "Allbirds Mizzle", "price": "€145", "color": "Natural White", "features": ["Water-resistant", "Wool blend", "Sustainable"], "image_url": "...", "product_link": "..." } ] } ], "tools": [ { "name": "PriceTracker", "description": "Checks if the product is on sale", "args": ["product_link"] }, { "name": "StyleComparer", "description": "Compares visual style similarity to past purchases", "args": ["image_url", "past_purchases"] } ], "chat_history": [ { "role": "user", "content": "I'm looking for shoes I can wear in Amsterdam — rainproof but still stylish." }, { "role": "assistant", "content": "Got it! I'll prioritize waterproof features with a clean aesthetic. Any preferred brands?" } ], "memory": { "long_term": { "Pranav_shoe_style": "modern minimalist, neutral colors", "purchase_behavior": "Willing to pay premium for quality" } } }
The interpreter compiles all this into a prompt like:
System:
You are a fashion-savvy personal shopping assistant helping Pranav find stylish waterproof sneakers.
User Goal:
Pranav is looking for waterproof, minimalist sneakers in neutral colors under €150.
User Profile:
Pranav wears EU 43, prefers neutral colors, and has previously bought Common Projects and On Cloudnova. He likes quality over hype.
Retrieved Products:
Use Tools:
PriceTracker, StyleComparer
Based on the above, suggest the best options. Justify your picks with reasoning and style compatibility.
Model suggests using tools:
Example outputs from tools:
"Based on your style and past purchases, I'd recommend the Vessi Cityscape (€135). It's highly waterproof, clean in design, and very close to your previous aesthetic.
The Allbirds Mizzle is another solid choice — a bit more casual and sustainable, and currently 10% off. Want me to check sizing availability or delivery times?"
Long-term memory can be updated with:
So MCP can be quite useful to log, keep track of, and manage large LLM systems. But who's building what? Who has input in what part of the system? Let's break down the ownership of each part of the flow: who defines what in an MCP-driven GenAI system, especially in an e-commerce context like your shopping assistant.
We'll break this into the main phases, then for each component, map out who is responsible:
MCP itself doesn't define the values — it defines the structure and interfaces to handle these cleanly.
The MCP interpreter compiles the structured context into a prompt format that the LLM can understand.
The model suggests using tools based on the context provided, and the tools return their outputs.
The LLM generates a response based on all the context and tool outputs.
MCP is especially useful for teams building complex LLM-powered systems — whether you're working on:
MCP brings clarity, structure, and scalability to LLM interactions by separating out and formalizing all the "hidden" context behind model behavior — such as goals, memory, tools, history, and retrieved documents. Instead of shoving everything into one monolithic prompt, MCP turns context into a modular, inspectable object. That means:
You should reach for MCP when:
Model Context Protocol is still in its early days, but it's quickly becoming essential infrastructure for building scalable, modular, and intelligent GenAI systems.