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: CONTRIBUTING.md
+56-3Lines changed: 56 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,43 @@
2
2
3
3
Thank you for your interest in contributing to the MCP Python SDK! This document provides guidelines and instructions for contributing.
4
4
5
+
## Before You Start
6
+
7
+
We welcome contributions! These guidelines exist to save everyone time, yours included. Following them means your work is more likely to be accepted.
8
+
9
+
**All pull requests require a corresponding issue.** Unless your change is trivial (typo, docs tweak, broken link), create an issue first. Every merged feature becomes ongoing maintenance, so we need to agree something is worth doing before reviewing code. PRs without a linked issue will be closed.
10
+
11
+
Having an issue doesn't guarantee acceptance. Wait for maintainer feedback or a `ready for work` label before starting. PRs for issues without buy-in may also be closed.
12
+
13
+
Use issues to validate your idea before investing time in code. PRs are for execution, not exploration.
14
+
15
+
### The SDK is Opinionated
16
+
17
+
Not every contribution will be accepted, even with a working implementation. We prioritize maintainability and consistency over adding capabilities. This is at maintainers' discretion.
18
+
19
+
### What Needs Discussion
20
+
21
+
These always require an issue first:
22
+
23
+
- New public APIs or decorators
24
+
- Architectural changes or refactoring
25
+
- Changes that touch multiple modules
26
+
- Features that might require spec changes (these need a [SEP](https://github.com/modelcontextprotocol/modelcontextprotocol) first)
27
+
28
+
Bug fixes for clear, reproducible issues are welcome—but still create an issue to track the fix.
29
+
30
+
### Finding Issues to Work On
31
+
32
+
| Label | For | Description |
33
+
|-------|-----|-------------|
34
+
|[`good first issue`](https://github.com/modelcontextprotocol/python-sdk/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)| Newcomers | Can tackle without deep codebase knowledge |
35
+
|[`help wanted`](https://github.com/modelcontextprotocol/python-sdk/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)| Experienced contributors | Maintainers probably won't get to this |
36
+
|[`ready for work`](https://github.com/modelcontextprotocol/python-sdk/issues?q=is%3Aopen+is%3Aissue+label%3A%22ready+for+work%22)| Maintainers | Triaged and ready for a maintainer to pick up |
37
+
38
+
Issues labeled `needs confirmation` or `needs maintainer action` are **not** ready for work—wait for maintainer input first.
39
+
40
+
Before starting, comment on the issue so we can assign it to you. This prevents duplicate effort.
41
+
5
42
## Development Setup
6
43
7
44
1. Make sure you have Python 3.10+ installed
@@ -76,13 +113,29 @@ pre-commit run --all-files
76
113
- Add type hints to all functions
77
114
- Include docstrings for public APIs
78
115
79
-
## Pull Request Process
116
+
## Pull Requests
117
+
118
+
By the time you open a PR, the "what" and "why" should already be settled in an issue. This keeps reviews focused on implementation.
119
+
120
+
### Scope
121
+
122
+
Small PRs get reviewed fast. Large PRs sit in the queue.
123
+
124
+
A few dozen lines can be reviewed in minutes. Hundreds of lines across many files takes real effort and things slip through. If your change is big, break it into smaller PRs or get alignment from a maintainer first.
125
+
126
+
### What Gets Rejected
127
+
128
+
-**No prior discussion**: Features or significant changes without an approved issue
129
+
-**Scope creep**: Changes that go beyond what was discussed
130
+
-**Misalignment**: Even well-implemented features may be rejected if they don't fit the SDK's direction
131
+
-**Overengineering**: Unnecessary complexity for simple problems
Copy file name to clipboardExpand all lines: examples/clients/simple-auth-client/README.md
+45-21Lines changed: 45 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,63 +12,87 @@ A demonstration of how to use the MCP Python SDK with OAuth authentication over
12
12
13
13
```bash
14
14
cd examples/clients/simple-auth-client
15
-
uv sync --reinstall
15
+
uv sync --reinstall
16
16
```
17
17
18
18
## Usage
19
19
20
20
### 1. Start an MCP server with OAuth support
21
21
22
+
The simple-auth server example provides three server configurations. See [examples/servers/simple-auth/README.md](../../servers/simple-auth/README.md) for full details.
23
+
24
+
#### Option A: New Architecture (Recommended)
25
+
26
+
Separate Authorization Server and Resource Server:
27
+
28
+
```bash
29
+
# Terminal 1: Start Authorization Server on port 9000
30
+
cd examples/servers/simple-auth
31
+
uv run mcp-simple-auth-as --port=9000
32
+
33
+
# Terminal 2: Start Resource Server on port 8001
34
+
cd examples/servers/simple-auth
35
+
uv run mcp-simple-auth-rs --port=8001 --auth-server=http://localhost:9000 --transport=streamable-http
36
+
```
37
+
38
+
#### Option B: Legacy Server (Backwards Compatibility)
39
+
22
40
```bash
23
-
#Example with mcp-simple-auth
24
-
cdpath/to/mcp-simple-auth
25
-
uv run mcp-simple-auth --transport streamable-http --port 3001
41
+
#Single server that acts as both AS and RS (port 8000)
42
+
cdexamples/servers/simple-auth
43
+
uv run mcp-simple-auth-legacy --port=8000 --transport=streamable-http
26
44
```
27
45
28
46
### 2. Run the client
29
47
30
48
```bash
31
-
uv run mcp-simple-auth-client
49
+
# Connect to Resource Server (new architecture, default port 8001)
50
+
MCP_SERVER_PORT=8001 uv run mcp-simple-auth-client
32
51
33
-
#Or with custom server URL
34
-
MCP_SERVER_PORT=3001 uv run mcp-simple-auth-client
52
+
#Connect to Legacy Server (port 8000)
53
+
uv run mcp-simple-auth-client
35
54
36
55
# Use SSE transport
37
-
MCP_TRANSPORT_TYPE=sse uv run mcp-simple-auth-client
56
+
MCP_SERVER_PORT=8001 MCP_TRANSPORT_TYPE=sse uv run mcp-simple-auth-client
38
57
```
39
58
40
59
### 3. Complete OAuth flow
41
60
42
61
The client will open your browser for authentication. After completing OAuth, you can use commands:
43
62
44
63
-`list` - List available tools
45
-
-`call <tool_name> [args]` - Call a tool with optional JSON arguments
64
+
-`call <tool_name> [args]` - Call a tool with optional JSON arguments
46
65
-`quit` - Exit
47
66
48
67
## Example
49
68
50
69
```markdown
51
-
🔐 Simple MCP Auth Client
52
-
Connecting to: http://localhost:3001
70
+
🚀 Simple MCP Auth Client
71
+
Connecting to: http://localhost:8001/mcp
72
+
Transport type: streamable-http
53
73
54
-
Please visit the following URL to authorize the application:
0 commit comments