Skip to content

Commit fe8e693

Browse files
authored
Merge branch 'main' into enum_updates
2 parents 03bcd2c + de2289d commit fe8e693

File tree

39 files changed

+680
-268
lines changed

39 files changed

+680
-268
lines changed

.github/workflows/publish-docs-manually.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: astral-sh/setup-uv@v3
2020
with:
2121
enable-cache: true
22-
version: 0.7.2
22+
version: 0.9.5
2323

2424
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
2525
- uses: actions/cache@v4

.github/workflows/publish-pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: astral-sh/setup-uv@v3
1717
with:
1818
enable-cache: true
19-
version: 0.7.2
19+
version: 0.9.5
2020

2121
- name: Set up Python 3.12
2222
run: uv python install 3.12
@@ -68,7 +68,7 @@ jobs:
6868
uses: astral-sh/setup-uv@v3
6969
with:
7070
enable-cache: true
71-
version: 0.7.2
71+
version: 0.9.5
7272

7373
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
7474
- uses: actions/cache@v4

.github/workflows/shared.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,56 +13,62 @@ jobs:
1313
pre-commit:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717

18-
- uses: astral-sh/setup-uv@v5
18+
- uses: astral-sh/setup-uv@v7
1919
with:
2020
enable-cache: true
21-
version: 0.7.2
22-
21+
version: 0.9.5
2322
- name: Install dependencies
2423
run: uv sync --frozen --all-extras --python 3.10
2524

26-
- uses: pre-commit/[email protected].0
25+
- uses: pre-commit/[email protected].1
2726
with:
2827
extra_args: --all-files --verbose
2928
env:
3029
SKIP: no-commit-to-branch
3130

3231
test:
32+
name: test (${{ matrix.python-version }}, ${{ matrix.dep-resolution.name }}, ${{ matrix.os }})
3333
runs-on: ${{ matrix.os }}
3434
timeout-minutes: 10
3535
continue-on-error: true
3636
strategy:
3737
matrix:
3838
python-version: ["3.10", "3.11", "3.12", "3.13"]
39-
dep-resolution: ["lowest-direct", "highest"]
39+
dep-resolution:
40+
- name: lowest-direct
41+
install-flags: "--resolution lowest-direct"
42+
- name: highest
43+
install-flags: "--frozen"
4044
os: [ubuntu-latest, windows-latest]
4145

4246
steps:
43-
- uses: actions/checkout@v4
47+
- uses: actions/checkout@v5
4448

4549
- name: Install uv
46-
uses: astral-sh/setup-uv@v3
50+
uses: astral-sh/setup-uv@v7
4751
with:
4852
enable-cache: true
49-
version: 0.7.2
53+
version: 0.9.5
5054

5155
- name: Install the project
52-
run: uv sync --frozen --all-extras --python ${{ matrix.python-version }} --resolution ${{ matrix.dep-resolution }}
56+
run: uv sync ${{ matrix.dep-resolution.install-flags }} --all-extras --python ${{ matrix.python-version }}
5357

5458
- name: Run pytest
55-
run: uv run --frozen --no-sync pytest
59+
run: uv run ${{ matrix.dep-resolution.install-flags }} --no-sync pytest
60+
env:
61+
UV_RESOLUTION: ${{ matrix.dep-resolution.name == 'lowest-direct' && 'lowest-direct' || 'highest' }}
5662

5763
readme-snippets:
5864
runs-on: ubuntu-latest
5965
steps:
60-
- uses: actions/checkout@v4
66+
- uses: actions/checkout@v5
6167

62-
- uses: astral-sh/setup-uv@v5
68+
- uses: astral-sh/setup-uv@v7
6369
with:
6470
enable-cache: true
65-
version: 0.7.2
71+
version: 0.9.5
6672

6773
- name: Install dependencies
6874
run: uv sync --frozen --all-extras --python 3.10

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
[protocol-badge]: https://img.shields.io/badge/protocol-modelcontextprotocol.io-blue.svg
8080
[protocol-url]: https://modelcontextprotocol.io
8181
[spec-badge]: https://img.shields.io/badge/spec-spec.modelcontextprotocol.io-blue.svg
82-
[spec-url]: https://spec.modelcontextprotocol.io
82+
[spec-url]: https://modelcontextprotocol.io/specification/latest
8383

8484
## Overview
8585

@@ -2433,7 +2433,7 @@ MCP servers declare capabilities during initialization:
24332433

24342434
- [API Reference](https://modelcontextprotocol.github.io/python-sdk/api/)
24352435
- [Model Context Protocol documentation](https://modelcontextprotocol.io)
2436-
- [Model Context Protocol specification](https://spec.modelcontextprotocol.io)
2436+
- [Model Context Protocol specification](https://modelcontextprotocol.io/specification/latest)
24372437
- [Officially supported servers](https://github.com/modelcontextprotocol/servers)
24382438

24392439
## Contributing

examples/clients/simple-auth-client/mcp_simple_auth_client/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ async def _default_redirect_handler(authorization_url: str) -> None:
187187

188188
# Create OAuth authentication handler using the new interface
189189
oauth_auth = OAuthClientProvider(
190-
server_url=self.server_url.replace("/mcp", ""),
190+
server_url=self.server_url,
191191
client_metadata=OAuthClientMetadata.model_validate(client_metadata_dict),
192192
storage=InMemoryTokenStorage(),
193193
redirect_handler=_default_redirect_handler,

examples/clients/simple-auth-client/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ ignore = []
3939
line-length = 120
4040
target-version = "py310"
4141

42-
[tool.uv]
43-
dev-dependencies = ["pyright>=1.1.379", "pytest>=8.3.3", "ruff>=0.6.9"]
42+
[dependency-groups]
43+
dev = ["pyright>=1.1.379", "pytest>=8.3.3", "ruff>=0.6.9"]

examples/clients/simple-chatbot/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ ignore = []
4444
line-length = 120
4545
target-version = "py310"
4646

47-
[tool.uv]
48-
dev-dependencies = ["pyright>=1.1.379", "pytest>=8.3.3", "ruff>=0.6.9"]
47+
[dependency-groups]
48+
dev = ["pyright>=1.1.379", "pytest>=8.3.3", "ruff>=0.6.9"]

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ async def get_client(self, client_id: str) -> OAuthClientInformationFull | None:
7373

7474
async def register_client(self, client_info: OAuthClientInformationFull):
7575
"""Register a new OAuth client."""
76+
if not client_info.client_id:
77+
raise ValueError("No client_id provided")
7678
self.clients[client_info.client_id] = client_info
7779

7880
async def authorize(self, client: OAuthClientInformationFull, params: AuthorizationParams) -> str:
@@ -209,6 +211,8 @@ async def exchange_authorization_code(
209211
"""Exchange authorization code for tokens."""
210212
if authorization_code.code not in self.auth_codes:
211213
raise ValueError("Invalid authorization code")
214+
if not client.client_id:
215+
raise ValueError("No client_id provided")
212216

213217
# Generate MCP access token
214218
mcp_token = f"mcp_{secrets.token_hex(32)}"

examples/servers/simple-auth/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ build-backend = "hatchling.build"
2929
[tool.hatch.build.targets.wheel]
3030
packages = ["mcp_simple_auth"]
3131

32-
[tool.uv]
33-
dev-dependencies = ["pyright>=1.1.391", "pytest>=8.3.4", "ruff>=0.8.5"]
32+
[dependency-groups]
33+
dev = ["pyright>=1.1.391", "pytest>=8.3.4", "ruff>=0.8.5"]

examples/servers/simple-pagination/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ ignore = []
4343
line-length = 120
4444
target-version = "py310"
4545

46-
[tool.uv]
47-
dev-dependencies = ["pyright>=1.1.378", "pytest>=8.3.3", "ruff>=0.6.9"]
46+
[dependency-groups]
47+
dev = ["pyright>=1.1.378", "pytest>=8.3.3", "ruff>=0.6.9"]

0 commit comments

Comments
 (0)