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
|
|
@ -276,6 +276,19 @@ function registerPrompt_completion(server: McpServer) {
|
|||
//#endregion registerPrompt_completion
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Extension capabilities
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/** Example: Declare an extension capability with its settings. */
|
||||
function extensionCapabilities_register(server: McpServer) {
|
||||
//#region extensionCapabilities_register
|
||||
server.server.registerCapabilities({
|
||||
extensions: { 'com.example/feature-flags': { flags: ['dark-mode', 'beta-search'] } }
|
||||
});
|
||||
//#endregion extensionCapabilities_register
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Logging
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -599,6 +612,7 @@ void registerResource_static;
|
|||
void registerResource_template;
|
||||
void registerPrompt_basic;
|
||||
void registerPrompt_completion;
|
||||
void extensionCapabilities_register;
|
||||
void streamableHttp_stateful;
|
||||
void streamableHttp_stateless;
|
||||
void streamableHttp_jsonResponse;
|
||||
|
|
|
|||
Loading…
Reference in a new issue