Skip to content

Commit ede1960

Browse files
authored
Merge pull request modelcontextprotocol#548 from kurtisvg/kvg-fix-version-negotiation
fix!: require negotiated version when using HTTP
2 parents 03129d2 + ff1de47 commit ede1960

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

docs/specification/draft/basic/authorization.mdx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,7 @@ sequenceDiagram
125125
Note over C,M: MCP communication continues with valid token
126126
```
127127

128-
### 2.4 MCP specific headers for discovery
129-
130-
MCP clients **SHOULD** include the `MCP-Protocol-Version: <protocol-version>` HTTP header during
131-
any request to the MCP server allowing the MCP server to respond based on the MCP protocol version.
132-
133-
MCP servers **SHOULD** use the `MCP-Protocol-Version` header to determine compatibility with the MCP client.
134-
135-
For example: `MCP-Protocol-Version: 2024-11-05`
136-
137-
### 2.5 Dynamic Client Registration
128+
### 2.4 Dynamic Client Registration
138129

139130
MCP clients and authorization servers **SHOULD** support the
140131
OAuth 2.0 Dynamic Client Registration Protocol [RFC7591](https://datatracker.ietf.org/doc/html/rfc7591)
@@ -157,7 +148,7 @@ these authorization servers, MCP clients will have to either:
157148
OAuth client themselves (e.g., through a configuration interface hosted by the
158149
server).
159150

160-
### 2.6 Authorization Flow Steps
151+
### 2.5 Authorization Flow Steps
161152

162153
The complete Authorization flow proceeds as follows:
163154

@@ -198,9 +189,9 @@ sequenceDiagram
198189
Note over C,M: MCP communication continues with valid token
199190
```
200191

201-
### 2.7 Access Token Usage
192+
### 2.6 Access Token Usage
202193

203-
#### 2.7.1 Token Requirements
194+
#### 2.6.1 Token Requirements
204195

205196
Access token handling when making requests to MCP servers **MUST** conform to the requirements defined in
206197
[OAuth 2.1 Section 5 "Resource Requests"](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-12#section-5).
@@ -226,7 +217,7 @@ Host: mcp.example.com
226217
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
227218
```
228219

229-
#### 2.7.2 Token Handling
220+
#### 2.6.2 Token Handling
230221

231222
MCP servers, acting in their role as an OAuth 2.1 resource server, **MUST** validate access tokens as described in
232223
[OAuth 2.1 Section 5.2](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-12#section-5.2).
@@ -242,7 +233,7 @@ own resources.
242233

243234
MCP servers **MUST NOT** accept or transit any other tokens.
244235

245-
### 2.8 Error Handling
236+
### 2.7 Error Handling
246237

247238
Servers **MUST** return appropriate HTTP status codes for authorization errors:
248239

docs/specification/draft/basic/lifecycle.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ supports. This **SHOULD** be the _latest_ version supported by the server.
138138
If the client does not support the version in the server's response, it **SHOULD**
139139
disconnect.
140140

141+
If using HTTP, the client **MUST** include the `MCP-Protocol-Version:
142+
<protocol-version>` HTTP header during any subsequent requests to the MCP
143+
server, allowing the MCP server to respond based on the MCP protocol version.
144+
145+
The protocol version sent by the client **SHOULD** be the one negotiated during [initialization](https://modelcontextprotocol.io/specification/draft/basic/lifecycle#initialization).
146+
147+
If the server receives a request with a missing, invalid, or unsupported
148+
MCP-Protocol-VERSION, it **MUST** respond with `400 Bad Request`.
149+
For example: `MCP-Protocol-Version: 2024-11-05`
141150
#### Capability Negotiation
142151

143152
Client and server capabilities establish which optional protocol features will be

0 commit comments

Comments
 (0)