Skip to content

Commit bfcbf6f

Browse files
author
Agasthya Kasturi
committed
resolve conflicts
2 parents 543e86c + 70014a2 commit bfcbf6f

File tree

123 files changed

+15662
-402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+15662
-402
lines changed

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

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

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

.github/workflows/publish-pypi.yml

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

2021
- name: Set up Python 3.12
2122
run: uv python install 3.12
@@ -67,6 +68,7 @@ jobs:
6768
uses: astral-sh/setup-uv@v3
6869
with:
6970
enable-cache: true
71+
version: 0.7.2
7072

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

.github/workflows/shared.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
uses: astral-sh/setup-uv@v3
1414
with:
1515
enable-cache: true
16+
version: 0.7.2
1617

1718
- name: Install the project
1819
run: uv sync --frozen --all-extras --dev --python 3.12
@@ -29,6 +30,7 @@ jobs:
2930
uses: astral-sh/setup-uv@v3
3031
with:
3132
enable-cache: true
33+
version: 0.7.2
3234

3335
- name: Install the project
3436
run: uv sync --frozen --all-extras --dev --python 3.12
@@ -37,10 +39,11 @@ jobs:
3739
run: uv run --no-sync pyright
3840

3941
test:
40-
runs-on: ubuntu-latest
42+
runs-on: ${{ matrix.os }}
4143
strategy:
4244
matrix:
4345
python-version: ["3.10", "3.11", "3.12", "3.13"]
46+
os: [ubuntu-latest, windows-latest]
4447

4548
steps:
4649
- uses: actions/checkout@v4
@@ -49,9 +52,11 @@ jobs:
4952
uses: astral-sh/setup-uv@v3
5053
with:
5154
enable-cache: true
55+
version: 0.7.2
5256

5357
- name: Install the project
5458
run: uv sync --frozen --all-extras --dev --python ${{ matrix.python-version }}
5559

5660
- name: Run pytest
5761
run: uv run --no-sync pytest
62+
continue-on-error: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,5 @@ cython_debug/
166166

167167
# vscode
168168
.vscode/
169+
.windsurfrules
169170
**/CLAUDE.local.md

.pre-commit-config.yaml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,29 @@ repos:
77
- id: prettier
88
types_or: [yaml, json5]
99

10-
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: v0.8.1
10+
- repo: local
1211
hooks:
1312
- id: ruff-format
13+
name: Ruff Format
14+
entry: uv run ruff
15+
args: [format]
16+
language: system
17+
types: [python]
18+
pass_filenames: false
1419
- id: ruff
15-
args: [--fix, --exit-non-zero-on-fix]
16-
17-
- repo: local
18-
hooks:
20+
name: Ruff
21+
entry: uv run ruff
22+
args: ["check", "--fix", "--exit-non-zero-on-fix"]
23+
types: [python]
24+
language: system
25+
pass_filenames: false
26+
- id: pyright
27+
name: pyright
28+
entry: uv run pyright
29+
args: [src]
30+
language: system
31+
types: [python]
32+
pass_filenames: false
1933
- id: uv-lock-check
2034
name: Check uv.lock is up to date
2135
entry: uv lock --check

CLAUDE.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This document contains critical information about working with this codebase. Fo
1919
- Line length: 88 chars maximum
2020

2121
3. Testing Requirements
22-
- Framework: `uv run pytest`
22+
- Framework: `uv run --frozen pytest`
2323
- Async testing: use anyio, not asyncio
2424
- Coverage: test edge cases and errors
2525
- New features require tests
@@ -54,9 +54,9 @@ This document contains critical information about working with this codebase. Fo
5454
## Code Formatting
5555

5656
1. Ruff
57-
- Format: `uv run ruff format .`
58-
- Check: `uv run ruff check .`
59-
- Fix: `uv run ruff check . --fix`
57+
- Format: `uv run --frozen ruff format .`
58+
- Check: `uv run --frozen ruff check .`
59+
- Fix: `uv run --frozen ruff check . --fix`
6060
- Critical issues:
6161
- Line length (88 chars)
6262
- Import sorting (I001)
@@ -67,7 +67,7 @@ This document contains critical information about working with this codebase. Fo
6767
- Imports: split into multiple lines
6868

6969
2. Type Checking
70-
- Tool: `uv run pyright`
70+
- Tool: `uv run --frozen pyright`
7171
- Requirements:
7272
- Explicit None checks for Optional
7373
- Type narrowing for strings
@@ -104,6 +104,10 @@ This document contains critical information about working with this codebase. Fo
104104
- Add None checks
105105
- Narrow string types
106106
- Match existing patterns
107+
- Pytest:
108+
- If the tests aren't finding the anyio pytest mark, try adding PYTEST_DISABLE_PLUGIN_AUTOLOAD=""
109+
to the start of the pytest run command eg:
110+
`PYTEST_DISABLE_PLUGIN_AUTOLOAD="" uv run --frozen pytest`
107111

108112
3. Best Practices
109113
- Check git status before commits
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Simple Auth Client Example
2+
3+
A demonstration of how to use the MCP Python SDK with OAuth authentication over streamable HTTP or SSE transport.
4+
5+
## Features
6+
7+
- OAuth 2.0 authentication with PKCE
8+
- Support for both StreamableHTTP and SSE transports
9+
- Interactive command-line interface
10+
11+
## Installation
12+
13+
```bash
14+
cd examples/clients/simple-auth-client
15+
uv sync --reinstall
16+
```
17+
18+
## Usage
19+
20+
### 1. Start an MCP server with OAuth support
21+
22+
```bash
23+
# Example with mcp-simple-auth
24+
cd path/to/mcp-simple-auth
25+
uv run mcp-simple-auth --transport streamable-http --port 3001
26+
```
27+
28+
### 2. Run the client
29+
30+
```bash
31+
uv run mcp-simple-auth-client
32+
33+
# Or with custom server URL
34+
MCP_SERVER_PORT=3001 uv run mcp-simple-auth-client
35+
36+
# Use SSE transport
37+
MCP_TRANSPORT_TYPE=sse uv run mcp-simple-auth-client
38+
```
39+
40+
### 3. Complete OAuth flow
41+
42+
The client will open your browser for authentication. After completing OAuth, you can use commands:
43+
44+
- `list` - List available tools
45+
- `call <tool_name> [args]` - Call a tool with optional JSON arguments
46+
- `quit` - Exit
47+
48+
## Example
49+
50+
```
51+
🔐 Simple MCP Auth Client
52+
Connecting to: http://localhost:3001
53+
54+
Please visit the following URL to authorize the application:
55+
http://localhost:3001/authorize?response_type=code&client_id=...
56+
57+
✅ Connected to MCP server at http://localhost:3001
58+
59+
mcp> list
60+
📋 Available tools:
61+
1. echo - Echo back the input text
62+
63+
mcp> call echo {"text": "Hello, world!"}
64+
🔧 Tool 'echo' result:
65+
Hello, world!
66+
67+
mcp> quit
68+
👋 Goodbye!
69+
```
70+
71+
## Configuration
72+
73+
- `MCP_SERVER_PORT` - Server URL (default: 8000)
74+
- `MCP_TRANSPORT_TYPE` - Transport type: `streamable_http` (default) or `sse`
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Simple OAuth client for MCP simple-auth server."""

0 commit comments

Comments
 (0)