SEP-1036: URL Elicitation (#1105)

This commit is contained in:
Nate Barbettini 2025-11-18 02:53:15 -08:00 • committed by GitHub
commit 4debc740a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,11 +7,14 @@ This directory contains example implementations of MCP clients and servers using
- [Client Implementations](#client-implementations)
- [Streamable HTTP Client](#streamable-http-client)
- [Backwards Compatible Client](#backwards-compatible-client)
- [URL Elicitation Example Client](#url-elicitation-example-client)
- [Server Implementations](#server-implementations)
- [Single Node Deployment](#single-node-deployment)
- [Streamable HTTP Transport](#streamable-http-transport)
- [Deprecated SSE Transport](#deprecated-sse-transport)
- [Backwards Compatible Server](#streamable-http-backwards-compatible-server-with-sse)
- [Form Elicitation Example](#form-elicitation-example)
- [URL Elicitation Example](#url-elicitation-example)
- [Multi-Node Deployment](#multi-node-deployment)
- [Backwards Compatibility](#testing-streamable-http-backwards-compatibility-with-sse)
@ -51,6 +54,19 @@ A client that implements backwards compatibility according to the [MCP specifica
npx tsx src/examples/client/streamableHttpWithSseFallbackClient.ts
```
### URL Elicitation Example Client
A client that demonstrates how to use URL elicitation to securely collect _sensitive_ user input or perform secure third-party flows.
```bash
# First, run the server:
npx tsx src/examples/server/elicitationUrlExample.ts
# Then, run the client:
npx tsx src/examples/client/elicitationUrlExample.ts
```
## Server Implementations
### Single Node Deployment
@ -105,6 +121,32 @@ A server that demonstrates server notifications using Streamable HTTP.
npx tsx src/examples/server/standaloneSseWithGetStreamableHttp.ts
```
##### Form Elicitation Example
A server that demonstrates using form elicitation to collect _non-sensitive_ user input.
```bash
npx tsx src/examples/server/elicitationFormExample.ts
```
##### URL Elicitation Example
A comprehensive example demonstrating URL mode elicitation in a server protected by MCP authorization. This example shows:
- SSE-driven URL elicitation of an API Key on session initialization: obtain sensitive user input at session init
- Tools that require direct user interaction via URL elicitation (for payment confirmation and for third-party OAuth tokens)
- Completion notifications for URL elicitation
To run this example:
```bash
# Start the server
npx tsx src/examples/server/elicitationUrlExample.ts
# In a separate terminal, start the client
npx tsx src/examples/client/elicitationUrlExample.ts
```
#### Deprecated SSE Transport
A server that implements the deprecated HTTP+SSE transport (protocol version 2024-11-05). This example only used for testing backwards compatibility for clients.