Skip to content

Commit c752b0e

Browse files
committed
Remove the examples' pydantic-settings usage instead of carrying the dependency
pydantic-settings was left in the dev group only because two examples used it. The text_me example needs a paid third-party SMS account to run and nothing references or tests it, so delete it. The simple-auth example's two settings classes are always constructed with explicit values or defaults, so plain pydantic models do the same job; drop pydantic-settings from that example's dependencies and from the root dev group.
1 parent e989e6e commit c752b0e

6 files changed

Lines changed: 4 additions & 99 deletions

File tree

examples/mcpserver/text_me.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

examples/servers/simple-auth/mcp_simple_auth/server.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
from typing import Any, Literal
1313

1414
import click
15-
from pydantic import AnyHttpUrl
16-
from pydantic_settings import BaseSettings, SettingsConfigDict
15+
from pydantic import AnyHttpUrl, BaseModel
1716

1817
from mcp.server.auth.settings import AuthSettings
1918
from mcp.server.mcpserver.server import MCPServer
@@ -23,11 +22,9 @@
2322
logger = logging.getLogger(__name__)
2423

2524

26-
class ResourceServerSettings(BaseSettings):
25+
class ResourceServerSettings(BaseModel):
2726
"""Settings for the MCP Resource Server."""
2827

29-
model_config = SettingsConfigDict(env_prefix="MCP_RESOURCE_")
30-
3128
# Server settings
3229
host: str = "localhost"
3330
port: int = 8001

examples/servers/simple-auth/mcp_simple_auth/simple_auth_provider.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
import time
1313
from typing import Any
1414

15-
from pydantic import AnyHttpUrl
16-
from pydantic_settings import BaseSettings, SettingsConfigDict
15+
from pydantic import AnyHttpUrl, BaseModel
1716
from starlette.exceptions import HTTPException
1817
from starlette.requests import Request
1918
from starlette.responses import HTMLResponse, RedirectResponse, Response
@@ -29,11 +28,9 @@
2928
from mcp.shared.auth import OAuthClientInformationFull, OAuthToken
3029

3130

32-
class SimpleAuthSettings(BaseSettings):
31+
class SimpleAuthSettings(BaseModel):
3332
"""Simple OAuth settings for demo purposes."""
3433

35-
model_config = SettingsConfigDict(env_prefix="MCP_")
36-
3734
# Demo user credentials
3835
demo_username: str = "demo_user"
3936
demo_password: str = "demo_password"

examples/servers/simple-auth/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ dependencies = [
1212
"httpx2>=2.5.0",
1313
"mcp",
1414
"pydantic>=2.0",
15-
"pydantic-settings>=2.5.2",
1615
"sse-starlette>=1.6.1",
1716
"uvicorn>=0.23.1; sys_platform != 'emscripten'",
1817
]

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ dev = [
5858
# We add mcp[cli] so `uv sync` considers the extras.
5959
"mcp[cli]",
6060
"mcp-example-stories",
61-
# pydantic-settings is used only by examples (simple-auth, mcpserver/text_me);
62-
# keep it reachable for pyright, which covers examples/servers.
63-
"pydantic-settings>=2.5.2",
6461
"tomli>=2.0; python_version < '3.11'",
6562
"pyright>=1.1.400",
6663
"pytest>=8.4.0",

uv.lock

Lines changed: 0 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)