1
>
/*---------------------------------------------------------------------------------------------
mcpAppDefaults.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import type { AhpMcpUiHostCapabilities, McpServerCustomizationApps } from './channels-session/state.js';
7
>
8
>
/**
9
>
* MCP App capabilities the agent host proxies for every MCP server it
10
>
* advertises over the `mcp://` side-channel.
11
>
*
12
>
* - `serverTools.listChanged` is `true`: we forward
13
>
* `notifications/tools/list_changed` whenever the SDK signals that the
14
>
* tool inventory has refreshed (see `CopilotAgentSession`).
15
>
* - `serverResources` is advertised as an empty object: we serve the
16
>
* `resources/*` methods over the channel but do not promise
17
>
* `notifications/resources/list_changed` forwarding (no `listChanged`).
18
>
* - `sampling` is advertised as an empty object: we serve
19
>
* `sampling/createMessage` requests from the App over the `mcp://`
20
>
* channel (the agent host handler forwards them to
21
>
* `session.rpc.mcp.executeSampling`). The SEP-1577 `tools`
22
>
* sub-flag is NOT set — we don't pass through tool content blocks.
23
>
*
24
>
* Per the AHP spec, `mcpApp` is a static capability declaration —
25
>
* "SHOULD be present whenever the server can host Apps" — so this
26
>
* constant is set on every MCP customization at construction time,
27
>
* regardless of the server's current lifecycle state.
28
>
*/
29
>
export const DEFAULT_MCP_APP_CAPABILITIES: AhpMcpUiHostCapabilities = {
30
>
serverTools: { listChanged: true },
31
>
serverResources: {},
32
>
sampling: {},
33
>
};
34
>
35
>
/**
36
>
* The full `mcpApp` shape applied to a {@link McpServerCustomization}.
37
>
* Wraps {@link DEFAULT_MCP_APP_CAPABILITIES} so callers can drop it in
38
>
* directly without re-allocating the same wrapper object at every call
39
>
* site.
40
>
*/
41
>
export const DEFAULT_MCP_APP: McpServerCustomizationApps = {
42
>
capabilities: DEFAULT_MCP_APP_CAPABILITIES,
43
>
};