You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/mcp-fastmcp/examples/delegated_access/README.md
+14-8Lines changed: 14 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,27 +96,30 @@ Use the public URL from your tunnel as `MCP_SERVER_URL`.
96
96
### 2. Set Environment Variables
97
97
98
98
```bash
99
-
export KEYCARD_ZONE_ID="your-zone-id"
99
+
export KEYCARD_ZONE_ID="your-zone-id"# or use KEYCARD_ZONE_URL
100
100
export KEYCARD_CLIENT_ID="your-client-id"
101
101
export KEYCARD_CLIENT_SECRET="your-client-secret"
102
102
export MCP_SERVER_URL="https://your-tunnel-url.ngrok.io/"# Must be publicly reachable
103
103
```
104
104
105
-
### 3. Install Dependencies
105
+
### 3. Install Dependencies and Run the Server
106
106
107
107
```bash
108
108
cd packages/mcp-fastmcp/examples/delegated_access
109
109
uv sync
110
-
```
111
-
112
-
### 4. Run the Server
113
-
114
-
```bash
115
110
uv run python main.py
116
111
```
117
112
118
113
The server will start on `http://localhost:8000`.
119
114
115
+
> **Local SDK development:** If you're working on the Keycard SDK packages locally and want to run this example against your local changes, run from the repository root instead:
116
+
>
117
+
> ```bash
118
+
> uv run --package delegated-access-example python packages/mcp-fastmcp/examples/delegated_access/main.py
119
+
>```
120
+
>
121
+
> This uses the root workspace to resolve all SDK packages from source.
122
+
120
123
### 5. Verify the Server
121
124
122
125
Check that OAuth metadata is being served:
@@ -176,11 +179,14 @@ The example demonstrates comprehensive error handling patterns:
176
179
177
180
| Variable | Required | Description |
178
181
|----------|----------|-------------|
179
-
|`KEYCARD_ZONE_ID`| Yes | Your Keycard zone ID |
182
+
|`KEYCARD_ZONE_ID`| Yes*| Your Keycard zone ID |
183
+
|`KEYCARD_ZONE_URL`| Yes*| Your full Keycard zone URL (alternative to `KEYCARD_ZONE_ID`) |
180
184
|`KEYCARD_CLIENT_ID`| Yes | Client ID from application credentials |
181
185
|`KEYCARD_CLIENT_SECRET`| Yes | Client secret from application credentials |
182
186
|`MCP_SERVER_URL`| Yes | Server URL (must be publicly reachable for delegated access) |
183
187
188
+
\* Provide either `KEYCARD_ZONE_ID` or `KEYCARD_ZONE_URL`, not both.
0 commit comments