Commit graph typescript-sdk/src/shared/protocol.ts
Author SHA1 Message Date
Justin Spahr-Summers
8027ae1593
Revert "feat: support extending McpServer with authorization" 2025-04-07 10:47:37 +01:00
shijun
9482d936d4
Merge branch 'main' into main 2025-04-05 11:36:43 +08:00
Cliff Hall
deb2737d0f
Merge branch 'main' into fix-reset-timeout-on-progress 2025-04-02 18:52:22 -04:00
wangshijun
3571fc353f feat: support extending McpServer with subclass 2025-04-01 12:21:08 +08:00
Jerome
a22092bea2
Merge branch 'main' into add-sessionid-to-context 2025-02-28 11:50:37 +00:00
Tuomas
92da5861f4 Fix resetTimeoutOnProgress option not being checked 2025-02-25 11:30:50 -06:00
Jason Victor
44c9bffa85 added session id to request handler extra data 2025-02-23 12:39:15 -05:00
Tuomas
b09240bc10 only return early from progress notification on actual timeout errors 2025-02-20 15:36:57 -06:00
Tuomas
28415d3917 Refactor progress notification timeout handling in protocol 2025-02-19 12:23:16 -06:00
Tuomas
7f6c0465f5 Add timeout reset on progress notifications 2025-02-17 15:57:02 -06:00
Justin Spahr-Summers
2289dbc0d0
Factor out convenience APIs into another class 2025-01-08 21:59:38 +00:00
Justin Spahr-Summers
1506bd1b51
Allow capabilities to be dynamically registered after initialization 2025-01-07 14:34:00 +00:00
Justin Spahr-Summers
4bf5c5358a
Assert tool request handlers do not already exist 2025-01-07 14:34:00 +00:00
Jerome
881a0ce0e8
Destructured progress and total from notification params object 2024-12-16 16:50:05 +00:00
Eric Fritz
3d15050960
Fix cancellation notification mismatch
The server registers a notification handler on `CancelledNotificationSchema`, but is never called on client cancellation because of a mismatch in the method name. This fixes that mismatch.
2024-11-27 23:48:44 -06:00
Justin Spahr-Summers
35396f4a8d
Report errors sending cancellation 2024-11-16 16:31:45 +00:00
Justin Spahr-Summers
2cc3bc8a40
Add RequestOptions.timeout 2024-11-16 16:30:20 +00:00
Justin Spahr-Summers
53f55b8edf
Remove abortAfterTimeout
It's fundamentally flawed because it doesn't support easy cancellation of the timeout.
2024-11-16 16:18:35 +00:00
Justin Spahr-Summers
9882f1c919
Add abortAfterTimeout() utility to make it easy to add timeouts 2024-11-14 14:25:16 +00:00
Justin Spahr-Summers
1b08f203ea
Catch errors that occur when a handler is invoked, but before it returns a Promise 2024-11-14 14:02:51 +00:00
Justin Spahr-Summers
90ba8950d2
Pass an AbortSignal to request handlers 2024-11-14 13:57:04 +00:00
Justin Spahr-Summers
54d146bbdc
Support passing an AbortSignal to request() 2024-11-14 13:42:18 +00:00
Justin Spahr-Summers
8b307a5d62
Check capabilities when request handlers are set 2024-11-12 12:16:43 +00:00
Justin Spahr-Summers
64c2862883
Check and add tests for notification capabilities too 2024-11-12 12:02:10 +00:00
Justin Spahr-Summers
dc45f5d148
Handle capabilities checks at the request() level, make non-strict by default 2024-11-12 10:57:59 +00:00
Justin Spahr-Summers
1f3dbef66c
Support old tools/call result structure, if explicitly opted in 2024-11-07 13:09:20 +00:00
Justin Spahr-Summers
a254ab7e46
Fix missing error codes 2024-11-01 14:47:48 +00:00
Justin Spahr-Summers
be9c1fe9c8
Merge branch 'main' into justin/fix-race-condition 2024-10-16 18:23:48 +01:00
Justin Spahr-Summers
83a43fda1e
Protocol.connect() can automatically call Transport.start() 2024-10-16 13:10:31 +01:00
Ashwin Bhat
bcb4b219ee
add server capabilities derivation 2024-10-15 17:08:08 -07:00
Justin Spahr-Summers
42fbfe2ff4
Update Protocol type inference 2024-10-02 22:01:49 +01:00
Justin Spahr-Summers
cd6820e810
Use an enum for error codes 2024-10-02 14:51:55 +01:00
Justin Spahr-Summers
4be31d0f08
Remove explicit constants of method names, factor out ProgressSchema 2024-10-02 14:51:55 +01:00
Justin Spahr-Summers
3786c88960
Combine types into one file 2024-10-02 14:17:31 +01:00
David Soria Parra
02e421c1f1
Initial import 2024-09-24 21:53:34 +01:00