mirror of
https://github.com/aljazceru/mcp-python-sdk.git
synced 2025-12-19 14:54:24 +01:00
Replace generic capability dictionaries with structured types for prompts, resources, tools, and roots. This improves type safety and makes capability features like listChanged and subscribe more explicit in the protocol.
115 lines
2.5 KiB
Python
115 lines
2.5 KiB
Python
from .client.session import ClientSession
|
|
from .client.stdio import StdioServerParameters, stdio_client
|
|
from .server.session import ServerSession
|
|
from .server.stdio import stdio_server
|
|
from .shared.exceptions import McpError
|
|
from .types import (
|
|
CallToolRequest,
|
|
ClientCapabilities,
|
|
ClientNotification,
|
|
ClientRequest,
|
|
ClientResult,
|
|
CompleteRequest,
|
|
CreateMessageRequest,
|
|
CreateMessageResult,
|
|
ErrorData,
|
|
GetPromptRequest,
|
|
GetPromptResult,
|
|
Implementation,
|
|
IncludeContext,
|
|
InitializedNotification,
|
|
InitializeRequest,
|
|
InitializeResult,
|
|
JSONRPCError,
|
|
JSONRPCRequest,
|
|
JSONRPCResponse,
|
|
ListPromptsRequest,
|
|
ListPromptsResult,
|
|
ListResourcesRequest,
|
|
ListResourcesResult,
|
|
ListToolsResult,
|
|
LoggingLevel,
|
|
LoggingMessageNotification,
|
|
Notification,
|
|
PingRequest,
|
|
ProgressNotification,
|
|
PromptsCapability,
|
|
ReadResourceRequest,
|
|
ReadResourceResult,
|
|
Resource,
|
|
ResourcesCapability,
|
|
ResourceUpdatedNotification,
|
|
RootsCapability,
|
|
SamplingMessage,
|
|
ServerCapabilities,
|
|
ServerNotification,
|
|
ServerRequest,
|
|
ServerResult,
|
|
SetLevelRequest,
|
|
StopReason,
|
|
SubscribeRequest,
|
|
Tool,
|
|
ToolsCapability,
|
|
UnsubscribeRequest,
|
|
)
|
|
from .types import (
|
|
Role as SamplingRole,
|
|
)
|
|
|
|
__all__ = [
|
|
"CallToolRequest",
|
|
"ClientCapabilities",
|
|
"ClientNotification",
|
|
"ClientRequest",
|
|
"ClientResult",
|
|
"ClientSession",
|
|
"CreateMessageRequest",
|
|
"CreateMessageResult",
|
|
"ErrorData",
|
|
"GetPromptRequest",
|
|
"GetPromptResult",
|
|
"Implementation",
|
|
"IncludeContext",
|
|
"InitializeRequest",
|
|
"InitializeResult",
|
|
"InitializedNotification",
|
|
"JSONRPCError",
|
|
"JSONRPCRequest",
|
|
"ListPromptsRequest",
|
|
"ListPromptsResult",
|
|
"ListResourcesRequest",
|
|
"ListResourcesResult",
|
|
"ListToolsResult",
|
|
"LoggingLevel",
|
|
"LoggingMessageNotification",
|
|
"McpError",
|
|
"Notification",
|
|
"PingRequest",
|
|
"ProgressNotification",
|
|
"PromptsCapability",
|
|
"ReadResourceRequest",
|
|
"ReadResourceResult",
|
|
"ResourcesCapability",
|
|
"ResourceUpdatedNotification",
|
|
"Resource",
|
|
"RootsCapability",
|
|
"SamplingMessage",
|
|
"SamplingRole",
|
|
"ServerCapabilities",
|
|
"ServerNotification",
|
|
"ServerRequest",
|
|
"ServerResult",
|
|
"ServerSession",
|
|
"SetLevelRequest",
|
|
"StdioServerParameters",
|
|
"StopReason",
|
|
"SubscribeRequest",
|
|
"Tool",
|
|
"ToolsCapability",
|
|
"UnsubscribeRequest",
|
|
"stdio_client",
|
|
"stdio_server",
|
|
"CompleteRequest",
|
|
"JSONRPCResponse",
|
|
]
|