Commit graph typescript-sdk/src/examples/server
Author SHA1 Message Date
ihrpr
54c30109fb
Merge branch 'main' into ihrpr/elicitation 2025-06-16 19:11:57 +01:00
ihrpr
cacc3bc09e
Merge branch 'main' into ihrpr/resource-link 2025-06-16 11:56:19 +01:00
ihrpr
bce2dbfb83
small fixes like argsSchema 2025-06-16 10:55:02 +01:00
ihrpr
7e59081b43
add resource link 2025-06-15 22:19:53 +01:00
ihrpr
4d03b243e3
add title 2025-06-15 20:42:25 +01:00
ihrpr
04cbbfbb0d
elicitation example 2025-05-21 16:59:37 -04:00
Basil Hosmer
7636c63f39
update to track spec changes 2025-05-21 12:42:20 -04:00
ihrpr
265ad071f7
make content required 2025-05-21 12:19:31 -04:00
Paul Carleton
ac1b80a331
feat: Add support for separate Authorization Server / Resource server in server flow (spec: DRAFT-2025-v2) (#503)
* add support for .oauth-protected-resource metadata endpoint and www-authenticate

* test and types

* thread throughs scopes

* have example separate AS and RS

* make inmemory explicitly demo

* fix type

* fix types

* fix client example

* fixup comments

* refactor metadata endpoints to cleanup

* almost working w/ forwarding

* separate AS/RS working

* add to readme

* de-async the auth server setup for happier top level flow

* add test for new router

* fix test

* remove redundant comment

* clarify comment

* remove more unused endpoints

* simplify router

* slim down

* simplify verifier, and fix router test

* fix doc string
2025-05-21 13:13:34 +01:00
Basil Hosmer
6b680ca18a
Move testOutputSchemaServers.ts to client examples directory
This file is a client implementation that tests outputSchema servers,
so it belongs in the client examples directory rather than server examples.
Updated file paths in error messages to reflect the new location.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-15 10:03:50 -04:00
Basil Hosmer
712b04e96d
Refactor McpServer tool registration API
- Remove tool() overload that takes a config object with callback
- Add new registerTool() method that separates config from callback
- Extract common tool registration logic into _createRegisteredTool() helper
- Update all tests to use registerTool() for tools with output schemas
- Update examples to use registerTool() and high-level Client API
- Add comment noting that output schema validation only works with high-level API

This change improves API clarity by using a distinct method for tools with
output schemas while maintaining backward compatibility.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-15 10:03:50 -04:00
Basil Hosmer
e1abdab7f5
update examples, update package-lock.json 2025-05-15 10:03:48 -04:00
Basil Hosmer
6079cd8307
- add new tool() api and tests
- fix schema validation
- comment headers on tests
2025-05-15 10:03:02 -04:00
Basil Hosmer
9686fc2ead
formatting, more version rollbacks 2025-05-15 10:02:03 -04:00
Basil Hosmer
bb28098d81
feat: add server-side support for tool outputSchema with backward compatibility
- Update McpServer to support registering tools with outputSchema
- Add automatic content generation from structuredContent for backward compatibility
- Add validation to ensure proper usage of structuredContent vs content
- Add comprehensive tests for outputSchema functionality
- Add example servers demonstrating structured output usage
- Update existing test to match new backward compatibility behavior

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-15 10:02:02 -04:00
ihrpr
9db5b8363c
fix sse examples 2025-04-23 22:32:56 +01:00
Basil Hosmer
e53608ea19
rebase and address comments 2025-04-22 16:37:16 -04:00
Basil Hosmer
c5e81adcd8
Fix example to properly position tool annotations 2025-04-22 15:24:38 -04:00
Basil Hosmer
0096be432f
Add ToolAnnotations support to McpServer.tool() method 2025-04-22 15:24:32 -04:00
Justin Spahr-Summers
21f492f531
Revert "Merge pull request #334 from m-paternostro/mp/notifier"
This reverts commit 3ef902328a, reversing
changes made to 5b6d35eb12.
2025-04-22 11:35:49 +01:00
ihrpr
eeda5d630a
readme update 2025-04-21 15:13:25 +01:00
ihrpr
39f7fdf050
fix stateless example 2025-04-21 14:41:12 +01:00
Marcelo Paternostro
112eed999c
example and more documentation 2025-04-18 10:08:36 -04:00
ihrpr
ea04be4cf8
fix build 2025-04-18 11:52:51 +01:00
ihrpr
0bf8b376df
examples for stateless servers 2025-04-18 11:46:17 +01:00
ihrpr
64653f54bd
Merge pull request #351 from modelcontextprotocol/ihrpr/clean-up-examples
StreamableHttp - Update examples and README
2025-04-17 18:32:20 +01:00
ihrpr
29ae6b8e49
appying suggested changes 2025-04-17 17:43:14 +01:00
ihrpr
16df308d4f
remove logs how to ititialize with curl - not needed anymore as we have client 2025-04-16 14:51:09 +01:00
ihrpr
c3f08567a2
share implementation of in memory store between examples and integration tests 2025-04-16 14:48:47 +01:00
ihrpr
7341c9a288
fix lint 2025-04-16 14:44:45 +01:00
ihrpr
80b0bab08b
backwards compatible client 2025-04-16 14:20:55 +01:00
ihrpr
8328cfe327
example of sse server 2025-04-16 13:36:37 +01:00
ihrpr
4d2968cec3
backward compatible server example 2025-04-16 13:30:00 +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
621e65c42b
Merge branch 'resumability' into ihrpr/resume-long-running-requests 2025-04-15 11:14:39 +01:00
ihrpr
67a4595ae7
improve event store interface 2025-04-15 11:03:44 +01:00
ihrpr
43cb015844
resume long running requst from new client 2025-04-13 21:40:15 +01:00
ihrpr
3bd28829a5
examples 2025-04-13 08:28:09 +01:00
ihrpr
e3b4496579
clean up and small fixes to comments 2025-04-11 10:42:41 +01:00
ihrpr
5c5a33021c
add GET to examples servers 2025-04-10 15:28:39 +01:00
ihrpr
111586c523
support sse though get 2025-04-10 14:23:34 +01:00
ihrpr
962a9c959a
clean up and docs fixes 2025-04-10 13:01:09 +01:00
ihrpr
71aeb9a3a6
add examples with notifications 2025-04-09 21:38:57 +01:00
ihrpr
b37a2e11ab
support for server returning json -- not stream 2025-04-09 21:01:35 +01:00
ihrpr
161b8da3e0
fix lint and rename 2025-04-08 16:16:51 +01:00
ihrpr
c645ec9ad8
streamable client and server examples 2025-04-08 15:24:56 +01:00