Spec के हिसाब से MCP: Server असल में क्या होता है
JSON की एक लाइन subprocess में भेजें और 13 tool definitions वापस पाएं—2026-07-28 revision के संदर्भ में, जिसने handshake हटाया।
इस पेज पर
एक प्रकाशित MCP server install करें, उसे JSON की एक लाइन भेजें, और जो वापस आए उसे पढ़ें।
npm i @modelcontextprotocol/server-everything@2026.8.31
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \
| npx @modelcontextprotocol/server-everything stdio{"result":{"tools":[{"name":"echo","title":"Echo Tool","description":"Echoes
back the input string","inputSchema":{"$schema":"http://json-schema.org/draft-07/
schema#","type":"object","properties":{"message":{"type":"string","description":
"Message to echo"}},"required":["message"]},"annotations":{"readOnlyHint":true,
… … 7,663 bytes on one line …
"jsonrpc":"2.0","id":1}तेरह tool definitions, एक ही लाइन में, उस process से जिसने अपने standard input से एक लाइन पढ़ी। अब आपने Model Context Protocol बोल लिया है—बिना SDK, बिना client library और बिना framework। पूरी बात यही है: एक transport, एक message format, और named methods का छोटा-सा set।
Chapter 18 ने tool को दो चीज़ों के रूप में define किया था — एक JSON Schema जिसे model देखता है, और आपके code में एक endpoint जिसे model कभी नहीं देखता। Chapter 23 ने एक harness बनाया जो उनका catalogue रखता है। किसी ने भी उस सवाल का जवाब नहीं दिया जो तय करता है कि इसमें से कुछ भी reusable है या नहीं: schema कौन लिखता है, और वह जिसने भी लिखा है उससे आपके prompt तक कैसे पहुँचता है? MCP उस सवाल का एक जवाब है, और इसे मूल रूप में पढ़ना ज़रूरी है, क्योंकि इसके बारे में लिखी लगभग हर चीज़ एक ऐसी revision का वर्णन करती है जो अब मौजूद नहीं है।
आपने अभी जो command चलाई, उसमें तीन चीज़ें गलत हैं, और हर एक इस chapter का एक section है। उसमें protocol version नहीं था, इसलिए conformant server उसे refuse करता। फिर भी जवाब मिला, उस वजह से जिसे specification feature नहीं बल्कि hazard कहती है। और उसने तीन primitives में से एक के लिए पूछा, बिना कभी यह discover किए कि बाकी दो भी मौजूद हैं।
यह किस problem को solve करता है, और spec खुद कौन-सी analogy देती है
सेक्शन का लिंक: यह किस problem को solve करता है, और spec खुद कौन-सी analogy देती हैWire से पहले arithmetic। आपके पास AI applications हैं और चीज़ें हैं जिन तक उन्हें पहुँचने में सक्षम होना चाहिए — calendar, ticket tracker, warehouse database, design tool। Shared contract के बिना, कोई integrations लिखता है, और हर एक schema plus endpoint plus authentication story plus maintenance burden होता है। Shared contract के साथ, tool vendor server लिखता है, application vendor client लिखता है, और कुल हो जाता है।
यह कोई नई observation नहीं है, और specification बताती है कि idea किसका था:
MCP takes some inspiration from the Language Server Protocol, which standardizes how to add support for programming languages across a whole ecosystem of development tools. In a similar way, MCP standardizes how to integrate additional context and tools into the ecosystem of AI applications.1
इस comparison को तारीफ़ की तरह नहीं, literal तरह से लें। उस protocol से पहले, किसी editor में language support का मतलब था हर editor के लिए अलग plugin; बाद में, language team ने एक server ship किया और हर editor को support मिल गया। सफलता का माप elegance नहीं था, बल्कि यह था कि integration count multiply होना बंद हो गया। यहाँ भी वही बात है: value implementations की संख्या में है, design में नहीं। जिस protocol को दो products ही बोलते हैं, वह extra ceremony वाला data format है।
Wire पर असल में क्या होता है
सेक्शन का लिंक: Wire पर असल में क्या होता हैMCP messages JSON-RPC 2.0 हैं। Request एक object है जिसमें jsonrpc, एक id, एक method और optional params होते हैं; response वही id और या तो result या error रखता है; notification एक request है जिसमें id नहीं होता और कोई reply नहीं मिलता। Specification ऊपर से तीन constraints जोड़ती है: id string या number होना चाहिए और null नहीं होना चाहिए, वह किसी ऐसी दूसरी request से collide नहीं होना चाहिए जो अभी in flight है, और हर result में resultType field होना चाहिए।2
stdio transport पर — वही जो ऊपर वाली command ने use किया — framing rule है: हर message के लिए एक line:
Messages are delimited by newlines, and MUST NOT contain embedded newlines. […] The server MUST NOT write anything to its
stdoutthat is not a valid MCP message.3
यह आख़िरी clause homemade server के टूटने का सबसे common तरीका है, और वह silently टूटता है: कोई stray console.log, progress bar, dependency की deprecation warning, और client का line parser ऐसी चीज़ पर पहुँच जाता है जो JSON नहीं है। Escape hatch उसी section में है — server stderr पर जो चाहे लिख सकता है, और client को उसे error नहीं मानना चाहिए। ऊपर वाला reference server हर launch पर Starting default (STDIO) server... print करता है, stderr पर, इसलिए pipe फिर भी काम कर गया।
दूसरा standard transport Streamable HTTP है: हर message एक single endpoint पर POST होता है, और reply या तो JSON object होता है या request-scoped Server-Sent Events stream — वही wire format जिसे Chapter 14 ने हाथ से parse किया था। Semantics दोनों पर identical हैं, क्योंकि transport एक binding है: वह framing और delivery define करता है, meaning नहीं।4
पहली गलत चीज़: version नहीं था
सेक्शन का लिंक: पहली गलत चीज़: version नहीं थाऊपर वाली command ने tools/list भेजा और कुछ नहीं। Current revision के तहत वह request malformed है, और conformant server को उसे reject करना चाहिए।
2026-07-28 से MCP stateless protocol है, और specification इसे बिना लाग-लपेट कहती है:
The Model Context Protocol (MCP) is a stateless protocol: all the information needed to process a request is contained in the request itself. A server processes each request independently; no state should be inferred from previous requests, even those on the same connection or stream.2
इसलिए हर request अपना protocol version और अपनी client capabilities साथ लेकर चलती है, params के अंदर reserved _meta object में। उन fields में से दो हर single request पर required हैं; किसी भी एक के missing होने पर request malformed है और server को -32602 answer करना चाहिए:2
_meta key | required | यह क्या है |
|---|---|---|
io.modelcontextprotocol/protocolVersion | yes | यह request जिस revision को बोलती है, जैसे "2026-07-28" |
io.modelcontextprotocol/clientCapabilities | yes | इस request पर client server के लिए क्या कर सकता है |
io.modelcontextprotocol/clientInfo | no (but should) | client name और version, केवल display और logs के लिए |
io.modelcontextprotocol/logLevel | no | minimum log level जो server को इस request के लिए emit करना चाहिए |
पूरी तरह लिखा हुआ, सही tools/list यह है — और यह आख़िरी बार है जब यह chapter metadata को पूरा दिखाता है, क्योंकि यहाँ से यह हर request पर है:
{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{"_meta":{
"io.modelcontextprotocol/protocolVersion":"2026-07-28",
"io.modelcontextprotocol/clientCapabilities":{"elicitation":{"form":{}}},
"io.modelcontextprotocol/clientInfo":{"name":"bare-hands","version":"0.0.1"}}}}Capability object ही negotiation है। अब कोई separate negotiation step नहीं है: client हर request पर declare करता है कि वह क्या कर सकता है, server result में declare करता है कि वह क्या कर सकता है, और कोई भी side ऐसी feature use नहीं कर सकती जिसे दूसरे ने claim न किया हो। अगर server को ऐसी capability चाहिए जो client ने declare नहीं की, तो उसे -32021 answer करना चाहिए और missing capability को data.requiredCapabilities में name करना चाहिए। अगर server requested version नहीं बोलता, तो उसे -32022 answer करना चाहिए और जो versions वह बोलता है उन्हें list करना चाहिए।2
जो clients जवाब पहले से चाहते हैं, वे पूछ सकते हैं: server/discover एक mandatory RPC है जो एक round trip में supported versions, capabilities, identity और instructions का optional block return करता है।5 इसे call करना optional है। Implement करना optional नहीं है।
दूसरी गलत चीज़: server legacy था
सेक्शन का लिंक: दूसरी गलत चीज़: server legacy थाCommand काम कर गई। Current revision के तहत ऐसा नहीं होना चाहिए था, और ऐसा क्यों हुआ यह paragraph से ज़्यादा measurement के लायक है, क्योंकि यह पूरी ecosystem की state को एक line में दिखाता है।
Reference server को वैसे probe करें जैसे specification modern client को probe करने के लिए कहती है:
echo '{"jsonrpc":"2.0","id":1,"method":"server/discover","params":{"_meta":{
"io.modelcontextprotocol/protocolVersion":"2026-07-28",
"io.modelcontextprotocol/clientCapabilities":{}}}}' \
| npx @modelcontextprotocol/server-everything stdio{"jsonrpc":"2.0","id":1,"error":{"code":-32601,"message":"Method not found"}}यह compatibility rule की तीसरी branch है: DiscoverResult का मतलब modern, recognised modern error का मतलब modern-but-wrong-version, और anything else — including -32601 — का मतलब legacy, initialize handshake पर fall back करें।3 तो current revision माँगते हुए वही करें:
→ {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2026-07-28",
"capabilities":{},"clientInfo":{"name":"bare-hands","version":"0.0.1"}}}
← {"result":{"protocolVersion":"2025-11-25","capabilities":{"tools":{"listChanged":true},
"prompts":{"listChanged":true},"resources":{"subscribe":true,"listChanged":true},
"logging":{},"tasks":{…},"completions":{}},"serverInfo":{"name":"mcp-servers/everything",
"title":"Everything Reference Server","version":"2.0.0"},"instructions":"…"}}Client ने 2026-07-28 माँगा और server ने 2025-11-25 answer किया। 7 September 2026 को official reference server — npm package @modelcontextprotocol/server-everything, version 2026.8.31, published 31 August 2026 — current revision implement नहीं करता। Dates के हिसाब से, जिस TypeScript SDK पर यह बना है वह भी नहीं: release 1.30.0 27 July 2026 को गया, revision से एक दिन पहले।
Consequence पढ़ें, gossip नहीं। MCP के बारे में लिखी लगभग हर चीज़ ऐसे protocol का वर्णन करती है जिसमें initialize handshake, session, roots/list request जो server client को भेजता है, और HTTP+SSE transport है। ये चारों gone या going हैं। जब भी आप MCP के बारे में कुछ पढ़ें, इस page सहित, सबसे पहले revision number खोजें।
और जो very first command काम कर गई, उसका कारण specification में feature नहीं hazard के रूप में लिखा है:
some legacy servers do not validate that a request arrives after
initializeand would process an era-ambiguous method (such astools/call) under legacy semantics. Probing yields a deterministic failure instead.3
Measured: उस server को बिना किसी handshake के tools/list भेजना full catalogue return करता है। जिस method को refuse होना चाहिए था, उसे serve किया गया, और यही वजह है कि specification कहती है कि पहले server/discover से probe करें, तब भी जब आप केवल modern versions support करते हों।
तीन roles, और पूरे document से quote करने लायक sentence
सेक्शन का लिंक: तीन roles, और पूरे document से quote करने लायक sentenceMCP में तीन parties हैं, और पहले दो के बीच का distinction वही है जिसे लोग collapse कर देते हैं:
Host. Application: chat product, editor, agent। यह conversation, model, credentials और user consent का owner है। यह clients बनाता है और उनके बीच security boundary enforce करता है।
Client. Host के अंदर connector। हर client exactly one server से बात करता है — strict 1:1 relationship — और हर request जिसे वह route करता है उसमें protocol version और capabilities attach करता है।
Server. एक process या service जो resources, tools और prompts expose करती है। यह local या remote हो सकती है, independently operate करती है, और इसका पूरा काम एक focused area होता है।6
वह “exactly one server” rule bookkeeping नहीं है। यही नीचे वाला design principle implementable बनाता है, और specification से अगर सिर्फ़ एक sentence लेना हो तो यही लें:
Servers should not be able to read the whole conversation, nor “see into” other servers. Servers receive only necessary contextual information. Full conversation history stays with the host. Each server maintains isolation. Cross-server interactions are controlled by the host.6
यह उस mental model को उलट देता है जिसके साथ ज़्यादातर लोग आते हैं। जिस weather server को आप अपने assistant से connect करते हैं, वह यह नहीं देखता कि आपने क्या पूछा। वह model द्वारा चुने गए arguments के साथ एक tools/call देखता है, और कुछ नहीं — न previous turns, न आपका system prompt, न calendar server के results जो एक पल पहले लौटे। अगर दो servers को cooperate करना है, तो host जानबूझकर एक value को एक से दूसरे तक ले जाता है, क्योंकि model ने ऐसा कहा। इसीलिए isolation वह security property है जिस पर Chapter 30 टिकता है: compromised server का blast radius छोटा और defined होता है, और उसे बड़ा करने के लिए host को cooperate करना पड़ता है।
तीसरी चीज़: तीन primitives, इस आधार पर sorted कि control किसके पास है
सेक्शन का लिंक: तीसरी चीज़: तीन primitives, इस आधार पर sorted कि control किसके पास हैपहली command ने उस server से tools माँगे और तेरह मिले। उससे बाकी दो सवाल पूछें तो वह उनका भी जवाब देता है: resources/list सात return करता है, prompts/list चार return करता है। उनमें से कोई दिखाई नहीं दिया, क्योंकि किसी ने पूछा ही नहीं। यही हमें MCP की pedagogical spine तक लाता है, जो specification में एक ऐसी table के रूप में बैठी है जिसे लगभग कोई quote नहीं करता:
| Primitive | Control | Description | Example |
|---|---|---|---|
| Prompts | User-controlled | User choice से invoked interactive templates | Slash commands, menu options |
| Resources | Application-controlled | Client द्वारा attached और managed contextual data | File contents, git history |
| Tools | Model-controlled | Actions लेने के लिए LLM को exposed functions | API POST requests, file writing |
यह “capability expose करने के तीन तरीके” नहीं हैं। ये कौन decide करता है कि यह होगा के तीन जवाब हैं। Model decide करता है कि tool call करना है। Application decide करती है कि resource attach करना है। व्यक्ति decide करता है कि prompt run करना है। इसे गलत समझें और feature फिर भी काम करेगी, लेकिन गलत moment पर और गलत reason से।
इसे feel करने का सबसे साफ़ तरीका calendar है। यहाँ एक server है जो उसी calendar को तीन बार expose करता है, हर primitive के रूप में एक बार, plain Node की सौ lines में और बिना dependencies:
const TOOL = {
name: "create_event",
description: "Create a calendar event. Writes to the calendar.",
inputSchema: {
type: "object",
properties: {
title: { type: "string", description: "Event title." },
startsAt: { type: "string", format: "date-time", description: "Start, ISO 8601 UTC." },
},
required: ["title"],
},
};
switch (method) {
case "resources/read":
return ok(id, { contents: [{ uri: "calendar://week",
mimeType: "application/json", text: JSON.stringify(EVENTS) }],
ttlMs: 60000, cacheScope: "private" });
case "prompts/get":
return ok(id, { description: PROMPT.description, messages: [{ role: "user",
content: { type: "text", text: `Read calendar://week and draft a plan. ` +
`Focus: ${params.arguments?.focus ?? "balance"}.` } }] });
case "tools/list":
return ok(id, { tools: [TOOL], ttlMs: 300000, cacheScope: "public" });
}इसे run करें और तीनों तरीकों से पूछें। Real output, wire पर one message per line, page के लिए यहाँ wrapped, request _meta और server का identity block elided:
→ resources/read {"uri":"calendar://week"}
← {"resultType":"complete","contents":[{"uri":"calendar://week",
"mimeType":"application/json","text":"[{\"id\":\"e1\",\"title\":\"Standup\",
\"startsAt\":\"2026-09-07T09:00:00Z\"},{\"id\":\"e2\",\"title\":\"Design review\",
\"startsAt\":\"2026-09-09T15:00:00Z\"}]"}],"ttlMs":60000,"cacheScope":"private"}
→ prompts/get {"name":"prepare_week","arguments":{"focus":"deep work"}}
← {"resultType":"complete","description":"Read the week and draft a plan.",
"messages":[{"role":"user","content":{"type":"text",
"text":"Read calendar://week and draft a plan. Focus: deep work."}}]}
→ tools/call {"name":"create_event","arguments":{"title":"Dentist",
"startsAt":"2026-09-10T08:30:00Z"}}
← {"resultType":"complete","content":[{"type":"text",
"text":"Created e3: Dentist at 2026-09-10T08:30:00Z"}],
"structuredContent":{"id":"e3","title":"Dentist","startsAt":"2026-09-10T08:30:00Z"},
"isError":false}तीन methods, तीन shapes, एक calendar। अब point:
Week पढ़ना resource है
सेक्शन का लिंक: Week पढ़ना resource हैइसे URI से address किया जाता है, यह inert है, और application decide करती है कि इसे conversation से attach करना है या नहीं। Protocol में ऐसा कुछ नहीं है जो model को इसे अपने आप लेने दे। Result ttlMs और cacheScope carry करता है, जो इस revision में नए हैं, ताकि client polling के बजाय week को एक minute के लिए cache कर सके।
Event बनाना tool है
सेक्शन का लिंक: Event बनाना tool हैइसमें schema है, side effects हैं, और model decide करता है कि इसे कब call करना है। इसका result isError carry करता है, वही field जिसके लिए Chapter 18 ने argument दिया था: validation failure protocol error के रूप में नहीं, बल्कि ऐसे tool result के रूप में वापस आता है जिसे model पढ़कर correct कर सकता है।
“Prepare my week” prompt है
सेक्शन का लिंक: “Prepare my week” prompt हैयह named, argument-taking template है जिसे व्यक्ति invoke करता है — menu में slash command। यह messages return करता है, answer नहीं। यह server author के लिए वह phrasing ship करने का तरीका है जो उनके अपने tools के साथ काम करती है, यानी ठीक वही knowledge जो server author के पास है और user के पास नहीं।
लगभग हर कोई इन तीनों को tools बना देता है। Result एक ऐसा catalogue होता है जहाँ application द्वारा silently attach की जाने वाली read, model के attention के लिए ऐसी write से compete करती है जिसे approval चाहिए, और जहाँ वह एक चीज़ जिसके लिए व्यक्ति button चाहता था, schema में buried होती है। इसे सही करने की कोई cost नहीं है, और यह आपके एक line लिखने से पहले decide हो जाता है।
Server आपको call नहीं कर सकता
सेक्शन का लिंक: Server आपको call नहीं कर सकताCalendar tool में एक required argument है, title, और optional startsAt। उसे बिना date के event create करने को कहें, और एक दिलचस्प चीज़ वापस आती है:
→ tools/call {"name":"create_event","arguments":{"title":"Dentist"}}
← {"resultType":"input_required",
"inputRequests":{"when":{"method":"elicitation/create","params":{"mode":"form",
"message":"When should \"Dentist\" start?",
"requestedSchema":{"type":"object",
"properties":{"startsAt":{"type":"string","format":"date-time"}},
"required":["startsAt"]}}}},
"requestState":"eyJ0aXRsZSI6IkRlbnRpc3QifQ=="}Server ने request नहीं भेजी। उसने जो request मिली थी उसका answer दिया, resultType: "input_required" और इस description के साथ कि उसे अभी क्या चाहिए। Client person से answer collect करता है, और फिर original call दोबारा भेजता है — नए id के साथ, inputResponses carry करते हुए और opaque requestState echo करते हुए:
→ tools/call {"name":"create_event","arguments":{"title":"Dentist"},
"inputResponses":{"when":{"action":"accept",
"content":{"startsAt":"2026-09-10T08:30:00Z"}}},
"requestState":"eyJ0aXRsZSI6IkRlbnRpc3QifQ=="}
← {"resultType":"complete","content":[{"type":"text",
"text":"Created e3: Dentist at 2026-09-10T08:30:00Z"}],"isError":false}यह Multi Round-Trip Requests है, current revision में introduced, और इसने पुराने design को replace किया जिसमें servers clients को JSON-RPC requests वापस भेजते थे। Transport specification अब rule flatly कहती है: “servers do not initiate JSON-RPC requests and clients do not send JSON-RPC responses”.4 Initiative की एक direction है, और वह host की है।
दो client-side features इसी mechanism पर ride करती हैं, और उनमें से एक का नाम आपको confuse करेगा।
Elicitation server द्वारा person से कुछ माँगना है: deliberately restricted JSON Schema वाला form — flat objects, primitive properties, no nesting — ताकि कोई भी client उसे बिना layout engine render कर सके। इसमें hard rule है: servers form mode का use “passwords, API keys, access tokens, or payment credentials” माँगने के लिए नहीं कर सकते, और उनके लिए URL mode use करना चाहिए, जो user को उस page पर भेजता है जिसे client कभी नहीं पढ़ता।7
Sampling server द्वारा host के model से generation माँगना है, ताकि server API key रखे बिना intelligent हो सके। और यहाँ vocabulary warning है, क्योंकि यह word इस course में पहले से कुछ और meaning रखता है: यह Chapter 17 वाला sampling नहीं है। यहाँ temperature, top-p या probability distribution की shape के बारे में कुछ नहीं है। यह protocol के through backwards travel करने वाली nested model call है।
इसे reach न करने की दूसरी वजह है: इस revision तक, sampling deprecated है, roots और logging के साथ, SEP-2577 के तहत, और migration suggestion blunt है — “integrate directly with LLM provider APIs instead of Sampling”.8 Idea technically fail नहीं हुआ; वह अपने surface area को justify नहीं कर पाया, और जो protocol चीज़ें remove कर सकता है वह उस protocol से healthy है जो नहीं कर सकता।
जानबूझकर तोड़ें: connections sessions नहीं हैं
सेक्शन का लिंक: जानबूझकर तोड़ें: connections sessions नहीं हैंStatelessness wire-format detail जैसी लगती है जब तक आप इसे test नहीं करते। ऊपर वाला three-message exchange लें और हर message को separate process में run करें — fresh node calendar.mjs, no shared memory, कुछ भी carry over नहीं:
process A tools/call (no date) → resultType: input_required
requestState: eyJ0aXRsZSI6IkRlbnRpc3QifQ==
process B tools/call (with the answer, same requestState)
→ resultType: complete
"Created e3: Dentist at 2026-09-10T08:30:00Z"
process C resources/read calendar://week
→ events: 2 (Standup, Design review)Process B, जिसने question कभी देखा ही नहीं, ने process A द्वारा शुरू की गई multi-round-trip call complete कर दी। requestState का point यही है: continuation message में travel करता है, इसलिए कुछ भी process के वही होने पर depend नहीं करता।
Process C failure है। Event created हुआ और वहाँ नहीं है — क्योंकि toy server EVENTS को module-level array में रखता है, और module-level array connection state है। Specification का note mistake को precise नाम देता है:
an open connection, such as a STDIO process, is not a conversation or session: clients may interleave unrelated requests on the same transport, and a server must not treat connection or process identity as a proxy for conversation or session continuity.2
Prescribed fix session नहीं है। यह explicit handle है: creation tool opaque identifier return करता है, और हर later call उसे ordinary argument की तरह लेती है। Protocol में इसका concept है ही नहीं — “from the wire's perspective a handle is an ordinary string in a tool result and an ordinary argument to subsequent tool calls”.9 इससे model उसे carry करने का जिम्मेदार बनता है, और server हर single call पर validate करने का जिम्मेदार कि यह caller उसे use करने की अनुमति रखता है, क्योंकि handle एक name है, permission नहीं।
Server कुछ भी करने से पहले कितना cost करता है
सेक्शन का लिंक: Server कुछ भी करने से पहले कितना cost करता हैServer जो भी tool expose करता है वह schema है जो हर request पर आपके prompt में जाता है, और Chapter 24 ने measure किया था कि window पर उसका क्या असर होता है। MCP एक second line item जोड़ता है जिसे miss करना आसान है, इसलिए ऊपर वाले reference server पर दोनों count करने लायक हैं।
13 tool definitions (name + description + inputSchema): 1,307 tokens
cheapest tool, get-tiny-image 52
costliest tool, gzip-file-as-resource 235
server `instructions`, returned by discovery: 312 tokens
------
one server, connected, before it is used: 1,619 tokensदो observations। पहली arithmetic है: इस size के पाँच servers connect करें और आपकी window के roughly आठ हज़ार tokens हर turn पर, हमेशा के लिए, spoken for हैं, चाहे model उनमें से किसी का use करे या नहीं — यही mechanism Chapter 24 द्वारा quote किए गए 150,000-to-2,000 reduction के पीछे है, और यही वजह है कि just-in-time tool discovery मौजूद है।
दूसरी security note है जो accounting costume पहने हुए है। instructions natural-language text है, server author द्वारा लिखा हुआ, जो host के prompt में land करता है, और उसके बगल के tool descriptions भी वही हैं। Specification अपने security principles में बताती है कि इसके बारे में क्या करना है: tool annotations और descriptions को “should be considered untrusted, unless obtained from a trusted server” माना जाना चाहिए, और hosts को “must obtain explicit user consent before invoking any tool”.1 MCP server connect करना dependency add करना नहीं है। यह किसी अजनबी को आपके system prompt के 1,619 tokens और call किए जाने का right देना है। Chapter 30 बताता है कि जब वह अजनबी hostile हो तो क्या होता है।
Dated section: 2026-07-28 revision, और यह क्या तोड़ती है
सेक्शन का लिंक: Dated section: 2026-07-28 revision, और यह क्या तोड़ती हैइस section की हर बात protocol revision 2026-07-28, current one, के लिए सही है, जिसे 7 September 2026 को पढ़ा गया। Revisions YYYY-MM-DD dated होती हैं और date वह आख़िरी समय है जब backwards-incompatible change किया गया था।10 Normative document एक TypeScript file है, schema/2026-07-28/schema.ts; उसके साथ की JSON Schema उसी से generated है, इसलिए यहाँ specification TypeScript में पढ़ी गई है और MCP को किसी और चीज़ से teach करना translation teach करना है।
| What changed | Was | Is now | Breaks |
|---|---|---|---|
| Handshake | initialize + notifications/initialized, once per connection | removed; हर request _meta version और capabilities carry करती है | इस revision से पहले लिखा हर client |
| Sessions | Mcp-Session-Id header, connection-scoped state | removed; state explicit, server-minted handles में travel करता है | list endpoints जो per connection vary करते थे |
| Discovery | initialize result से inferred | server/discover, जिसे servers को implement करना चाहिए | कुछ नहीं, लेकिन अब implement करना mandatory है |
| Server-to-client calls | server ने roots/list, sampling/createMessage, elicitation/create भेजे | InputRequiredResult और client retry | हर server जिसने client पर request push की |
| Result shape | कोई भी object | required resultType: "complete" या "input_required" | कुछ नहीं: absent field को "complete" पढ़ना चाहिए |
| Subscriptions | HTTP GET stream, resources/subscribe | opt-in types के साथ एक subscriptions/listen stream | GET endpoint gone है |
| Stream resumption | Streamable HTTP पर Last-Event-ID replay | removed; broken stream request खो देता है, नए id के साथ re-issue करें | redelivery पर rely करने वाले clients |
| Roots | client feature जिसे servers माँग सकते थे | deprecated (SEP-2577); paths को tool arguments या resource URIs के रूप में pass करें | अभी कुछ नहीं — twelve-month window |
| Sampling and logging | client features | deprecated (SEP-2577) | अभी कुछ नहीं — twelve-month window |
| HTTP+SSE transport | 2025-03-26 से deprecated | lifecycle policy (SEP-2596) के तहत Deprecated | Streamable HTTP पर migrate करें |
| Client registration | OAuth 2.0 Dynamic Client Registration, RFC 7591 | Client ID Metadata Documents के favour में deprecated | उनके बिना authorization servers के लिए kept |
| Error codes | resource not found के लिए -32002 | -32602; -32020–-32099 spec के लिए reserved | नए codes -32020, -32021, -32022 |
उस table के नीचे governance change किसी भी single row से ज़्यादा matter करता है। इस revision ने feature lifecycle and deprecation policy adopt की: features Active, Deprecated या Removed होती हैं, deprecated feature अपना migration path document करती है और removal के लिए eligible होने से पहले कम से कम twelve months तक specification में रहती है, और एक registry है जो currently Deprecated state में मौजूद हर चीज़ list करती है।8 उस policy से पहले, AI protocol में “deprecated” का मतलब वही था जो आख़िरी blog post ने कहा। अब इसका मतलब date है।
विवरण दिखाएँ
Extensions, जिन हिस्सों के बारे में अभी किसी ने लिखा ही नहीं है।
Core से आगे, MCP optional extensions define करता है — “always opt-in and require explicit support from both client and server”, जिन्हें client और server की capabilities में extensions field के through declare किया जाता है।1 तीन को नाम से जानना worth है:
- Tasks (
io.modelcontextprotocol/tasks), इस revision में core protocol से official extension में moved: long-running operations का asynchronous execution,tasks/getके through polling,tasks/updateके through mid-flight input, और durable handles। यह उस tool का answer है जिसमें twenty minutes लगते हैं, जिसे Chapter 23 ने progress event और tool तक पहुँचने वाले signal से handle किया था। - Skills over MCP, एक working group जो agent skills — Chapter 28 का subject — को protocol के through discoverable और consumable बना रहा है।
- MCP Apps, conversation में inline rendered interactive UI: charts, forms, video players।
और note करें कि “negotiated” का अब क्या मतलब है: negotiate करने के लिए कोई initialization नहीं है, इसलिए extension भी बाकी सबकी तरह per request declare होती है।
MCP कहाँ बैठता है, उन सब चीज़ों के मुकाबले जिनसे इसे confuse किया जाता है
सेक्शन का लिंक: MCP कहाँ बैठता है, उन सब चीज़ों के मुकाबले जिनसे इसे confuse किया जाता हैपूरे block की vocabulary एक जगह।
| यह क्या है | कौन किससे बात करता है | कब यह answer है | |
|---|---|---|---|
| Plain API | Program के लिए interface | आपका code ↔ service | आप caller लिख रहे हैं। Schema, auth और error handling आपके control में हैं, और solve करने के लिए discovery problem नहीं है। |
| MCP | AI application को tools, data और templates expose करने का protocol | host ↔ server, each one client | Capability किसी और ने लिखी है और कई hosts को bespoke integration के बिना use कर पाना चाहिए। |
| RAG | Text खोजकर prompt में डालने की technique | आपका code ↔ आपका index | Model को कुछ जानना है। Chapter 19। MCP retriever deliver करने का तरीका है; यह retriever नहीं है। |
| Agent skills | SKILL.md वाला folder जिसे model पढ़ता है | model ↔ document | Knowledge procedural है — हम यह कैसे करते हैं — और यह prose है, function नहीं। Chapter 28। |
| A2A | Agents के peers की तरह collaborate करने का protocol | agent ↔ agent | दूसरी side call का answer देने के बजाय reason करती है, plan करती है और long task में state hold करती है। |
| ACP | अलग agent-communication protocol था | — | अब यह live comparison नहीं है। नीचे देखें। |
इनमें से दो को एक-एक sentence चाहिए, क्योंकि confusion असल में वहीं रहती है।
MCP against A2A rivalry नहीं है, और दोनों specifications ऐसा कहती हैं। A2A documentation दूसरी तरफ़ क्या है इसके आधार पर line draw करता है: MCP “defines how an AI agent interacts with and utilizes individual tools and resources, such as a database or an API”, जहाँ tool “specific, often stateless, functions” perform करता है; A2A agents को address करता है, “more autonomous systems” जो “reason, plan, use multiple tools, maintain state over longer interactions, and engage in complex, often multi-turn dialogues”। इसका अपना summary याद रखने वाला sentence है: “A2A is about agents partnering on tasks, while MCP is more about agents using capabilities.”11 दोनों nest होते हैं — application दूसरे agents तक पहुँचने के लिए A2A use करती है, और हर agent अपने tools तक पहुँचने के लिए MCP use करता है। Chapter 25 ने यही line एक process के अंदर draw की थी, sub-agent से पूछने और उसे conversation hand करने के बीच; A2A इसे organisations के बीच draw करता है।
MCP against ACP stale premise वाला comparison है, और ठीक इसी वजह से इसका जवाब देना worth है। Agent Communication Protocol agent-to-agent messaging के लिए separate open standard था। इसकी अपनी documentation अब इस notice से खुलती है: “ACP is now part of A2A under the Linux Foundation!”12 September 2026 में “MCP or ACP?” का honest answer है कि question में उन pages की तुलना में एक option कम है जो इसके लिए rank कर रहे हैं।
और जिस comparison के लिए लोग सबसे ज़्यादा पूछते हैं, mcp vs api, उसका answer सबसे कम interesting है: MCP एक API है। यह जो add करता है वह power नहीं, conventions हैं — method names का fixed set, discovery call, primitives पर control hierarchy, और isolation model। आप अपना interface design करने की freedom छोड़ते हैं और बदले में हर host पाते हैं जो protocol बोलता है, जो हर protocol द्वारा offered trade रहा है।
यह आगे कहाँ जाता है
सेक्शन का लिंक: यह आगे कहाँ जाता हैअब आप specification को translator के बिना पढ़ सकते हैं, resource को tool और prompt से इस आधार पर अलग कर सकते हैं कि control किसके पास है, जब client library आपसे झूठ बोल रही हो तो request हाथ से type कर सकते हैं, और कोई भी MCP article पढ़ते समय यह date कर सकते हैं कि वह कौन-सी deprecated features को अभी भी current की तरह teach कर रहा है।
जो आपने नहीं किया है वह है इसे ship करना। Chapter 27 वही server दो बार लिखता है — TypeScript और Python, side by side, क्योंकि MCP इस course का एक genuinely bilingual territory है और numbers दोनों directions में यही कहते हैं। यह दोनों live transports को properly cover करता है, inspector, packaging, और protocol का वह आधा हिस्सा जिसे इस chapter ने जानबूझकर छोड़ा: authorization। क्योंकि जैसे ही आपका server आपके अपने laptop पर subprocess होने के बजाय remote होता है, किसी अजनबी का client token present करेगा, और specification का rule कि आप उसके साथ क्या कर सकते हैं unusually strict है।
जिससे वह सवाल उठता है जिसका जवाब next chapter को देना है, और वह friendly नहीं है: अगर कोई token आपके server पर आता है और वह किसी और audience के लिए issued था, तो आपको उसे forward करने से exactly क्या रोकता है?
Sources and method
सेक्शन का लिंक: Sources and methodइस chapter में हर quotation, method name, error code और rule Model Context Protocol specification, revision 2026-07-28, से पढ़ा गया, 7 September 2026 को। हर trace locally Node 22 पर produced हुआ: toy calendar server 101 lines का है, बिना dependencies, और reference server नीचे named published npm package है। इस chapter को लिखने में कोई paid API call नहीं की गई — यहाँ किसी model की ज़रूरत नहीं है, और यही point है।
Measurements: @modelcontextprotocol/server-everything@2026.8.31, published 31 August 2026, built on @modelcontextprotocol/sdk@1.30.0, published 27 July 2026 — उस revision से एक दिन पहले जिसे यह chapter describe करता है। यह server/discover का answer -32601 से देता है, 2026-07-28 माँगने पर 2025-11-25 negotiate करता है, और बिना handshake tools/list serve करता है। इसका catalogue 13 tools in 7,663 bytes है; token counts tiktoken के via o200k_base हैं, हर definition के name, description और inputSchema पर, जो provider आपके prompt में render करता है और JSON-RPC frame का weight नहीं है।
Anthropic, Code execution with MCP: building more efficient agents, 4 November 2025, 150,000-to-2,000 figure का source है, जिसे Chapter 24 में quote और use किया गया और यहाँ केवल referenced है।
संदर्भ
सेक्शन का लिंक: संदर्भ-
Specification,
modelcontextprotocol.io/specification/latest(/2026-07-28पर redirecting), read 7 September 2026। Language Server Protocol comparison का source; यह statement कि specification “based on the TypeScript schema inschema.ts” है; base-protocol summary (“Stateless, self-contained requests”, “Per-request capability negotiation”); extension list (Tasks, Skills over MCP, MCP Apps) और यह statement कि extensions “are always opt-in and require explicit support from both client and server” हैं; और Security and Trust & Safety principles, including “Hosts must obtain explicit user consent before invoking any tool” और tool annotations को untrusted मानना। ↩ ↩2 ↩3 -
Base Protocol,
modelcontextprotocol.io/specification/2026-07-28/basic। JSON-RPC constraints (non-null id, no id reuse, requiredresultType); Statelessness section और उसका note कि open stdio process session नहीं है;_metareserved-key table और हर per-request field का required/optional status; missing required field के लिए-32602rule;MissingRequiredClientCapability(-32021) rule; और error-code allocation policy का source। ↩ ↩2 ↩3 ↩4 ↩5 -
stdio transport,
modelcontextprotocol.io/specification/2026-07-28/basic/transports/stdio। Newline-delimited framing rules,stdoutpurity requirement,stderrallowance, और three-outcome backward-compatibility probe का source — including warning कि कुछ legacy servers era-ambiguous methods को बिना handshake process करते हैं, जिसे इस chapter का measurement reproduce करता है। ↩ ↩2 ↩3 -
Transports overview,
modelcontextprotocol.io/specification/2026-07-28/basic/transports। “a transport is a binding” framing और यह statement कि servers JSON-RPC requests initiate नहीं करते और clients JSON-RPC responses नहीं भेजते, का source। ↩ ↩2 -
Discovery,
modelcontextprotocol.io/specification/2026-07-28/server/discover।server/discoverके mandatory status,DiscoverResultकी shape, औरinstructionsfield जिसे “optional natural-language guidance for LLMs on how to use this server effectively” described किया गया, का source। ↩ -
Architecture,
modelcontextprotocol.io/specification/2026-07-28/architecture। Host/client/server definitions, 1:1 client-to-server rule, चार design principles, जिनमें से isolation principle यहाँ उसके fifth bullet “Host process enforces security boundaries” के बिना quoted है, और capability-negotiation section का source। ↩ ↩2 -
Elicitation,
.../client/elicitation, और Sampling,.../client/sampling। दो elicitation modes और उनकी restricted schema; form mode के through credentials request करने की prohibition; sampling definition, उसकी human-in-the-loop requirement, और उससे attached deprecation warning का source। ↩ -
Key Changes,
modelcontextprotocol.io/specification/2026-07-28/changelog, और Feature lifecycle and deprecation policy,.../community/feature-lifecycle। Change table की हर row का source: sessions औरMcp-Session-Idheader का removal (SEP-2567); statelessness औरinitializeका removal (SEP-2575);server/discover(SEP-2575);subscriptions/listen(SEP-2575); Multi Round-Trip Requests औरresultType(SEP-2322); stream resumability का removal (SEP-2575); Roots, Sampling और Logging की deprecation (SEP-2577); HTTP+SSE की reclassification (SEP-2596); Dynamic Client Registration की Client ID Metadata Documents के favour में deprecation; error-code renumbering; और twelve-month deprecation window। ↩ ↩2 -
Tools,
modelcontextprotocol.io/specification/2026-07-28/server/tools, और Server Features,.../server। ऊपर reproduced control-hierarchy table;tools/listऔरtools/callshapes; protocol errors और tool execution errors के बीचisErrordistinction; tool-name rules और namespace note जो “prefixing tool names with a server identifier” recommend करता है; और explicit handles पर non-normative “Stateful Tools” guidance का source। ↩ -
Versioning,
modelcontextprotocol.io/specification/versioning।YYYY-MM-DDscheme, Draft/Current/Final revision states, यह confirmation कि 2026-07-28 current है, और per-request negotiation rules का source।modelcontextprotocol.io/docs/sdkपर SDK tier table TypeScript, Python, C#, Go और Rust को Tier 1, Java और Ruby को Tier 2, और Swift, PHP और Kotlin को Tier 3 list करती है। ↩ -
A2A Protocol, version 1.0.0,
a2a-protocol.org— specification और page A2A and MCP: Relationship and Distinction, read 7 September 2026। Tools-against-agents distinction, यह statement कि दोनों protocols “address distinct but highly complementary needs” हैं, और partnering/using formulation का source। ↩ -
Agent Communication Protocol,
agentcommunicationprotocol.dev, read 7 September 2026: “ACP is now part of A2A under the Linux Foundation!”, एक banner जो ऐसी specification के ऊपर add किया गया है जो अभी भी पूरी serve होती है — architecture, agent manifest, agent discovery, message structure, stateful agents, run lifecycle और REST endpoint list सभी अभी भी 200 answer करते हैं। Specification गायब नहीं हुई; project हुआ। ↩