MCP Core Concepts Explained| JSON-RPC, Prompts, Sampling, stdio vs SSE | Sunday 2–5 | Sir Ali jawad
In this *Sunday 2–5 session (Class 22)**, we explored the **core concepts of the Model Context Protocol (MCP)* and how communication happens between an MCP Client and MCP Server. *Anthropic* introduced MCP to standardize how AI models interact with tools, data, and external systems. One of the most important parts of MCP is how messages are exchanged between the client and server. --- 🔹 Topics Covered in This Class 1️⃣ JSON-RPC — The Language of MCP JSON-RPC is the communication protocol used between the MCP client and server. Every action like listing tools, calling a tool, or reading resources happens through JSON-RPC messages. We covered the main message types: *Request* → Client asks the server to perform an action *Response* → Server sends the result back *Error* → Sent when something goes wrong *Notification* → Informational message that doesn’t require a response We also discussed common JSON-RPC error codes such as: *Parse Error (-32700)* *Invalid Request (-32600)* *Method Not Found (-32601)* *Invalid Params (-32602)* *Internal Error (-32603)* 📚 JSON-RPC specification: [https://www.jsonrpc.org/specification](https://www.jsonrpc.org/specification) --- 2️⃣ MCP Prompts MCP Prompts are *ready-made prompt templates* that servers provide to clients. Instead of creating prompts every time, users can simply request them from the server and use them directly. Example idea: Server = teacher who prepares exam questions Client = student who requests the exam paper This makes expert knowledge reusable across many users. --- 3️⃣ MCP Sampling Sampling allows the **server to request the client to query an LLM**. Normal flow: Client → Server → Result Sampling flow: Server → Client → LLM → Server This design exists for two main reasons: *Security* – the API key stays with the client *Billing control* – the client pays for the LLM usage The server never gets direct access to the API key. --- 4️⃣ MCP Transports (How Messages Travel) MCP supports two main transport methods: #### 🔹 stdio (Standard Input / Output) Direct communication through input/output streams No network required Best for local development and testing One client per server process #### 🔹 SSE (Server-Sent Events) Communication over HTTP using a server URL Server runs independently Multiple clients can connect at the same time Suitable for web apps and production environments Even though the **transport changes**, the message format (JSON-RPC) stays the same. --- 🔑 Key Takeaway *JSON-RPC* → Message format used by MCP *Prompts* → Reusable expert prompt templates *Sampling* → Secure way for servers to use LLMs through the client *Transports (stdio / SSE)* → How the messages travel Together, these concepts form the foundation for building **AI agents and MCP-powered applications**. --- 📚 Official MCP Documentation: [https://docs.anthropic.com/en/docs/mcp](https://docs.anthropic.com/en/docs/mcp)

Model Context Protocol (MCP) Explained for Beginners: AI Flight Booking Demo!

RAG & MCP Fundamentals – A Hands-On Crash Course

How to Design APIs Like a Senior Engineer (REST, GraphQL, Auth, Security)

January 25, 2026

Giaic Quarter 4 Sunday (2-5): Docker Basics - Docker Desktop - Docker File - Docker Image

MCP vs API: Why traditional APIs are failing AI agents

MCP vs REST APIs – Complete Guide with FastMCP Demo |Sunday 2-5|Sir Ali jawad

RL for Agents Workshop - Deep Dive on Training Agents with RL and Open Source

The (Overdue) Collapse of Bullsh*t Companies

Learn Kubernetes in Minutes | Why Kubernetes + Core Concepts Explained |Sunday 2-5|Sir Aali jawad

Full Archon Guide - Build AI Coding Harnesses That Actually Ship (LIVE)

The Linux Kernel is Falling Apart.

The Dirty AI lie : How the GREATEST bet in human history started to crack in June 2026?

Keynote: After the AI Hype – What’s Real, and What’s Next - Richard Campbell - 2026

Giaic Quarter 4 Sunday (2-5): Docker Compose - Orchestrate Multi-Container ,2 tier & micro-service

20 AI Concepts Explained in 40 Minutes

Jfrog | Jfrog Artifactory | Jfrog Artifactory Tutorial | Artifactory Tutorial | Intellipaat

System Design Explained: APIs, Databases, Caching, CDNs, Load Balancing & Production Infra

7 Authentication Concepts Every Developer Should Know

