Commit graph typescript-sdk/src/client/streamableHttp.ts
Author SHA1 Message Date
David Soria Parra
df56e35322
fix: Pass RequestInit options to auth requests (#1066)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>
2025-11-17 16:06:21 +00:00
Matt
11f04e1b0b
Check script which typechecks using Typescripts new Go port (#1075) 2025-11-06 18:23:37 +00:00
Chip
ee9fed28cc
fix: Support WWW-Authenticate scope param for SEP-835 (#983)
Co-authored-by: OtotheA <oscar@otothea.com>
2025-11-03 15:24:42 +00:00
Inna Harper
1150b1d843
run prettier (#995) 2025-10-02 18:21:00 +01:00
Arjun Kumar
7146eede0b
fix: prevent infinite recursion when server throws 401 after successful authentication (#945)
Co-authored-by: Vinicius Costa <viniciuscsouza@yahoo.com.br>
Co-authored-by: Tyler James Leonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Co-authored-by: Blust.AI <159488814+blustAI@users.noreply.github.com>
Co-authored-by: Eugene <eugene@blust.ai>
2025-09-27 17:40:59 +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
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
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
e5167cbe20 Update streamableHttp custom fetch test 2025-07-01 13:20:28 -04: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
Olivier Chafik
33257f14d4
switch to optional Transport.setProtocolVersion 2025-06-13 13:36:04 +01:00
Olivier Chafik
e573a0f342
nits: remove dead comment & align test style on local idioms 2025-06-12 18:43:49 +01:00
Olivier Chafik
84971c83ea
Set Mcp-Protocol-Version in client requests after init, and warn when it doesn't match negotiated version (it SHOULD match) 2025-06-11 17:29:09 +01:00
Diego García
be063e4bb8
fix: extra Headers when they are a Headers object 2025-05-30 16:05:05 +02:00
Itsuki
69dbfac0e4
Feat: Separate authorization server and resource server on client auth flow (#416)
* add type and schema for protected resource metadata

* add private variable to keep track of
authorization server url to avoid fetching Protected Resource Metadata every time

* change auth flow to use authroization server and
add function to discover protected resource metadata

* add/modify tests for new added auth functions

* modify test to use the authorization server

* remove unused variable

* add resource parameter when building auth url

* Change resource to use the protected resource metadata

* resolve typo.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* Update src/client/sse.ts import.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove log.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* Update section title.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove log.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* make backwards compatibile

* s/resourceServerUrl/serverUrl/g for backwards compat

* fix test comment

---------

Co-authored-by: itsuki <itsuki.enjyoy@gmail.com>
Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>
Co-authored-by: Paul Carleton <paulc@anthropic.com>
2025-05-21 14:55:38 +01:00
ihrpr
5dba9477ff
small fixes after suggested changes 2025-04-17 17:34:15 +01:00
ihrpr
c053c2e97d
handle session termination 2025-04-16 11:56:28 +01:00
ihrpr
585dc06708
introduce onsessioninitialized to avoid race conditions 2025-04-16 11:09:47 +01:00
ihrpr
31f44e0b68
add isInitializeRequest and isInitializedNotification utility 2025-04-16 10:19:46 +01:00
ihrpr
8bc49f9f34
change names to resumptionToken instead of last event id 2025-04-15 22:06:10 +01:00
ihrpr
f1c5ef1a8d
apply suggested changes 2025-04-15 20:40:26 +01:00
ihrpr
f1e6acb17d
resumed tool to return value 2025-04-15 16:37:31 +01:00
ihrpr
1359e9fe6a
pull transport send options into own named type 2025-04-15 11:42:16 +01:00
ihrpr
621e65c42b
Merge branch 'resumability' into ihrpr/resume-long-running-requests 2025-04-15 11:14:39 +01:00
ihrpr
583202f81a
address client comments 2025-04-15 09:24:11 +01:00
ihrpr
7aeb67988a
improve comments 2025-04-14 09:37:19 +01:00
ihrpr
43cb015844
resume long running requst from new client 2025-04-13 21:40:15 +01:00
ihrpr
6374f43390
limit on retries 2025-04-13 15:18:52 +01:00
ihrpr
64fadf3cf2
resume streams on error - initial implementation 2025-04-13 08:26:49 +01:00
ihrpr
18e4981bd3
move get sse stream from a separate method to automatic connection when notifications/initialized received 2025-04-11 14:06:51 +01:00
ihrpr
5c5a33021c
add GET to examples servers 2025-04-10 15:28:39 +01:00
Antoine Beauvais-Lacasse
a76004c92b StreamableHTTPClientTransport cleanup / fixes
* always send headers specified in requestInit option
* avoid doubled onerror call
* use for-await to iterate SSE stream
* remove outdated comments
* simplify requestId tracking
* throw error when response Content-Type is out of spec
2025-04-09 21:18:50 -04:00
ihrpr
26929fa9b7
fix lint 2025-04-09 11:17:34 +01:00
ihrpr
18674007e5
remove the _activeStreams map 2025-04-09 11:13:28 +01:00
ihrpr
1d18a57a17
extract standalone get into a method which can be called by a client 2025-04-09 09:50:59 +01:00
ihrpr
15c10a5883
fix lint 2025-04-08 22:30:15 +01:00
ihrpr
d4ad976401
use EventSourceParserStream 2025-04-08 21:39:49 +01:00
ihrpr
f1827ced10
handle not implemented get 2025-04-08 15:04:07 +01:00
ihrpr
c3b446d424
multiple streams and initial stream with get 2025-04-08 11:11:09 +01:00
ihrpr
640ae5a863
initial client implementation 2025-04-08 09:43:22 +01:00