diff --git a/examples/clients/simple-auth-client/mcp_simple_auth_client/main.py b/examples/clients/simple-auth-client/mcp_simple_auth_client/main.py index 6354f2026..7a9e32279 100644 --- a/examples/clients/simple-auth-client/mcp_simple_auth_client/main.py +++ b/examples/clients/simple-auth-client/mcp_simple_auth_client/main.py @@ -81,7 +81,7 @@ def do_GET(self):
Error: {query_params['error'][0]}
+Error: {query_params["error"][0]}
You can close this window and return to the terminal.
diff --git a/examples/fastmcp/memory.py b/examples/fastmcp/memory.py index 0f97babf1..35094ec9c 100644 --- a/examples/fastmcp/memory.py +++ b/examples/fastmcp/memory.py @@ -16,7 +16,7 @@ from dataclasses import dataclass from datetime import datetime, timezone from pathlib import Path -from typing import Annotated, Self +from typing import Annotated, Self, TypeVar import asyncpg import numpy as np @@ -35,6 +35,8 @@ DEFAULT_LLM_MODEL = "openai:gpt-4o" DEFAULT_EMBEDDING_MODEL = "text-embedding-3-small" +T = TypeVar("T") + mcp = FastMCP( "memory", dependencies=[ @@ -57,7 +59,7 @@ def cosine_similarity(a: list[float], b: list[float]) -> float: return np.dot(a_array, b_array) / (np.linalg.norm(a_array) * np.linalg.norm(b_array)) -async def do_ai[T]( +async def do_ai( user_prompt: str, system_prompt: str, result_type: type[T] | Annotated, diff --git a/examples/fastmcp/unicode_example.py b/examples/fastmcp/unicode_example.py index 94ef628bb..bb487f618 100644 --- a/examples/fastmcp/unicode_example.py +++ b/examples/fastmcp/unicode_example.py @@ -8,7 +8,7 @@ mcp = FastMCP() -@mcp.tool(description="🌟 A tool that uses various Unicode characters in its description: " "á é à ó ú ñ æ¼¢å— ðŸŽ‰") +@mcp.tool(description="🌟 A tool that uses various Unicode characters in its description: á é à ó ú ñ æ¼¢å— ðŸŽ‰") def hello_unicode(name: str = "世界", greeting: str = "¡Hola") -> str: """ A simple tool that demonstrates Unicode handling in: diff --git a/examples/servers/simple-auth/mcp_simple_auth/simple_auth_provider.py b/examples/servers/simple-auth/mcp_simple_auth/simple_auth_provider.py index 9ae189b84..aa813b542 100644 --- a/examples/servers/simple-auth/mcp_simple_auth/simple_auth_provider.py +++ b/examples/servers/simple-auth/mcp_simple_auth/simple_auth_provider.py @@ -89,7 +89,7 @@ async def authorize(self, client: OAuthClientInformationFull, params: Authorizat } # Build simple login URL that points to login page - auth_url = f"{self.auth_callback_url}" f"?state={state}" f"&client_id={client.client_id}" + auth_url = f"{self.auth_callback_url}?state={state}&client_id={client.client_id}" return auth_url @@ -117,7 +117,7 @@ async def get_login_page(self, state: str) -> HTMLResponse:Username: demo_user
Password: demo_password