Commit graph typescript-sdk/src/examples
Author SHA1 Message Date
Inna Harper
90569d885f
Merge pull request #638 from modelcontextprotocol/ochafik/auth-resource
RFC 8707 Resource Indicators Implementation
2025-06-18 17:34:37 +01:00
Olivier Chafik
68424ef7e6
simplify changes 2025-06-18 11:59:19 +01:00
Olivier Chafik
e5b2a5b880
fix simpleStreamableHttp.ts 2025-06-18 11:50:29 +01:00
Olivier Chafik
aebb2ab197
Update simpleStreamableHttp.ts 2025-06-18 11:39:29 +01:00
Olivier Chafik
d58c2eb114
Update simpleStreamableHttp.ts 2025-06-18 11:26:28 +01:00
Olivier Chafik
4a88cac4c6
Update simpleStreamableHttp.ts 2025-06-18 11:23:57 +01:00
Olivier Chafik
bf72f87788
cleanups 2025-06-18 11:23:09 +01:00
Olivier Chafik
c2150f0cb0
Update README.md 2025-06-17 19:18:27 +01:00
Olivier Chafik
40f61d88a0
show how to enable strict resource checking in mcp server 2025-06-17 17:05:34 +01:00
Olivier Chafik
515abb492f
fix lints 2025-06-17 11:53:26 +01:00
Olivier Chafik
badb5dc990
fix tests 2025-06-17 11:23:41 +01:00
Olivier Chafik
b16a415623
cleanups 2025-06-17 11:15:38 +01:00
Jerome
8b9aa20b39
Jerome/fix/dev oauth server required scopes change (#629)
* updating lock to latest version

* Added .git-blame-ignore-revs (fixes gitlens)

* Not requiring mcp:tools
2025-06-17 10:18:58 +01:00
Olivier Chafik
6e4fc52c7e
Update demoInMemoryOAuthProvider.test.ts 2025-06-17 00:42:44 +01:00
Olivier Chafik
224a2e242d
update resource to be a url 2025-06-17 00:18:33 +01:00
Olivier Chafik
36f338ae23
Update demoInMemoryOAuthProvider.ts 2025-06-16 23:39:51 +01:00
Olivier Chafik
02ce81b90c
simplify diff 2025-06-16 23:10:27 +01:00
Olivier Chafik
6656d23d84
Simplify demo in-memory oauth provider
Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 22:56:55 +01:00
Olivier Chafik
ccccb4b7cc
simplify PR / only keep verification in demo inmemory oauth provider
Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 21:34:06 +01:00
Olivier Chafik
1f4e42c09e
cleanup auth-utils and remove example files
Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 20:05:02 +01:00
Olivier Chafik
7b5bfcee52
implementation of RFC 8707 Resource Indicators (Fixes #592, Fixes #635) 2025-06-16 19:29:04 +01:00
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
90e45950b3
show name and title in example 2025-06-16 11:36:08 +01:00
ihrpr
bce2dbfb83
small fixes like argsSchema 2025-06-16 10:55:02 +01:00
ihrpr
d1c94a2c69
refactor 2025-06-16 10:43:31 +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
eed97c9d17
Merge branch 'main' into ihrpr/elicitation 2025-06-10 14:43:35 +01:00
ihrpr
c69168cf93
Merge pull request #534 from modelcontextprotocol/ihrpr/fix-example-shttp
Fix StreamableHttp example for tool calls - have a separate option for testing notifications resumption
2025-05-22 16:43:03 +01:00
ihrpr
3d76bbe6c6
Merge pull request #526 from modelcontextprotocol/ihrpr/auth-example-client3
Example Auth client
2025-05-22 11:14:51 +01:00
ihrpr
cbe9279206
add new tool for testing resumability - leave the rest normal 2025-05-22 10:38:43 +01:00
Basil Hosmer
a89f950222
post-rebase fixes 2025-05-21 17:12:42 -04:00
ihrpr
04cbbfbb0d
elicitation example 2025-05-21 16:59:37 -04:00
ihrpr
9bb5ed6dc9
lint 2025-05-21 21:32:01 +01:00
ihrpr
70f03ee648
remove non mac open browser commands 2025-05-21 21:27:42 +01: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
ihrpr
8fd635cf72
exaple 2025-05-21 16:29:41 +01: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
c964c5cf91
tsc being a diva on testOutputSchemaServers.ts 2025-05-15 10:40:34 -04:00
Basil Hosmer
f470f0996b
fix type error in testOutputSchemaServers.ts 2025-05-15 10:16:49 -04: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
Basil Hosmer
a85fee407a
Add support for outputSchema and optional content fields in tools
- Add outputSchema field to Tool type and RegisteredTool interface
- Make content field optional in CallToolResult
- Update ListToolsRequestSchema handler to include outputSchema in tool list responses
- Add support for structuredContent in tool results
- Update examples to handle optional content field
- Add tests for new outputSchema and structuredContent functionality
- Update ToolCallback documentation to clarify when to use structuredContent vs content

This change enables tools to define structured output schemas and return
structured JSON content, providing better type safety and validation for
tool outputs.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-15 09:58:40 -04:00
ihrpr
9db5b8363c
fix sse examples 2025-04-23 22:32:56 +01:00