22from typing import Annotated , Any , Generic , Literal , TypeAlias , TypeVar
33
44from pydantic import BaseModel , ConfigDict , Field , FileUrl , RootModel
5- from pydantic .networks import AnyUrl , UrlConstraints
65from typing_extensions import deprecated
76
87"""
@@ -431,7 +430,7 @@ class Annotations(BaseModel):
431430class Resource (BaseMetadata ):
432431 """A known resource that the server is capable of reading."""
433432
434- uri : Annotated [ AnyUrl , UrlConstraints ( host_required = False )]
433+ uri : str
435434 """The URI of this resource."""
436435 description : str | None = None
437436 """A description of what this resource represents."""
@@ -502,7 +501,7 @@ class ListResourceTemplatesResult(PaginatedResult):
502501class ReadResourceRequestParams (RequestParams ):
503502 """Parameters for reading a resource."""
504503
505- uri : Annotated [ AnyUrl , UrlConstraints ( host_required = False )]
504+ uri : str
506505 """
507506 The URI of the resource to read. The URI can use any protocol; it is up to the
508507 server how to interpret it.
@@ -520,7 +519,7 @@ class ReadResourceRequest(Request[ReadResourceRequestParams, Literal["resources/
520519class ResourceContents (BaseModel ):
521520 """The contents of a specific resource or sub-resource."""
522521
523- uri : Annotated [ AnyUrl , UrlConstraints ( host_required = False )]
522+ uri : str
524523 """The URI of this resource."""
525524 mimeType : str | None = None
526525 """The MIME type of this resource, if known."""
@@ -570,7 +569,7 @@ class ResourceListChangedNotification(
570569class SubscribeRequestParams (RequestParams ):
571570 """Parameters for subscribing to a resource."""
572571
573- uri : Annotated [ AnyUrl , UrlConstraints ( host_required = False )]
572+ uri : str
574573 """
575574 The URI of the resource to subscribe to. The URI can use any protocol; it is up to
576575 the server how to interpret it.
@@ -591,7 +590,7 @@ class SubscribeRequest(Request[SubscribeRequestParams, Literal["resources/subscr
591590class UnsubscribeRequestParams (RequestParams ):
592591 """Parameters for unsubscribing from a resource."""
593592
594- uri : Annotated [ AnyUrl , UrlConstraints ( host_required = False )]
593+ uri : str
595594 """The URI of the resource to unsubscribe from."""
596595 model_config = ConfigDict (extra = "allow" )
597596
@@ -609,7 +608,7 @@ class UnsubscribeRequest(Request[UnsubscribeRequestParams, Literal["resources/un
609608class ResourceUpdatedNotificationParams (NotificationParams ):
610609 """Parameters for resource update notifications."""
611610
612- uri : Annotated [ AnyUrl , UrlConstraints ( host_required = False )]
611+ uri : str
613612 """
614613 The URI of the resource that has been updated. This might be a sub-resource of the
615614 one that the client actually subscribed to.
0 commit comments