Skip to content

Commit c41f6ed

Browse files
chughtapanclaude
andcommitted
Add Groups as a new MCP primitive (SEP 2084)
Implement Groups to organize tools, prompts, resources, tasks, and groups into named collections. This enables: - Client-side filtering of primitives by group - Progressive disclosure for large sets of primitives - Access control boundaries at the group level Schema changes: - Add `groups` capability to ServerCapabilities - Add ListGroupsRequest, ListGroupsResult, Group interfaces - Add GroupListChangedNotification for list changes Documentation: - Add groups.mdx specification page - Update server overview to include Groups - Document io.modelcontextprotocol/groups _meta key Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a0e8583 commit c41f6ed

16 files changed

Lines changed: 599 additions & 2 deletions

File tree

docs/docs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@
305305
"specification/draft/server/prompts",
306306
"specification/draft/server/resources",
307307
"specification/draft/server/tools",
308+
"specification/draft/server/groups",
308309
{
309310
"group": "Utilities",
310311
"pages": [

docs/specification/draft/basic/index.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,25 @@ may reserve particular names for purpose-specific metadata, as declared in those
216216
- Unless empty, MUST begin and end with an alphanumeric character (`[a-z0-9A-Z]`).
217217
- MAY contain hyphens (`-`), underscores (`_`), dots (`.`), and alphanumerics in between.
218218

219+
#### Reserved `_meta` Keys
220+
221+
MCP reserves certain `_meta` keys for protocol-level functionality.
222+
223+
##### `io.modelcontextprotocol/groups`
224+
225+
Indicates group membership for any primitive (Tool, Resource, Prompt, Task, Group).
226+
The value is an array of group names:
227+
228+
```json
229+
{
230+
"_meta": {
231+
"io.modelcontextprotocol/groups": ["group-name-1", "group-name-2"]
232+
}
233+
}
234+
```
235+
236+
See [Groups](/specification/draft/server/groups) for details.
237+
219238
### `icons`
220239

221240
The `icons` property provides a standardized way for servers to expose visual identifiers for their resources, tools, prompts, and implementations. Icons enhance user interfaces by providing visual context and improving the discoverability of available functionality.

docs/specification/draft/schema.mdx

Lines changed: 52 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
---
2+
title: Groups
3+
---
4+
5+
<div id="enable-section-numbers" />
6+
7+
<Info>**Protocol Revision**: draft</Info>
8+
9+
The Model Context Protocol (MCP) allows servers to organize primitives (tools, prompts, resources,
10+
tasks, and groups themselves) into named collections called groups. Groups provide a natural
11+
abstraction for organizing primitives by functional areas, use cases, or access control boundaries.
12+
13+
## User Interaction Model
14+
15+
Groups in MCP are designed to be **application-controlled**, meaning that clients and hosts can
16+
use groups to filter and organize which primitives are presented to language models.
17+
18+
Common use cases include:
19+
20+
- **Client-side Filtering**: Present only relevant primitives based on user context
21+
- **Simplified Instructions**: Reduce cognitive load on LLMs by showing focused subsets
22+
- **Access Control**: Enable permission boundaries at the group level
23+
- **Progressive Disclosure**: Allow clients to present primitives in manageable subsets
24+
25+
Implementations are free to use groups through any interface pattern that suits their
26+
needs&mdash;the protocol itself does not mandate any specific user interaction model.
27+
28+
## Capabilities
29+
30+
Servers that support groups **MUST** declare the `groups` capability:
31+
32+
```json
33+
{
34+
"capabilities": {
35+
"groups": {
36+
"listChanged": true
37+
}
38+
}
39+
}
40+
```
41+
42+
`listChanged` indicates whether the server will emit notifications when the list of
43+
available groups changes.
44+
45+
## Protocol Messages
46+
47+
### Listing Groups
48+
49+
To discover available groups, clients send a `groups/list` request. This operation supports
50+
[pagination](/specification/draft/server/utilities/pagination).
51+
52+
**Request:**
53+
54+
```json
55+
{
56+
"jsonrpc": "2.0",
57+
"id": 1,
58+
"method": "groups/list",
59+
"params": {
60+
"cursor": "optional-cursor-value"
61+
}
62+
}
63+
```
64+
65+
**Response:**
66+
67+
```json
68+
{
69+
"jsonrpc": "2.0",
70+
"id": 1,
71+
"result": {
72+
"groups": [
73+
{
74+
"name": "user-management",
75+
"title": "User Management Tools",
76+
"description": "Tools used for managing user accounts within the system."
77+
},
78+
{
79+
"name": "mapping",
80+
"title": "Geospatial Mapping Tools",
81+
"description": "Tools for map rendering and spatial analysis.",
82+
"icons": [
83+
{
84+
"src": "https://example.com/mapping-icon.png",
85+
"mimeType": "image/png",
86+
"sizes": ["48x48"]
87+
}
88+
]
89+
}
90+
],
91+
"nextCursor": "next-page-cursor"
92+
}
93+
}
94+
```
95+
96+
### List Changed Notification
97+
98+
When the list of available groups changes, or when any group's metadata (such as
99+
`title`, `description`, or `icons`) is modified, servers that declared the `listChanged`
100+
capability **SHOULD** send a notification:
101+
102+
```json
103+
{
104+
"jsonrpc": "2.0",
105+
"method": "notifications/groups/list_changed"
106+
}
107+
```
108+
109+
## Primitive Group Membership
110+
111+
Primitives indicate their group membership using the reserved `_meta` key
112+
`io.modelcontextprotocol/groups`. The value is an array of group names:
113+
114+
```json
115+
{
116+
"name": "create_user",
117+
"description": "Creates a new user account",
118+
"inputSchema": {
119+
"type": "object",
120+
"properties": {
121+
"username": { "type": "string" }
122+
}
123+
},
124+
"_meta": {
125+
"io.modelcontextprotocol/groups": ["user-management", "admin"]
126+
}
127+
}
128+
```
129+
130+
This approach allows:
131+
132+
- **Multi-group Membership**: A primitive can belong to multiple groups
133+
- **Nested Groups**: Groups themselves can belong to other groups
134+
- **Flexible Organization**: Group structure is not limited to strict hierarchies
135+
136+
### Nested Groups
137+
138+
Groups can be nested by having a group reference other groups in its `_meta`:
139+
140+
```json
141+
{
142+
"name": "email",
143+
"title": "Email Tools",
144+
"description": "Tools for composing and sending emails.",
145+
"_meta": {
146+
"io.modelcontextprotocol/groups": ["productivity"]
147+
}
148+
}
149+
```
150+
151+
In this example, the `email` group is a member of the `productivity` group,
152+
creating a hierarchy.
153+
154+
### Membership Changed Notifications
155+
156+
When primitives change their group membership, servers **SHOULD** use the appropriate
157+
primitive-specific notification:
158+
159+
- Tools: `notifications/tools/list_changed`
160+
- Prompts: `notifications/prompts/list_changed`
161+
- Resources: `notifications/resources/list_changed`
162+
- Tasks: `notifications/tasks/status`
163+
- Groups: `notifications/groups/list_changed`
164+
165+
Clients receiving these notifications can re-fetch the primitive lists to discover
166+
updated group memberships.
167+
168+
## Message Flow
169+
170+
```mermaid
171+
sequenceDiagram
172+
participant Client
173+
participant Server
174+
175+
Note over Client,Server: Discovery
176+
Client->>Server: groups/list
177+
Server-->>Client: List of groups
178+
179+
Note over Client,Server: Primitive Discovery
180+
Client->>Server: tools/list
181+
Server-->>Client: Tools with _meta.groups
182+
183+
Note over Client: Client filters tools by group
184+
185+
Note over Client,Server: Updates
186+
Server--)Client: notifications/groups/list_changed
187+
Client->>Server: groups/list
188+
Server-->>Client: Updated groups
189+
```
190+
191+
## Data Types
192+
193+
### Group
194+
195+
A group definition includes:
196+
197+
- `name`: Unique identifier for the group
198+
- `title`: Optional human-readable name of the group for display purposes
199+
- `description`: Human-readable description of the group's purpose
200+
- `icons`: Optional array of icons for display in user interfaces
201+
- `annotations`: Optional additional group information
202+
- `_meta`: Optional metadata, including group membership for nested groups
203+
204+
#### Group Names
205+
206+
TBD: Maybe similar to tool names?

docs/specification/draft/server/index.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ models:
1313
- **Resources**: Structured data or content that provides additional context to the model
1414
- **Tools**: Executable functions that allow models to perform actions or retrieve
1515
information
16+
- **Groups**: Named collections for organizing primitives
1617

1718
Each primitive can be summarized in the following control hierarchy:
1819

@@ -21,10 +22,11 @@ Each primitive can be summarized in the following control hierarchy:
2122
| Prompts | User-controlled | Interactive templates invoked by user choice | Slash commands, menu options |
2223
| Resources | Application-controlled | Contextual data attached and managed by the client | File contents, git history |
2324
| Tools | Model-controlled | Functions exposed to the LLM to take actions | API POST requests, file writing |
25+
| Groups | Application-controlled | Named collections for organizing primitives | Functional areas, use cases |
2426

2527
Explore these key primitives in more detail below:
2628

27-
<CardGroup cols={3}>
29+
<CardGroup cols={4}>
2830
<Card
2931
title="Prompts"
3032
icon="message"
@@ -36,4 +38,9 @@ Explore these key primitives in more detail below:
3638
href="/specification/draft/server/resources"
3739
/>
3840
<Card title="Tools" icon="wrench" href="/specification/draft/server/tools" />
41+
<Card
42+
title="Groups"
43+
icon="folder"
44+
href="/specification/draft/server/groups"
45+
/>
3946
</CardGroup>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "user-management",
3+
"title": "User Management Tools",
4+
"description": "Tools used for managing user accounts within the system."
5+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "email",
3+
"title": "Email Tools",
4+
"description": "Tools for composing and sending emails.",
5+
"icons": [
6+
{
7+
"src": "https://example.com/email-icon.png",
8+
"mimeType": "image/png",
9+
"sizes": ["48x48"]
10+
}
11+
],
12+
"_meta": {
13+
"io.modelcontextprotocol/groups": ["productivity"]
14+
}
15+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"jsonrpc": "2.0",
3+
"method": "notifications/groups/list_changed"
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"jsonrpc": "2.0",
3+
"id": "list-groups-example",
4+
"method": "groups/list"
5+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"groups": [
3+
{
4+
"name": "user-management",
5+
"title": "User Management Tools",
6+
"description": "Tools used for managing user accounts."
7+
},
8+
{
9+
"name": "mapping",
10+
"title": "Geospatial Mapping Tools",
11+
"description": "Tools for map rendering and spatial analysis."
12+
}
13+
],
14+
"nextCursor": "next-page-cursor"
15+
}

0 commit comments

Comments
 (0)