@@ -6,16 +6,36 @@ See [the documentation](https://mcp-auth.dev/docs) for the full guide.
66
77## Prerequisites
88
9+ ### Virtual environment setup
10+
11+ First, navigate to the project root directory and set up a virtual environment:
12+
13+ ``` bash
14+ # Navigate to the project root directory (one level up from samples)
15+ cd ..
16+
17+ # Create a new virtual environment using uv
18+ uv venv
19+
20+ # Activate the virtual environment (optional when using 'uv run')
21+ source .venv/bin/activate
22+ ```
23+
924### Install dependencies
1025
11- First, install the required dependencies:
26+ Install the required dependencies using uv :
1227
1328``` bash
14- # Install production dependencies
15- pip install -e .
29+ # Make sure you are in the project root directory (where pyproject.toml is located)
30+ # Install the project in development mode
31+ uv pip install -e .
1632
1733# Install development dependencies (optional, for development and testing)
18- pip install -e " .[dev]"
34+ uv pip install -e " .[dev]"
35+
36+ # Alternative: Traditional pip method (after activating virtual environment)
37+ # pip install -e .
38+ # pip install -e ".[dev]"
1939```
2040
2141### Environment setup
@@ -27,7 +47,7 @@ Set up the required environment variable:
2747export MCP_AUTH_ISSUER=< your_auth_issuer_url>
2848```
2949
30- ## Directory Structure
50+ ## Directory structure
3151
3252- ` current/ ` : Latest sample implementations (MCP server as resource server)
3353- ` v0_1_1/ ` : Legacy sample implementations (MCP server as authorization server)
@@ -48,8 +68,8 @@ To run the Todo Manager server:
4868# Make sure you are in the samples directory first
4969cd samples
5070
51- # Start the Todo Manager server
52- uvicorn current.todo-manager.server:app --host 0 .0.0.0 --port 3001
71+ # Start the Todo Manager server using uv
72+ uv run uvicorn current.todo-manager.server:app --host 127 .0.0.1 --port 3001
5373```
5474
5575## Legacy examples (v0.1.1)
@@ -63,12 +83,13 @@ A simple server that demonstrates basic authentication. It provides a single too
6383- ` whoami ` : Returns the authenticated user's information
6484
6585To run the WhoAmI server:
86+
6687``` bash
6788# Make sure you are in the samples directory first
6889cd samples
6990
70- # Start the WhoAmI server
71- uvicorn v0_1_1.whoami:app --host 0 .0.0.0 --port 3001
91+ # Start the WhoAmI server using uv
92+ uv run uvicorn v0_1_1.whoami:app --host 127 .0.0.1 --port 3001
7293```
7394
7495### Todo Manager MCP server (legacy)
@@ -80,10 +101,11 @@ Legacy version of the todo manager that acts as both authorization and resource
80101- ` delete-todo ` : Delete a todo (requires ` delete:todos ` scope for others' todos)
81102
82103To run the legacy Todo Manager server:
104+
83105``` bash
84106# Make sure you are in the samples directory first
85107cd samples
86108
87- # Start the legacy Todo Manager server
88- uvicorn v0_1_1.todo-manager.server:app --host 0 .0.0.0 --port 3001
109+ # Start the legacy Todo Manager server using uv
110+ uv run uvicorn v0_1_1.todo-manager.server:app --host 127 .0.0.1 --port 3001
89111```
0 commit comments