@@ -92,15 +92,15 @@ def echo(message: str) -> str:
9292 return mcp , app
9393
9494
95- def make_comprehensive_fastmcp () -> FastMCP :
95+ def make_everything_fastmcp () -> FastMCP :
9696 """Create a FastMCP server with all features enabled for testing."""
9797 from mcp .server .fastmcp import Context
9898
99- mcp = FastMCP (name = "AllFeaturesServer " )
99+ mcp = FastMCP (name = "EverythingServer " )
100100
101101 # Tool with context for logging and progress
102102 @mcp .tool (description = "A tool that demonstrates logging and progress" )
103- async def tool_with_context (message : str , ctx : Context , steps : int = 3 ) -> str :
103+ async def tool_with_progress (message : str , ctx : Context , steps : int = 3 ) -> str :
104104 await ctx .info (f"Starting processing of '{ message } ' with { steps } steps" )
105105
106106 # Send progress notifications
@@ -139,8 +139,8 @@ async def sampling_tool(prompt: str, ctx: Context) -> str:
139139 )
140140
141141 await ctx .info (f"Received sampling result from model: { result .model } " )
142- # Handle different content types safely
143- if hasattr ( result .content , "text" ) :
142+ # Handle different content types
143+ if result .content . type == "text" :
144144 return f"Sampling result: { result .content .text [:100 ]} ..."
145145 else :
146146 return f"Sampling result: { str (result .content )[:100 ]} ..."
@@ -201,11 +201,11 @@ def complex_prompt(user_query: str, context: str = "general") -> str:
201201 return mcp
202202
203203
204- def make_comprehensive_fastmcp_app ():
204+ def make_everything_fastmcp_app ():
205205 """Create a comprehensive FastMCP server with SSE transport."""
206206 from starlette .applications import Starlette
207207
208- mcp = make_comprehensive_fastmcp ()
208+ mcp = make_everything_fastmcp ()
209209 # Create the SSE app
210210 app : Starlette = mcp .sse_app ()
211211 return mcp , app
@@ -228,12 +228,12 @@ def echo(message: str) -> str:
228228 return mcp , app
229229
230230
231- def make_comprehensive_fastmcp_streamable_http_app ():
231+ def make_everything_fastmcp_streamable_http_app ():
232232 """Create a comprehensive FastMCP server with StreamableHTTP transport."""
233233 from starlette .applications import Starlette
234234
235235 # Create a new instance with different name for HTTP transport
236- mcp = make_comprehensive_fastmcp ()
236+ mcp = make_everything_fastmcp ()
237237 # We can't change the name after creation, so we'll use the same name
238238 # Create the StreamableHTTP app
239239 app : Starlette = mcp .streamable_http_app ()
@@ -271,7 +271,7 @@ def run_server(server_port: int) -> None:
271271
272272def run_comprehensive_server (server_port : int ) -> None :
273273 """Run the comprehensive server with all features."""
274- _ , app = make_comprehensive_fastmcp_app ()
274+ _ , app = make_everything_fastmcp_app ()
275275 server = uvicorn .Server (
276276 config = uvicorn .Config (
277277 app = app , host = "127.0.0.1" , port = server_port , log_level = "error"
@@ -295,7 +295,7 @@ def run_streamable_http_server(server_port: int) -> None:
295295
296296def run_comprehensive_streamable_http_server (server_port : int ) -> None :
297297 """Run the comprehensive StreamableHTTP server with all features."""
298- _ , app = make_comprehensive_fastmcp_streamable_http_app ()
298+ _ , app = make_everything_fastmcp_streamable_http_app ()
299299 server = uvicorn .Server (
300300 config = uvicorn .Config (
301301 app = app , host = "127.0.0.1" , port = server_port , log_level = "error"
@@ -705,7 +705,7 @@ def progress_callback(
705705 "steps" : 3 ,
706706 }
707707 tool_result = await session .call_tool (
708- "tool_with_context " ,
708+ "tool_with_progress " ,
709709 params ,
710710 progress_callback = progress_callback ,
711711 )
@@ -922,7 +922,7 @@ def progress_callback_http(
922922 print (f"HTTP Progress: { progress } /{ total } - { message } " )
923923
924924 await session .call_tool (
925- "tool_with_context " ,
925+ "tool_with_progress " ,
926926 {
927927 "message" : "http_test" ,
928928 "steps" : 2 ,
0 commit comments