Commit graph typescript-sdk/src/client
Author SHA1 Message Date
Xiao Yijun
f657ead472
fix: retry next endpoint on CORS error during auth server discovery (#827) 2025-08-04 15:43:09 +01:00
Xiao Yijun
bb7cccc3ba
feat: support oidc discovery in client sdk (#652)
Co-authored-by: Paul Carleton <paulc@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-24 14:11:48 +01:00
Jonathan Wang
62c608d8ce
fix: Explicitly declare accpet type to json when exchanging oauth token (#801) 2025-07-24 13:50:54 +01:00
Mason Chen
83168250f5
Fix indent (#807) 2025-07-24 12:49:47 +00:00
Luca Chang
9d2a0aeb7b
fix: consistently use consumer-provided fetch function (#767) 2025-07-17 17:57:54 +01:00
Jesse
16ea27783c
fix(731): StreamableHTTPClientTransport Fails to Reconnect on Non-Resumable Streams (#732) 2025-07-15 17:43:02 +01:00
Jonathan Wang
f3584f2a41
fix: use authorization_server_url as issuer when fetching metadata (#763) 2025-07-14 17:24:10 +01:00
Glen Maddern
4b2ad0385d
Adding invalidateCredentials() to OAuthClientProvider (#570)
Co-authored-by: Paul Carleton <paulc@anthropic.com>
2025-07-14 17:11:52 +01:00
Daniel Kelleher
a9c907dd70
Add prompt=consent for OIDC offline_access scope (#681) 2025-07-14 14:47:09 +01:00
Olivier Chafik
1e32f146c8
Update auth.ts 2025-07-10 14:37:10 +01:00
Olivier Chafik
1b8d63ed6d
add metadataServerUrl to discoverMetadataWithFallback to allow external AS 2025-07-10 14:36:34 +01:00
Olivier Chafik
ea8caa9657
Merge branch 'main' into ochafik/fix-path-as 2025-07-10 14:28:57 +01:00
Inna Harper
442e13b60e
Merge pull request #756 from modelcontextprotocol/patch-1
Fix oauth well-known paths to retain path and query
2025-07-10 14:26:07 +01:00
Olivier Chafik
de1ade29d4
fix unmerge 2025-07-10 14:25:21 +01:00
Olivier Chafik
9ca7fd298f
Merge branch 'main' into ochafik/fix-path-as 2025-07-10 14:20:48 +01:00
ihrpr
5eacdf174c
fallback and refactor 2025-07-10 11:36:57 +01:00
ihrpr
72cb9a700f
add tests 2025-07-10 09:30:12 +01:00
Olivier Chafik
031dfc2835
[auth]: support oauth client_secret_basic / none / custom methods (#720)
* Allow OAuthClientProvider to control authentication to token endpoint w/ addClientAuthentication (exchange / refresh)

* Include mockProvider in exchangeAuthorization tests.

* feature. Add client_secret_basic and none authentication methods

---------

Co-authored-by: Jared Hanson <jaredhanson@gmail.com>
Co-authored-by: SightStudio <sdm3285@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-09 18:31:09 +01:00
Olivier Chafik
c90537703b
Update auth.ts
Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 18:09:23 +01:00
Olivier Chafik
87b453d23f
auth: fetch AS metadata in well-known subpath from serverUrl when PRM returns external AS
Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 17:58:53 +01:00
Felix Weinberger
88ede3783e
Address review feedback: move getDefaultServerParameters to test file
- Moved getDefaultServerParameters from stdio.ts to stdio.test.ts since it's only used in tests
- Reverted unrelated changes to inMemory.ts and inMemory.test.ts
- Kept the core Windows compatibility fix for stdio tests

Co-authored-by: HoberMin <99346635+HoberMin@users.noreply.github.com>
2025-07-08 15:21:09 +01:00
HoberMin
a7dc125850
feat: improve stdio test Windows compatibility and refactor command logic 2025-07-08 15:21:09 +01:00
anthonjn
6ae4a5727c
add custom headers on initial _startOrAuth call (#318)
* add custom headers on initial _startOrAuth call

* update client/sse.ts: align commonHeaders w/ streamableHttp version

---------

Co-authored-by: Olivier Chafik <ochafik@anthropic.com>
2025-07-07 19:54:44 +01:00
ihrpr
0ff7ae09f9
simplify tests 2025-07-07 11:23:32 +01:00
sunrabbit123
d4bfe556bf
fix: format error with merge
Signed-off-by: sunrabbit123 <qudwls185@naver.com>
2025-07-07 18:50:24 +09:00
오병진
4607f37953
Merge branch 'main' into fix/1 2025-07-07 18:45:13 +09:00
Henry Mao
3bdecfc1b9
Update auth.ts 2025-07-07 03:59:06 +08:00
Henry Mao
7b02c5cda3
Retain URL search parameter 2025-07-07 03:56:42 +08:00
Henry Mao
c5fcba4617
Update auth.ts 2025-07-04 11:14:14 +08:00
Henry Mao
abcf91b463
Fix oauth-protected-resource to also be path aware 2025-07-04 11:10:07 +08:00
오병진
f31cefe2fa
Merge branch 'main' into fix/1 2025-07-02 20:24:40 +09:00
cliffhall
f383a9cb8c * In sse.test.ts
- More specific expectations in test "uses custom fetch implementation from options"

* In sse.ts
  - Import FetchLike from transport.ts

* In steramableHttp.ts
  - Import FetchLike from transport.ts
  - Export StartSSEOptions interface for testing

* In streamableHttp.test.ts
  - import StartSSEOptions from streamableHttp.ts
  - use StartSSEOptions instead of any in test "uses custom fetch implementation"

* In transport.ts
  - Add FetchLike function type
2025-07-01 14:00:56 -04:00
Cliff Hall
242c8248f7
Update src/client/streamableHttp.ts
nullish coalescing operator ?? instead of the logical OR operator || to handle the case where this?._eventSourceInit?.fetch or this._fetch might be null or undefined but not falsy

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-01 13:34:04 -04:00
Cliff Hall
7d8c061028
Update src/client/streamableHttp.ts
nullish coalescing operator ?? instead of the logical OR operator || to handle the case where this?._eventSourceInit?.fetch or this._fetch might be null or undefined but not falsy

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-01 13:33:56 -04:00
Cliff Hall
8e02df150e
Update src/client/sse.ts
nullish coalescing operator ?? instead of the logical OR operator || to handle the case where this?._eventSourceInit?.fetch or this._fetch might be null or undefined but not falsy

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-01 13:33:48 -04:00
Cliff Hall
a3c4e28138
Update src/client/streamableHttp.ts
nullish coalescing operator ?? instead of the logical OR operator || to handle the case where this?._eventSourceInit?.fetch or this._fetch might be null or undefined but not falsy

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-01 13:33:39 -04:00
Cliff Hall
3300a43742
Update src/client/sse.ts
nullish coalescing operator ?? instead of the logical OR operator || to handle the case where this?._eventSourceInit?.fetch or this._fetch might be null or undefined but not falsy

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-01 13:33:31 -04:00
Cliff Hall
e5167cbe20 Update streamableHttp custom fetch test 2025-07-01 13:20:28 -04:00
Glen Maddern
6f5e53b44b
Returning undefined from discoverOAuthMetadata for CORS errors (#717)
* Returning undefined from `discoverOAuthMetadata` for CORS errors

This behaviour was already happening for the root URL, but the new `fetchWithCorsRetry` logic differed.

The issue was if the server returns a 404 for `/.well-known/oauth-authorization-server/xyz` that didn't have the `access-control-allow-origin`, a TypeError was being thrown. There was logic there already to handle a TypeError for a _preflight_ request (cause by custom headers), but not the fallback. I refactored so all combinations return `undefined`.

* Add test for CORS error handling that should return undefined

This test covers the scenario where both the initial request with headers
and the retry without headers fail with CORS TypeErrors. The desired
behavior is to return undefined instead of throwing.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix test comment

---------

Co-authored-by: Glen Maddern <glen@glenmaddern.com>
Co-authored-by: Paul Carleton <paulc@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>
2025-07-01 16:24:27 +01:00
ihrpr
0db4407d43
Merge branch 'main' into xiaofhua/pid-StdioClientTransport 2025-06-30 14:44:36 +01:00
sunrabbit123
afb128d8c9
fix: should pass environment variables correctly
Signed-off-by: sunrabbit123 <qudwls185@naver.com>
2025-06-30 13:35:46 +09:00
sunrabbit123
f43bfccf66
test: fix test code for save test case principal
Signed-off-by: sunrabbit123 <qudwls185@naver.com>
2025-06-30 13:33:02 +09:00
오병진
bd61d2149a
Merge branch 'main' into fix/1 2025-06-30 13:20:32 +09:00
Inna Harper
64a60c4ecd
Merge pull request #571 from garciasdos/main
fix: extra headers when they are a Headers object
2025-06-27 17:29:06 +01:00
Felix Weinberger
d54ebee8fe
Merge branch 'main' into hotfix/windows-default-env 2025-06-27 15:50:27 +01:00
Paul Carleton
15a2277c89
refactor resource selection to not include resource if PRM is not present 2025-06-24 14:47:54 +01:00
ihrpr
03da7cfc66
fallback 2025-06-24 11:38:55 +01:00
Henry Mao
1ff08e41d7
Add path test 2025-06-23 17:32:08 -04:00
Henry Mao
6220701352
Fix trailing slash 2025-06-23 17:13:13 -04:00
Henry Mao
da6ac79c1e
Fix missing issuer 2025-06-24 04:41:26 +08:00