docs(server,examples): document extension capabilities with a runnable example (#2387)
This commit is contained in:
parent
f0bf785239
commit
49aeb8eb38
1 changed files with 187 additions and 0 deletions
|
|
@ -142,6 +142,21 @@ async function serverInstructions_basic(client: Client) {
|
|||
//#endregion serverInstructions_basic
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Extension capabilities
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/** Example: Read the negotiated extension capabilities after connecting. */
|
||||
function extensionCapabilities_read(client: Client) {
|
||||
//#region extensionCapabilities_read
|
||||
const extensions = client.getServerCapabilities()?.extensions ?? {};
|
||||
|
||||
if ('com.example/feature-flags' in extensions) {
|
||||
// Advertised on this connection; the entry's value is its settings object.
|
||||
}
|
||||
//#endregion extensionCapabilities_read
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Authentication
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -738,6 +753,7 @@ void connect_sseFallback;
|
|||
void Client_versionNegotiation;
|
||||
void disconnect_streamableHttp;
|
||||
void serverInstructions_basic;
|
||||
void extensionCapabilities_read;
|
||||
void auth_tokenProvider;
|
||||
void auth_clientCredentials;
|
||||
void auth_privateKeyJwt;
|
||||
|
|
|
|||
Loading…
Reference in a new issue