@@ -682,7 +682,7 @@ The Context object provides the following capabilities:
682682- ` ctx.session ` - Access to the underlying session for advanced communication (see [ Session Properties and Methods] ( #session-properties-and-methods ) )
683683- ` ctx.request_context ` - Access to request-specific data and lifespan resources (see [ Request Context Properties] ( #request-context-properties ) )
684684- ` await ctx.debug(message) ` - Send debug log message
685- - ` await ctx.info(message) ` - Send info log message
685+ - ` await ctx.info(message) ` - Send info log message
686686- ` await ctx.warning(message) ` - Send warning log message
687687- ` await ctx.error(message) ` - Send error log message
688688- ` await ctx.log(level, message, logger_name=None) ` - Send log with custom level
@@ -1110,13 +1110,13 @@ The session object accessible via `ctx.session` provides advanced control over c
11101110async def notify_data_update (resource_uri : str , ctx : Context) -> str :
11111111 """ Update data and notify clients of the change."""
11121112 # Perform data update logic here
1113-
1113+
11141114 # Notify clients that this specific resource changed
11151115 await ctx.session.send_resource_updated(AnyUrl(resource_uri))
1116-
1116+
11171117 # If this affects the overall resource list, notify about that too
11181118 await ctx.session.send_resource_list_changed()
1119-
1119+
11201120 return f " Updated { resource_uri} and notified clients "
11211121```
11221122
@@ -1145,11 +1145,11 @@ def query_with_config(query: str, ctx: Context) -> str:
11451145 """ Execute a query using shared database and configuration."""
11461146 # Access typed lifespan context
11471147 app_ctx: AppContext = ctx.request_context.lifespan_context
1148-
1148+
11491149 # Use shared resources
11501150 connection = app_ctx.db
11511151 settings = app_ctx.config
1152-
1152+
11531153 # Execute query with configuration
11541154 result = connection.execute(query, timeout = settings.query_timeout)
11551155 return str (result)
@@ -1644,7 +1644,7 @@ from contextlib import asynccontextmanager
16441644from typing import Any
16451645
16461646import mcp.server.stdio
1647- import mcp.types as types
1647+ from mcp import types
16481648from mcp.server.lowlevel import NotificationOptions, Server
16491649from mcp.server.models import InitializationOptions
16501650
@@ -1758,7 +1758,7 @@ uv run examples/snippets/servers/lowlevel/basic.py
17581758import asyncio
17591759
17601760import mcp.server.stdio
1761- import mcp.types as types
1761+ from mcp import types
17621762from mcp.server.lowlevel import NotificationOptions, Server
17631763from mcp.server.models import InitializationOptions
17641764
@@ -1837,7 +1837,7 @@ import asyncio
18371837from typing import Any
18381838
18391839import mcp.server.stdio
1840- import mcp.types as types
1840+ from mcp import types
18411841from mcp.server.lowlevel import NotificationOptions, Server
18421842from mcp.server.models import InitializationOptions
18431843
@@ -1939,7 +1939,7 @@ import asyncio
19391939from typing import Any
19401940
19411941import mcp.server.stdio
1942- import mcp.types as types
1942+ from mcp import types
19431943from mcp.server.lowlevel import NotificationOptions, Server
19441944from mcp.server.models import InitializationOptions
19451945
@@ -2012,7 +2012,7 @@ For servers that need to handle large datasets, the low-level server provides pa
20122012``` python
20132013""" Example of implementing pagination with MCP server decorators."""
20142014
2015- import mcp.types as types
2015+ from mcp import types
20162016from mcp.server.lowlevel import Server
20172017
20182018# Initialize the server
0 commit comments