Jerome Swannack
9a1fee379c
refactor: use explicit extensions field instead of spreading kwargs
...
Address PR review feedback: Instead of using **capability_extensions to
spread arbitrary keys into ClientCapabilities, explicitly use the
'extensions' field. This prevents potential conflicts if new fields are
added to ClientCapabilities in the future.
Changes:
- Add 'extensions' field to ClientCapabilities type definition
- Update ClientSession to pass capability_extensions as 'extensions' kwarg
- Update test to pass extensions dict directly (without 'extensions' key wrapper)
2026-01-19 14:38:18 +00:00
Jerome Swannack
9830794ddf
feat(client): Add capability_extensions parameter to ClientSession
...
Add a new `capability_extensions` parameter to `ClientSession.__init__()` that
allows clients to include additional capability fields in the initialize request.
This enables clients to advertise protocol extensions (like `io.modelcontextprotocol/ui`)
without having to override the `initialize()` method.
Example usage:
```python
session = ClientSession(
read_stream,
write_stream,
capability_extensions={
"extensions": {
"io.modelcontextprotocol/ui": {
"mimeTypes": ["text/html;profile=mcp-app"]
}
}
}
)
```
The extensions are merged into `ClientCapabilities` using Pydantic's extra fields
feature (`model_config = {'extra': 'allow'}`).
2026-01-17 10:20:31 +00:00
Felix Weinberger
dcc9b4f8e0
refactor: use Client class in tests ( #1900 )
2026-01-17 09:46:58 +01:00
Felix Weinberger
d41d0c0128
chore: add D212 lint rule to enforce Google-style docstrings ( #1892 )
2026-01-16 16:10:52 +00:00
Felix Weinberger
df039bf97c
Add ergonomic Client class for testing MCP servers ( #1870 )
2026-01-16 15:49:26 +00:00
Max Isbey
5d80f4efc8
refactor: move inline imports to module level ( #1893 )
2026-01-16 14:54:08 +00:00
Marcelo Trylesinski
e94b386a13
refactor: use snake case instead of camel case in types ( #1894 )
2026-01-16 15:51:27 +01:00
Marcelo Trylesinski
812a46ab97
Remove deprecated cursor parameter and ResourceReference ( #1871 )
2026-01-15 21:33:21 +01:00
Marcelo Trylesinski
024d7597fd
Drop Content and args parameter in ClientSessionGroup.call_tool ( #1866 )
2026-01-15 16:24:53 +00:00
jnjpng
a9cc822a10
fix: accept HTTP 201 status code in token exchange ( #1503 )
...
Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com >
2025-12-19 18:22:00 +00:00
V
06748eb4c4
fix: Include extra field for context log ( #1535 )
2025-12-19 17:54:03 +00:00
Yugan
2aa1ad2a69
feat: standardize timeout values to floats in seconds ( #1766 )
2025-12-19 12:22:56 +00:00
Ondrej Mosnáček
65b36de4eb
fix: use correct python command name in test_stdio.py ( #1782 )
...
Main branch checks / checks (push) Failing after 0s
Signed-off-by: Ondrej Mosnáček <omosnacek@gmail.com >
2025-12-12 14:02:38 +00:00
Marcelo Trylesinski
a3a4b8d11a
Add streamable_http_client which accepts httpx.AsyncClient instead of httpx_client_factory ( #1177 )
...
Co-authored-by: Felix Weinberger <fweinberger@anthropic.com >
2025-12-10 16:39:00 +00:00
Jeremiah Lowin
0dedbd9831
feat: client-side support for SEP-1577 sampling with tools ( #1722 )
2025-12-09 23:36:28 +00:00
Max Isbey
8b984d93a3
refactor(auth): remove unused _register_client method ( #1748 )
2025-12-08 21:50:20 +00:00
Felix Weinberger
fa851d93a2
feat: backwards-compatible create_message overloads for SEP-1577 ( #1713 )
2025-12-02 13:17:45 +00:00
Paul Carleton
f82b0c9371
Support client_credentials flow with JWT and Basic auth ( #1663 )
...
Co-authored-by: Claude <noreply@anthropic.com >
Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com >
2025-12-02 12:53:55 +00:00
Paul Carleton
f22501315e
feat: implement SEP-991 URL-based client ID (CIMD) support ( #1652 )
...
Co-authored-by: Claude <noreply@anthropic.com >
Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com >
2025-11-24 17:21:03 +00:00
Jon Shea
c51936f61f
Add client_secret_basic authentication support ( #1334 )
...
Co-authored-by: Paul Carleton <paulc@anthropic.com >
2025-11-20 20:53:37 +00:00
Liang Wu
9c8f763aa8
chore: Lazy import jsonschema library ( #1596 )
...
Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com >
2025-11-19 15:30:52 +00:00
Andrii Blyzniuk
5489e8b6fb
fix get_client_metadata_scopes on 401 ( #1631 )
...
Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com >
2025-11-16 17:18:50 +00:00
inaku
a357380cfa
feat: Pass through and expose additional parameters in ClientSessionGroup.call_tool and .connect_to_server ( #1576 )
2025-11-16 15:57:43 +00:00
Max Isbey
91ccdb3d65
Fix OAuth discovery fallback and URL ordering ( #1624 )
2025-11-13 19:37:24 +00:00
Max Isbey
7d12e83cf4
refactor: extract OAuth helper functions and simplify provider state ( #1586 )
2025-11-13 13:28:48 +00:00
Max Isbey
89e9c43acf
Get baseline 100% clean coverage ( #1553 )
2025-11-11 14:09:32 +01:00
Camila Rondinini
9eae96a05e
Add get_server_capabilities() to ClientSession ( #1588 )
Main branch checks / checks (push) Failing after 0s
2025-11-06 20:44:40 +00:00
Chris Coutinho
3390e49c01
Implement SEP-985: OAuth Protected Resource Metadata discovery fallback ( #1548 )
...
Co-authored-by: Claude <noreply@anthropic.com >
Co-authored-by: Paul Carleton <paulc@anthropic.com >
2025-11-05 15:51:02 +00:00
Luca Chang
f161149680
Implement RFC 7523 JWT flows ( #1247 )
...
Co-authored-by: Yann Jouanin <yann.jouanin@valueandco.com >
2025-10-29 16:48:08 +00:00
Max Isbey
db9e451551
fix: Replace remaining manual server polling with wait_for_server helper ( #1529 )
2025-10-29 11:27:57 +00:00
mingo007
b7e4ae7542
test: use errno.ENOENT for command not found assertion ( #1498 )
2025-10-23 16:30:50 -07:00
Samuel Felipe Chenatti
40acbc596c
Expose RequestParams._meta in ClientSession.call_tool ( #1231 )
...
Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com >
2025-10-17 17:57:56 +01:00
Felix Weinberger
de89457683
fix: send params as empty object for list methods without cursor ( #1453 )
2025-10-14 11:11:38 +01:00
Dogacan Colak
0e29cc4130
[client] Implement MCP OAuth scope selection and step-up authorization ( #1324 )
2025-10-13 14:18:00 +01:00
Peter Alexander
60f4b2d10a
Add comprehensive Unicode tests for streamable HTTP transport ( #1381 )
2025-09-29 14:09:33 +01:00
Sreenath Somarajapuram
07ae8c0d4e
types: Setting default value for method: Literal ( #1292 )
2025-08-26 16:22:56 +01:00
Justin Wang
9c6fd15a88
SDK Parity: Avoid Parsing Server Response for non-JsonRPCMessage Requests ( #1290 )
2025-08-26 16:14:47 +01:00
keurcien
e750a06a99
fix: avoid uncessary retries in OAuth authenticated requests ( #1206 )
...
Co-authored-by: Felix Weinberger <fweinberger@anthropic.com >
2025-08-22 11:45:54 +01:00
David Soria Parra
0926613714
Update dependencies and fix type issues ( #1268 )
...
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com >
2025-08-14 10:40:47 +01:00
Marcelo Trylesinski
c7671e470c
Add pyright strict mode on the whole project ( #1254 )
2025-08-11 18:56:37 +01:00
Luca Chang
35777b9811
fix: perform auth server metadata discovery fallbacks on any 4xx ( #1193 )
Main branch checks / checks (push) Failing after 1s
2025-07-24 11:32:35 +01:00
Clare Liguori
6a84a2f79f
fix: fix OAuth flow request object handling ( #1174 )
Main branch checks / checks (push) Failing after 2s
2025-07-21 13:36:21 +01:00
Luca Chang
99c4f3c906
Support falling back to OIDC metadata for auth ( #1061 )
Main branch checks / checks (push) Failing after 1s
2025-07-17 20:06:38 +01:00
yurikunash
eb5146dc8b
Implement RFC9728 - Support WWW-Authenticate header by MCP client ( #1071 )
2025-07-15 10:23:39 +01:00
Marcelo Trylesinski
95b44fb0d7
tests: use inline_snapshot.Is on parametrized test ( #945 )
...
Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com >
2025-07-14 21:59:37 +01:00
Jeremiah Lowin
81fe63a81d
Ensure failed oauth registration response is read before accessing response.text ( #1118 )
...
Co-authored-by: ihrpr <inna@anthropic.com >
2025-07-10 22:01:17 +01:00
Felix Weinberger
3abefeeeaf
fweinberger/align shutdown with spec ( #1091 )
...
Co-authored-by: davenpi <davenport.ianc@gmail.com >
2025-07-09 10:14:30 -04:00
Felix Weinberger
e0336213e8
Improve child process termination on POSIX & Windows ( #1078 )
...
Co-authored-by: jingx8885 <jingxu8885@qq.com >
Co-authored-by: Surya Prakash Susarla <susarla.surya.prakash.1998@gmail.com >
2025-07-08 15:04:06 +01:00
Felix Weinberger
cf72565d9a
Unify process termination on POSIX & Windows (+ tests) ( #1044 )
...
Co-authored-by: Cristian Pufu <cristian.pufu@uipath.com >
2025-07-08 14:57:39 +01:00
Marcelo Trylesinski
9301924f44
chore: bump ruff ( #1085 )
2025-07-04 09:01:17 +01:00