---
title: "Compare MCP Versions"
description: "ตัวอย่าง MCP บนเว็บทำไมไม่เหมือนที่เราเขียน เทียบข้อความจริงของเวอร์ชัน 2025-11-25 กับ 2026-07-28 ว่าต่างกันตรงไหน และทำไมถึงเปลี่ยน"
canonical_url: "https://iamthana.com/courses/mcp-server/version-history"
---

> Index of every page on this site: [llms.txt](https://iamthana.com/llms.txt)

บทที่แล้วเราเห็นว่า Inspector คุยด้วย `2025-11-25` ส่วน Claude Code คุยด้วย `2026-07-28` บทนี้จะเทียบว่าสองเวอร์ชันนี้ต่างกันตรงไหน และก่อนหน้านั้นเปลี่ยนอะไรมาบ้างครับ

จบบทนี้ถ้าเจอตัวอย่าง MCP บนเว็บ เราจะดูออกว่าเป็นแบบเก่าหรือแบบใหม่

## Earlier Versions

ก่อน `2026-07-28` มีมาแล้ว 4 เวอร์ชัน ตั้งแต่ `2024-11-05` ถึง `2025-11-25` แต่ละรอบเพิ่มฟีเจอร์ใหม่เข้ามา เช่น Streamable HTTP, `structuredContent` และ elicitation (ให้ server ถามผู้ใช้ระหว่างทำงาน) รายการเต็มอยู่ใน Changelog ท้ายบท

เวอร์ชันที่เปลี่ยนวิธีคุยกันมากที่สุดคือ `2026-07-28` บทนี้เลยเทียบเวอร์ชันนี้กับ `2025-11-25` ครับ

## 2025-11-25 vs 2026-07-28

ข้อความทุกอันในหัวข้อนี้ส่งเข้า server ร้านกาแฟตัวเดียวกัน ที่รันด้วย `http_server.py` จากบทที่แล้ว Python SDK รองรับทั้งสองเวอร์ชัน เลยเห็นทั้งสองแบบจาก server เดียว

### Handshake

แบบเก่า client ต้องส่ง `initialize` ก่อน รอคำตอบ แล้วส่ง `notifications/initialized` ตามไป ถึงจะเรียก tool ได้ แบบใหม่ส่ง `tools/call` ได้เลยตั้งแต่ request แรก

<tabs>
<tabs-item label="2025-11-25">

ขั้นแรก ตกลงเวอร์ชันกันก่อน

```json
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}
```

server ตอบเวอร์ชันกับความสามารถของตัวเองกลับมา พร้อม header `mcp-session-id` (header อยู่ใน HTTP response ไม่ได้อยู่ใน JSON ข้างล่าง)

```json
{"jsonrpc":"2.0","id":1,"result":{"capabilities":{"prompts":{"listChanged":false},"resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}},"protocolVersion":"2025-11-25","serverInfo":{"name":"cafe","version":""}}}
```

ขั้นที่สอง แจ้งว่าพร้อมแล้ว (เป็น notification เลยได้ `202` ไม่มี body)

```json
{"jsonrpc":"2.0","method":"notifications/initialized"}
```

ขั้นที่สาม ถึงจะเรียก tool ได้ ต้องแนบ `Mcp-Session-Id` ที่ได้มาทุกครั้ง

```json
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"list_menu","arguments":{"max_price_thb":50}}}
```

</tabs-item>

<tabs-item label="2026-07-28">

request เดียวจบ เวอร์ชันกับความสามารถของ client อยู่ใน `_meta`

```json
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"list_menu","arguments":{"max_price_thb":50},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}}}}
```

ผลลัพธ์มี `resultType` และ server แนบชื่อตัวเองมาใน `_meta` (ย่อ `content` กับ `structuredContent` ไว้ เนื้อในเหมือนผลของ curl ในบทที่แล้ว)

```json
{"jsonrpc":"2.0","id":2,"result":{"content":[...],"isError":false,"resultType":"complete","structuredContent":{"result":[...]},"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"cafe","version":""}}}}
```

</tabs-item>
</tabs>

**ทำไมถึงเปลี่ยน:** [SEP-2575](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2575) (SEP คือเอกสารข้อเสนอแก้ spec) เล่าว่า handshake ทำให้ server ต้องจำว่า client แต่ละตัวตกลงอะไรไว้ (เรียกว่า state) ถ้ามี server หลายเครื่องหลัง load balancer ก็ต้องใช้ sticky session ให้ client คนเดิมวิ่งไปเครื่องเดิมตลอด และถ้าเครื่องนั้นล่ม state ก็หายไปด้วย

### Session

แบบเก่า request หลัง `initialize` ถ้าลืมแนบ `Mcp-Session-Id` จะเรียกอะไรไม่ได้เลย

```text [$ curl (2025-11-25, ไม่แนบ Mcp-Session-Id)]
{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"Bad Request: Missing session ID"}}
HTTP 400
```

แบบใหม่ไม่มี header นี้แล้ว ตอนดักดู Claude Code ในบทที่แล้ว จะเห็นว่าไม่มี `Mcp-Session-Id` ในทั้ง 8 request เลย

**ทำไมถึงเปลี่ยน:** [SEP-2567](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2567) บอกว่าถ้าแอปต้องจำอะไรข้าม request ให้ส่งเป็น id ให้เห็นชัด ๆ เช่น server สร้าง id ของตะกร้าสินค้าแล้วส่งกลับไป ให้ client ส่ง id นั้นกลับมาเป็น argument ของ tool ตัวถัดไป

เมื่อไม่มี session ผลของ `tools/list` ก็ไม่ผูกกับการเชื่อมต่อไหน client เลยเก็บผลไว้ใช้ซ้ำได้ (cache)

`ttlMs` กับ `cacheScope` ที่เห็นในผลลัพธ์บอกเรื่องนี้ `ttlMs` คือใช้ผลซ้ำได้นานกี่มิลลิวินาที (`0` คือต้องขอใหม่ทุกครั้ง) ส่วน `cacheScope: "private"` คือห้ามตัวกลางเอาผลนี้ไปแชร์ให้คนอื่น

### server/discover

ของที่เคยได้จาก `initialize` ย้ายมาอยู่ใน `server/discover` แทน (ตอนดักดูในบทที่แล้ว Claude Code เรียกอันนี้เป็น request แรก)

```json [$ curl -s $URL -H 'Mcp-Method: server/discover']
{"jsonrpc":"2.0","id":4,"result":{"cacheScope":"private","capabilities":{"prompts":{"listChanged":true},"resources":{"listChanged":true,"subscribe":true},"tools":{"listChanged":true}},"resultType":"complete","supportedVersions":["2026-07-28"],"ttlMs":0,"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"cafe","version":""}}}}
```

ถ้าส่งเวอร์ชันที่ server ไม่รู้จักมา จะได้ error บอกว่ารองรับเวอร์ชันไหนบ้าง

```text [$ curl (MCP-Protocol-Version: 2027-01-01)]
{"jsonrpc":"2.0","id":5,"error":{"code":-32022,"message":"Unsupported protocol version","data":{"supported":["2026-07-28"],"requested":"2027-01-01"}}}
HTTP 400
```

### Server-to-Client Requests

แบบเก่า ถ้า tool อยากถามผู้ใช้ระหว่างทำงาน (elicitation) server จะส่ง request `elicitation/create` กลับไปหา client กลางทาง

แบบใหม่ server ตอบ result ที่มี `resultType: "input_required"` พร้อมบอกว่าอยากได้ข้อมูลอะไร client ไปถามผู้ใช้ แล้วส่ง request เดิมซ้ำพร้อมคำตอบ spec เรียกรูปแบบนี้ว่า Multi Round-Trip Requests

`resultType` ที่เห็นในทุกผลลัพธ์มีไว้แยกสองกรณีนี้ คือ `complete` ทำงานเสร็จแล้ว กับ `input_required` ยังต้องการข้อมูลเพิ่ม เดี๋ยวบท [Confirm Actions with Elicitation](https://iamthana.com/courses/mcp-server/orders) จะได้ใช้กัน

## Pitfalls

- client กับ server อาจคุยคนละเวอร์ชัน เพราะ client บางตัวยังคุยด้วย `2025-11-25` อยู่ เช่น Inspector ในบทที่แล้ว ถ้าเขียน server เองให้ใช้ SDK ที่รองรับทั้งสองแบบ (Python SDK 2.3.0 ยังรับ `initialize` อยู่)
- ตัวอย่างโค้ดบนเว็บส่วนใหญ่เขียนตามเวอร์ชันเก่า ถ้าเจอ `initialize` หรือ `Mcp-Session-Id` ในตัวอย่าง แปลว่าเป็นแบบ `2025-11-25` หรือเก่ากว่า
- ฟีเจอร์ Logging ของ MCP (server ส่ง log ไปให้ client ผ่าน protocol) ถูกประกาศเลิกใช้แล้ว log ของ server ให้เขียนลง stderr แบบที่ทำมาตั้งแต่บท [Build Your First Tool](https://iamthana.com/courses/mcp-server/first-tool)

## Summary

`2026-07-28` ตัด handshake กับ session ออก ทุก request แนบเวอร์ชันกับความสามารถของ client มาใน `_meta` เอง client ถามความสามารถของ server ด้วย `server/discover` และ server ขอข้อมูลเพิ่มด้วย result แบบ `input_required` แทนการส่ง request กลับไปหา client

บทหน้าเราจะกลับไปเขียน tool ที่แก้ข้อมูล คือสร้างออร์เดอร์กับยกเลิกออร์เดอร์ครับ

## References

- [Changelog 2026-07-28](https://modelcontextprotocol.io/specification/2026-07-28/changelog)
- [Changelog 2025-11-25](https://modelcontextprotocol.io/specification/2025-11-25/changelog)
- [Changelog 2025-06-18](https://modelcontextprotocol.io/specification/2025-06-18/changelog)
- [Changelog 2025-03-26](https://modelcontextprotocol.io/specification/2025-03-26/changelog)
- [SEP-2575: stateless MCP](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2575)
- [SEP-2567: remove sessions](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2567)

## Sitemap

See the full [sitemap](https://iamthana.com/sitemap.md) for all pages.
