Add mcp.types as a permanent alias for mcp_types (#3190)

This commit is contained in:
Max 2026-07-27 23:47:04 +01:00 • committed by GitHub
commit b7c9a916d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 467 additions and 364 deletions

View file

@ -6,6 +6,29 @@ from typing import Annotated, Any, Final, Literal
from pydantic import BaseModel, Field, TypeAdapter
__all__ = [
"CONNECTION_CLOSED",
"HEADER_MISMATCH",
"INTERNAL_ERROR",
"INVALID_PARAMS",
"INVALID_REQUEST",
"JSONRPC_VERSION",
"METHOD_NOT_FOUND",
"MISSING_REQUIRED_CLIENT_CAPABILITY",
"PARSE_ERROR",
"REQUEST_TIMEOUT",
"UNSUPPORTED_PROTOCOL_VERSION",
"URL_ELICITATION_REQUIRED",
"ErrorData",
"JSONRPCError",
"JSONRPCMessage",
"JSONRPCNotification",
"JSONRPCRequest",
"JSONRPCResponse",
"RequestId",
"jsonrpc_message_adapter",
]
RequestId = Annotated[int, Field(strict=True)] | str
"""The ID of a JSON-RPC request."""

View file

@ -9,6 +9,18 @@ ordering questions go through KNOWN_PROTOCOL_VERSIONS.
from typing import Final
__all__ = [
"KNOWN_PROTOCOL_VERSIONS",
"HANDSHAKE_PROTOCOL_VERSIONS",
"MODERN_PROTOCOL_VERSIONS",
"SUPPORTED_PROTOCOL_VERSIONS",
"LATEST_PROTOCOL_VERSION",
"LATEST_HANDSHAKE_VERSION",
"LATEST_MODERN_VERSION",
"OLDEST_SUPPORTED_VERSION",
"is_version_at_least",
]
KNOWN_PROTOCOL_VERSIONS: Final[tuple[str, ...]] = (
"2024-11-05",
"2025-03-26",