@@ -1032,7 +1032,7 @@ async def notify_data_update(resource_uri: str, ctx: Context) -> str:
10321032 # Perform data update logic here
10331033
10341034 # Notify clients that this specific resource changed
1035- await ctx.session.send_resource_updated(AnyUrl( resource_uri) )
1035+ await ctx.session.send_resource_updated(resource_uri)
10361036
10371037 # If this affects the overall resource list, notify about that too
10381038 await ctx.session.send_resource_list_changed()
@@ -1923,8 +1923,6 @@ For servers that need to handle large datasets, the low-level server provides pa
19231923Example of implementing pagination with MCP server decorators.
19241924"""
19251925
1926- from pydantic import AnyUrl
1927-
19281926import mcp.types as types
19291927from mcp.server.lowlevel import Server
19301928
@@ -1949,7 +1947,7 @@ async def list_resources_paginated(request: types.ListResourcesRequest) -> types
19491947
19501948 # Get page of resources
19511949 page_items = [
1952- types.Resource(uri = AnyUrl( f " resource://items/ { item} " ) , name = item, description = f " Description for { item} " )
1950+ types.Resource(uri = f " resource://items/ { item} " , name = item, description = f " Description for { item} " )
19531951 for item in ITEMS [start:end]
19541952 ]
19551953
@@ -2035,8 +2033,6 @@ cd to the `examples/snippets/clients` directory and run:
20352033import asyncio
20362034import os
20372035
2038- from pydantic import AnyUrl
2039-
20402036from mcp import ClientSession, StdioServerParameters, types
20412037from mcp.client.stdio import stdio_client
20422038from mcp.shared.context import RequestContext
@@ -2089,7 +2085,7 @@ async def run():
20892085 print (f " Available tools: { [t.name for t in tools.tools]} " )
20902086
20912087 # Read a resource (greeting resource from fastmcp_quickstart)
2092- resource_content = await session.read_resource(AnyUrl( " greeting://World" ) )
2088+ resource_content = await session.read_resource(" greeting://World" )
20932089 content_block = resource_content.contents[0 ]
20942090 if isinstance (content_block, types.TextContent):
20952091 print (f " Resource content: { content_block.text} " )
@@ -2256,8 +2252,6 @@ cd to the `examples/snippets` directory and run:
22562252import asyncio
22572253from urllib.parse import parse_qs, urlparse
22582254
2259- from pydantic import AnyUrl
2260-
22612255from mcp import ClientSession
22622256from mcp.client.auth import OAuthClientProvider, TokenStorage
22632257from mcp.client.streamable_http import streamablehttp_client
@@ -2304,7 +2298,7 @@ async def main():
23042298 server_url = " http://localhost:8001" ,
23052299 client_metadata = OAuthClientMetadata(
23062300 client_name = " Example MCP Client" ,
2307- redirect_uris = [AnyUrl( " http://localhost:3000/callback" ) ],
2301+ redirect_uris = [" http://localhost:3000/callback" ],
23082302 grant_types = [" authorization_code" , " refresh_token" ],
23092303 response_types = [" code" ],
23102304 scope = " user" ,
0 commit comments