Skip to content

Commit b6b270f

Browse files
authored
Merge branch 'main' into session-hijack
2 parents 3ba50c9 + 9ee029c commit b6b270f

File tree

9 files changed

+160
-78
lines changed

9 files changed

+160
-78
lines changed

docs/clients.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This page provides an overview of applications that support the Model Context Pr
3535
| [Goose][Goose] ||||||| Supports tools. |
3636
| [gptme][gptme] ||||||| Supports tools. |
3737
| [HyperAgent][HyperAgent] ||||||| Supports tools. |
38-
| [JetBrains AI Assistant][JetBrains AI Assistant] ||||||| Supports tools for all JetBrains IDEs. |
38+
| [JetBrains AI Assistant][JetBrains AI Assistant] ||||||| Supports tools for all JetBrains IDEs. |
3939
| [Klavis AI Slack/Discord/Web][Klavis AI] ||||||| Supports tools and resources. |
4040
| [LibreChat][LibreChat] ||||||| Supports tools for Agents |
4141
| [Lutra][Lutra] ||||||| Supports any MCP server for reusable playbook creation. |

docs/sdk/java/mcp-client.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
2-
title: MCP Client
2+
title: Java MCP Client
33
description: Learn how to use the Model Context Protocol (MCP) client to interact with MCP servers
44
---
55

6+
Go to the [Java MCP Server](/sdk/java/mcp-server) to learn how to build MCP servers or the [Java MCP Overview](/sdk/java/mcp-overview) to understand the overall architecture.
7+
68
# Model Context Protocol Client
79

810
The MCP Client is a key component in the Model Context Protocol (MCP) architecture, responsible for establishing and managing connections with MCP servers. It implements the client-side of the protocol, handling:
@@ -16,13 +18,17 @@ The MCP Client is a key component in the Model Context Protocol (MCP) architectu
1618
- Optional features like roots management and sampling support
1719

1820
<Tip>
19-
2021
The core `io.modelcontextprotocol.sdk:mcp` module provides STDIO and SSE client transport implementations without requiring external web frameworks.
2122

2223
Spring-specific transport implementations are available as an **optional** dependency `io.modelcontextprotocol.sdk:mcp-spring-webflux` for [Spring Framework](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-client-boot-starter-docs.html) users.
2324

2425
</Tip>
2526

27+
<Tip>
28+
This [quickstart demo](/quickstart/client), based on Spring AI MCP, will show
29+
you how to build an AI client that connects to MCP servers.
30+
</Tip>
31+
2632
The client provides both synchronous and asynchronous APIs for flexibility in different application contexts.
2733

2834
<Tabs>

docs/sdk/java/mcp-overview.mdx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
---
2-
title: Overview
2+
title: Java SDK Overview
33
description: Introduction to the Model Context Protocol (MCP) Java SDK
44
---
55

66
Java SDK for the [Model Context Protocol](https://modelcontextprotocol.org/docs/concepts/architecture)
77
enables standardized integration between AI models and tools.
88

9-
<Note>
9+
## Content
1010

11-
### Breaking Changes in 0.8.x ⚠️
12-
13-
**Note:** Version 0.8.x introduces several breaking changes including a new session-based architecture.
14-
If you're upgrading from 0.7.0, please refer to the [Migration Guide](https://github.com/modelcontextprotocol/java-sdk/blob/main/migration-0.8.0.md) for detailed instructions.
15-
16-
</Note>
11+
- [Introduction](/sdk/java/mcp-overview#features) - Overview of the Model Context Protocol (MCP) Java SDK and its features.
12+
- [Architecture](/sdk/java/mcp-overview#architecture) - The Java MCP SDK architecture overview.
13+
- [Java Dependencies](/sdk/java/mcp-overview#dependencies) - Java dependencies required to use the MCP SDK.
14+
- [Java MCP Client](/sdk/java/mcp-client) - Learn how to use the MCP client to interact with MCP servers.
15+
- [Java MCP Server](/sdk/java/mcp-server) - Learn how to implement and configure an MCP server.
1716

1817
## Features
1918

@@ -55,12 +54,12 @@ The SDK follows a layered architecture with clear separation of concerns:
5554
- StdioTransport (stdin/stdout) in the core module
5655
- HTTP SSE transports in dedicated transport modules (Java HttpClient, Spring WebFlux, Spring WebMVC)
5756

58-
The MCP Client is a key component in the Model Context Protocol (MCP) architecture, responsible for establishing and managing connections with MCP servers.
57+
The [MCP Client](/sdk/java/mcp-client) is a key component in the Model Context Protocol (MCP) architecture, responsible for establishing and managing connections with MCP servers.
5958
It implements the client-side of the protocol.
6059

6160
![Java MCP Client Architecture](/images/java/java-mcp-client-architecture.jpg)
6261

63-
The MCP Server is a foundational component in the Model Context Protocol (MCP) architecture that provides tools, resources, and capabilities to clients.
62+
The [MCP Server](/sdk/java/mcp-server) is a foundational component in the Model Context Protocol (MCP) architecture that provides tools, resources, and capabilities to clients.
6463
It implements the server-side of the protocol.
6564

6665
![Java MCP Server Architecture](/images/java/java-mcp-server-architecture.jpg)
@@ -154,7 +153,7 @@ Add the BOM to your project:
154153
<dependency>
155154
<groupId>io.modelcontextprotocol.sdk</groupId>
156155
<artifactId>mcp-bom</artifactId>
157-
<version>0.9.0</version>
156+
<version>0.10.0</version>
158157
<type>pom</type>
159158
<scope>import</scope>
160159
</dependency>
@@ -168,7 +167,7 @@ Add the BOM to your project:
168167

169168
```groovy
170169
dependencies {
171-
implementation platform("io.modelcontextprotocol.sdk:mcp-bom:0.9.0")
170+
implementation platform("io.modelcontextprotocol.sdk:mcp-bom:0.10.0")
172171
//...
173172
}
174173
```

docs/sdk/java/mcp-server.mdx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
---
2-
title: MCP Server
2+
title: Java MCP Server
33
description: Learn how to implement and configure a Model Context Protocol (MCP) server
44
---
55

6-
<Note>
7-
8-
### Breaking Changes in 0.8.x ⚠️
9-
10-
**Note:** Version 0.8.x introduces several breaking changes including a new session-based architecture.
11-
If you're upgrading from 0.7.0, please refer to the [Migration Guide](https://github.com/modelcontextprotocol/java-sdk/blob/main/migration-0.8.0.md) for detailed instructions.
12-
13-
</Note>
6+
Go to the [Java MCP Client](/sdk/java/mcp-client) to learn how to build MCP clients or [Java MCP Overview](/sdk/java/mcp-overview) for a general overview of the Model Context Protocol (MCP) in Java.
147

158
## Overview
169

@@ -32,6 +25,11 @@ Spring-specific transport implementations are available as an **optional** depen
3225

3326
</Tip>
3427

28+
<Tip>
29+
This [quickstart demo](/quickstart/server), based on Spring AI MCP, will show
30+
you how to build an MCP server.
31+
</Tip>
32+
3533
The server supports both synchronous and asynchronous APIs, allowing for flexible integration in different application contexts.
3634

3735
<Tabs>

docs/specification/draft/basic/authorization.mdx

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,19 +178,58 @@ sequenceDiagram
178178
A->>C: Client Credentials
179179
end
180180
181-
Note over C: Generate PKCE parameters
182-
C->>B: Open browser with authorization URL + code_challenge
183-
B->>A: Authorization request
181+
Note over C: Generate PKCE parameters<br/>Include resource parameter
182+
C->>B: Open browser with authorization URL + code_challenge + resource
183+
B->>A: Authorization request with resource parameter
184184
Note over A: User authorizes
185185
A->>B: Redirect to callback with authorization code
186186
B->>C: Authorization code callback
187-
C->>A: Token request + code_verifier
187+
C->>A: Token request + code_verifier + resource
188188
A->>C: Access token (+ refresh token)
189189
C->>M: MCP request with access token
190190
M-->>C: MCP response
191191
Note over C,M: MCP communication continues with valid token
192192
```
193193

194+
#### Resource Parameter Implementation
195+
196+
MCP clients **MUST** implement Resource Indicators for OAuth 2.0 as defined in [RFC 8707](https://www.rfc-editor.org/rfc/rfc8707.html)
197+
to explicitly specify the target resource for which the token is being requested. The `resource` parameter:
198+
199+
1. **MUST** be included in both authorization requests and token requests.
200+
2. **MUST** identify the MCP server that the client intends to use the token with.
201+
3. **MUST** use the canonical URI of the MCP server as defined in [RFC 8707 Section 2](https://www.rfc-editor.org/rfc/rfc8707.html#name-access-token-request).
202+
203+
##### Canonical Server URI
204+
205+
For the purposes of this specification, the canonical URI of an MCP server is defined as the resource identifier as specified in
206+
[RFC 8707 Section 2](https://www.rfc-editor.org/rfc/rfc8707.html#section-2) and aligns with the `resource` parameter in
207+
[RFC 9728](https://datatracker.ietf.org/doc/html/rfc9728).
208+
209+
MCP clients **SHOULD** provide the most specific URI that they can for the MCP server they intend to access, following the guidance in [RFC 8707](https://www.rfc-editor.org/rfc/rfc8707). While the canonical form uses lowercase scheme and host components, implementations **SHOULD** accept uppercase scheme and host components for robustness and interoperability.
210+
211+
Examples of valid canonical URIs:
212+
213+
- `https://mcp.example.com/mcp`
214+
- `https://mcp.example.com`
215+
- `https://mcp.example.com:8443`
216+
- `https://mcp.example.com/server/mcp` (when path component is necessary to identify individual MCP server)
217+
218+
Examples of invalid canonical URIs:
219+
220+
- `mcp.example.com` (missing scheme)
221+
- `https://mcp.example.com#fragment` (contains fragment)
222+
223+
> **Note:** While both `https://mcp.example.com/` (with trailing slash) and `https://mcp.example.com` (without trailing slash) are technically valid absolute URIs according to [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986), implementations **SHOULD** consistently use the form without the trailing slash for better interoperability unless the trailing slash is semantically significant for the specific resource.
224+
225+
For example, if accessing an MCP server at `https://mcp.example.com`, the authorization request would include:
226+
227+
```
228+
&resource=https%3A%2F%2Fmcp.example.com
229+
```
230+
231+
MCP clients **MUST** send this parameter regardless of whether authorization servers support it.
232+
194233
### Access Token Usage
195234

196235
#### Token Requirements
@@ -214,7 +253,7 @@ even if they are part of the same logical session.
214253
Example request:
215254

216255
```http
217-
GET /v1/contexts HTTP/1.1
256+
GET /mcp HTTP/1.1
218257
Host: mcp.example.com
219258
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
220259
```
@@ -223,6 +262,8 @@ Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
223262

224263
MCP servers, acting in their role as an OAuth 2.1 resource server, **MUST** validate access tokens as described in
225264
[OAuth 2.1 Section 5.2](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-12#section-5.2).
265+
MCP servers **MUST** validate that access tokens were issued specifically for them as the intended audience,
266+
according to [RFC 8707 Section 2](https://www.rfc-editor.org/rfc/rfc8707.html#section-2).
226267
If validation fails, servers **MUST** respond according to
227268
[OAuth 2.1 Section 5.3](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-12#section-5.3)
228269
error handling requirements. Invalid or expired tokens **MUST** receive a HTTP 401
@@ -313,8 +354,11 @@ MCP servers **MUST** validate access tokens before processing the request, ensur
313354

314355
A MCP server **MUST** follow the guidelines in [OAuth 2.1 - Section 5.2](https://www.ietf.org/archive/id/draft-ietf-oauth-v2-1-12.html#section-5.2) to validate inbound tokens.
315356

316-
MCP servers **MUST** only accept tokens specifically intended for themselves.
357+
MCP servers **MUST** only accept tokens specifically intended for themselves and **MUST** reject tokens that do not include them in the audience claim or otherwise verify that they are the intended recipient of the token. See [Security Best Practices Section 2.2](/specification/draft/basic/security_best_practices#token-passthrough) for details.
317358

318359
If the MCP server makes requests to upstream APIs, it may act as an OAuth client to them. The access token used at the upstream API is a seperate token, issued by the upstream authorization server. The MCP server **MUST NOT** pass through the token it received from the MCP client.
319360

320-
If the authorization server supports the `resource` parameter, it is recommended that implementers follow [RFC 8707](https://www.rfc-editor.org/rfc/rfc8707.html) to prevent token misuse.
361+
MCP clients **MUST** implement and use the `resource` parameter as defined in [RFC 8707 - Resource Indicators for OAuth 2.0](https://www.rfc-editor.org/rfc/rfc8707.html)
362+
to explicitly specify the target resource for which the token is being requested. This requirement aligns with the recommendation in
363+
[RFC 9728 Section 7.4](https://datatracker.ietf.org/doc/html/rfc9728#section-7.4). This ensures that access tokens are bound to their intended resources and
364+
cannot be misused across different services.

docs/specification/draft/basic/index.mdx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
title: Overview
33
---
44

5+
<div id="enable-section-numbers" />
6+
57
<Info>**Protocol Revision**: draft</Info>
68

79
The Model Context Protocol consists of several key components that work together:
@@ -116,3 +118,29 @@ There is also a
116118
[JSON Schema](https://github.com/modelcontextprotocol/specification/blob/main/schema/draft/schema.json),
117119
which is automatically generated from the TypeScript source of truth, for use with
118120
various automated tooling.
121+
122+
### General fields
123+
124+
#### `_meta`
125+
126+
The `_meta` property/parameter is reserved by MCP to allow clients and servers
127+
to attach additional metadata to their interactions.
128+
129+
Certain key names are reserved by MCP for protocol-level metadata, as specified below;
130+
implementations must not make assumptions about values at these keys.
131+
132+
Additionally, definitions in the [schema](https://github.com/modelcontextprotocol/specification/blob/main/schema/draft/schema.ts)
133+
may reserve particular names for purpose-specific metadata, as declared in those definitions.
134+
135+
**Key name format:** valid `_meta` key names have two segments: an optional **prefix**, and a **name**.
136+
137+
**Prefix:**
138+
139+
- If specified, must be a series of labels separated by dots (`.`), followed by a slash (`/`).
140+
- Labels must start with a letter and end with a letter or digit; interior characters can be letters, digits, or hyphens (`-`).
141+
- The `modelcontextprotocol.[*]/` and `mcp.[*]/` prefixes are reserved for MCP use (where `[*]` stands for any top-level domain).
142+
143+
**Name:**
144+
145+
- Unless empty, must begin and end with an alphanumeric character (`[a-z0-9A-Z]`).
146+
- Could contain hyphens (`-`), underscores (`_`), dots (`.`), and alphanumerics in between.

docs/specification/draft/server/utilities/completion.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ what is being completed through a reference type:
7878
}
7979
```
8080

81-
For prompts or URI templates with multiple arguments, clients should resolve them in the order they are presented by the server, and include each previous completion in the `context.arguments` object to provide context for subsequent requests.
81+
For prompts or URI templates with multiple arguments, clients should include previous completions in the `context.arguments` object to provide context for subsequent requests.
8282

8383
**Request:**
8484

0 commit comments

Comments
 (0)