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: examples/clients/simple-auth-client-client-credentials/README.md
+28-17Lines changed: 28 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,29 @@
1
1
# Simple Auth Client Example
2
2
3
-
A demonstration of how to use the MCP Python SDK with OAuth authentication over streamable HTTP or SSE transport.
3
+
A demonstration of how to use the MCP Python SDK with OAuth authentication using client credentials over streamable HTTP or SSE transport.
4
+
This example demonstrates integration with an authorization server that does not implement Dynamic Client Registration.
4
5
5
6
## Features
6
7
7
-
- OAuth 2.0 authentication with PKCE
8
+
- OAuth 2.0 authentication with the `client_credentials` flow
8
9
- Support for both StreamableHTTP and SSE transports
9
10
- Interactive command-line interface
10
11
11
12
## Installation
12
13
13
14
```bash
14
-
cd examples/clients/simple-auth-client
15
-
uv sync --reinstall
15
+
cd examples/clients/simple-auth-client-client-credentials
16
+
uv sync --reinstall
16
17
```
17
18
18
19
## Usage
19
20
20
-
### 1. Start an MCP server with OAuth support
21
+
### 1. Start an MCP server with OAuth support using client credentials
21
22
22
23
```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
24
+
# Example with mcp-simple-auth-client-credentials
25
+
cd path/to/mcp-simple-auth-client-credentials
26
+
uv run mcp-simple-auth-client-credentials --transport streamable-http --port 3001
26
27
```
27
28
28
29
### 2. Run the client
@@ -39,22 +40,32 @@ MCP_TRANSPORT_TYPE=sse uv run mcp-simple-auth-client
39
40
40
41
### 3. Complete OAuth flow
41
42
42
-
The client will open your browser for authentication. After completing OAuth, you can use commands:
43
+
The client will automatically authenticate using dummy client credentials for the demo authorization server. After completing OAuth, you can use commands:
43
44
44
45
-`list` - List available tools
45
-
-`call <tool_name> [args]` - Call a tool with optional JSON arguments
46
+
-`call <tool_name> [args]` - Call a tool with optional JSON arguments
46
47
-`quit` - Exit
47
48
48
49
## Example
49
50
50
51
```
51
-
🔐 Simple MCP Auth Client
52
-
Connecting to: http://localhost:3001
53
-
54
-
Please visit the following URL to authorize the application:
0 commit comments