Model Context Protocol (MCP)

What is MCP
The Model Context Protocol (MCP) is open source standard design universal connector between AI application and external data source, tools to perform function
You can think MCP as USB-C port for AI, Just as a physical USB-C cable standardizes connections across monitors, cameras, and external drives without requiring custom proprietary plugs, MCP introduces a unified software protocol to connect LLMs to any external data source or toolset seamlessly.
Which problem it solves
Before MCP, connecting data-source, tools to AI application has two main issue
Fragmentation: Previously, developers were trapped in a cycle of writing bespoke, fragmented integration code for every single unique tool combination.
The "N-to-N" Problem: This architectural fragmentation scales poorly: if you are managing 10 distinct LLMs and 10 separate tooling systems, you face an exponential N-to-N integration bottleneck requiring up to 100 individual pipelines.
MCP Architecture
Components of mcp
MCP host : An AI application responsible for orchestrating, lifecycle-managing, and coordinating multiple
McpClientinstances.MCP Clients : It make the connection to MCP server and obtain context for MCP host to use
MCP Server : It provides a context to MCP clients
I highly recommend to checking out our foundational guide on how to build MCP Servers and MCP Clients from scratch using TypeScript and Groq
Layers of mcp
1. Data layer
It defines communication protocol based on JSON-RPC between MCP Client and Server
2. Transport layer
It defines Transport mechanism between MCP Client and Server.
It support two Transport mechanism:
Stdio transport
stdio:Uses standard input/output streams for direct process communication between local processes on the same machine, providing optimal performance with no network overhead.
Streamable HTTP transport
HTTP:Uses HTTP POST for client-to-server messages with optional Server-Sent Events for streaming capabilities. This transport enables remote server communication and supports standard HTTP authentication methods including bearer tokens, API keys, and custom headers. MCP recommends using OAuth to obtain authentication tokens.
Reference
Official Model Context Protocol - Document




