# Transports: stdio और Streamable HTTP — MCP और Agent-to-Agent Protocols

Source: https://www.geekswithgeeks.com/hi/mcp-a2a/m-transports

> चुनें कि client और server संदेश कैसे बदलें।

## स्थानीय pipes या दूरस्थ HTTP

MCP तय करता है कि संदेश कैसे चलें। **stdio** में host server को **child process** के रूप में शुरू करता है और standard input व output पर newline-सीमित JSON संदेश बदलता है (log stderr में करें, stdout में कभी नहीं, वरना stream बिगड़ जाती है)। यह सरल और स्थानीय है: server user की अनुमतियों से उनकी मशीन पर चलता है। **Streamable HTTP** HTTP उपयोग करता है ताकि servers **दूरस्थ** चल सकें, कई clients को सेवा दे सकें और उत्तर stream कर सकें (जहाँ ज़रूरी हो Server-Sent Events से)। दूरस्थ servers को **authentication**, **session प्रबंधन**, rate limits और TLS सँभालने होंगे; विनिर्देश संरक्षित दूरस्थ servers के लिए **OAuth**-आधारित प्राधिकरण की सिफ़ारिश करता है। पुराना HTTP+SSE transport था जो बदला जा चुका है, इसलिए देखें कि आपका SDK संस्करण कौन-सा समर्थित करता है।

## stdio बनाम Streamable HTTP

चुनाव के लिए तुलना।

```text
                 stdio                               Streamable HTTP
where it runs    child process on the user's machine  remote service (or local HTTP)
clients          one (the parent host)                many
auth             inherits the OS user                  OAuth / tokens required for protected data
logging          stderr only (stdout = protocol)       normal server logs
scaling          none needed                           load balancers, sessions, rate limits
best for         local tools, dev, files               shared/team/SaaS tools
```

**Quiz:** stdio MCP server को stderr में log क्यों करना चाहिए?

- [ ] Logs निषिद्ध हैं
- [ ] stderr तेज़ है
- [x] stdout protocol संदेश ले जाता है और logs उसे बिगाड़ देंगे
- [ ] यह logs को encrypt करता है

*Answer:* stdout protocol संदेश ले जाता है और logs उसे बिगाड़ देंगे. stdout पर कोई भी अतिरिक्त पाठ JSON संदेश stream तोड़ देता है।
