Skip to content

Commit 1351914

Browse files
committed
Add instructions field to InitializeResult
1 parent 400dcda commit 1351914

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/mcp/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ class InitializeResult(Result):
285285
"""The version of the Model Context Protocol that the server wants to use."""
286286
capabilities: ServerCapabilities
287287
serverInfo: Implementation
288+
instructions: str | None = None
289+
"""Instructions describing how to use the server and its features."""
288290

289291

290292
class InitializedNotification(Notification):

tests/client/test_session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ async def mock_server():
5151
prompts=None,
5252
),
5353
serverInfo=Implementation(name="mock-server", version="0.1.0"),
54+
instructions="The server instructions."
5455
)
5556
)
5657

@@ -92,6 +93,7 @@ async def listen_session():
9293
assert result.protocolVersion == LATEST_PROTOCOL_VERSION
9394
assert isinstance(result.capabilities, ServerCapabilities)
9495
assert result.serverInfo == Implementation(name="mock-server", version="0.1.0")
96+
assert result.instructions == "The server instructions."
9597

9698
# Check that the client sent the initialized notification
9799
assert initialized_notification

0 commit comments

Comments
 (0)