Class SessionMcpApi
mcp namespace.- Since:
- 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal SessionMcpAppsApiAPI methods for themcp.appssub-namespace.final SessionMcpHeadersApiAPI methods for themcp.headerssub-namespace.final SessionMcpOauthApiAPI methods for themcp.oauthsub-namespace.final SessionMcpPromptsApiAPI methods for themcp.promptssub-namespace.final SessionMcpResourcesApiAPI methods for themcp.resourcessub-namespace. -
Method Summary
Modifier and TypeMethodDescriptionCancels an in-flight MCP sampling execution by request ID.disable(SessionMcpDisableParams params) Disables an MCP server for the session.disable(SessionMcpDisableRequest request) Disables an MCP server for the session.enable(SessionMcpEnableParams params) Enables an MCP server for the session.enable(SessionMcpEnableRequest request) Enables an MCP server for the session.Runs an MCP sampling inference on behalf of an MCP server.Checks whether a named MCP server is currently running on the session's host.list()Lists materialized MCP servers and their connection status.Lists effective MCP configuration without starting, restarting, authenticating, or waiting for servers.listTools(SessionMcpListToolsParams params) Lists the tools exposed by a connected MCP server on this session's host.Releases any turns waiting on an in-flight MCP load without cancelling the load, letting the agent proceed while MCP servers finish connecting in the background.reload()Reloads MCP server connections for the session.Removes the auto-managed `github` MCP server when present.Restarts an individual MCP server on the live session (stops then starts).Restarts an individual MCP server on the live session (stops then starts).Sets how environment-variable values supplied to MCP servers are resolved (direct or indirect).Starts an individual MCP server on the live session.startServer(SessionMcpStartServerRequest request) Starts an individual MCP server on the live session.stopServer(SessionMcpStopServerParams params) Stops an individual MCP server on the session's host.stopServer(SessionMcpStopServerRequest request) Stops an individual MCP server on the session's host.
-
Field Details
-
oauth
API methods for themcp.oauthsub-namespace. -
headers
API methods for themcp.headerssub-namespace. -
apps
API methods for themcp.appssub-namespace. -
resources
API methods for themcp.resourcessub-namespace. -
prompts
API methods for themcp.promptssub-namespace.
-
-
Method Details
-
list
Lists materialized MCP servers and their connection status. Cache misses may start and wait for MCP servers.- Since:
- 1.0.0
-
listConfigured
Lists effective MCP configuration without starting, restarting, authenticating, or waiting for servers. An optional live observation is from an already materialized matching server; this is not a readiness guarantee.- Since:
- 1.0.0
-
listTools
@CopilotExperimental public CompletableFuture<SessionMcpListToolsResult> listTools(SessionMcpListToolsParams params) Lists the tools exposed by a connected MCP server on this session's host. This performs a live `tools/list` request. Tool UI metadata is returned independently of whether MCP Apps rendering is enabled for the session.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
enable
Enables an MCP server for the session.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
enable
Enables an MCP server for the session.Accepts the extensible request, including inputs added after the params record.
- Since:
- 1.0.0
-
disable
Disables an MCP server for the session.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
disable
Disables an MCP server for the session.Accepts the extensible request, including inputs added after the params record.
- Since:
- 1.0.0
-
reload
Reloads MCP server connections for the session.- Since:
- 1.0.0
-
moveLoadingToBackground
@CopilotExperimental public CompletableFuture<SessionMcpMoveLoadingToBackgroundResult> moveLoadingToBackground()Releases any turns waiting on an in-flight MCP load without cancelling the load, letting the agent proceed while MCP servers finish connecting in the background. No-op when no MCP load is in flight or waiting turns were already released.- Since:
- 1.0.0
-
executeSampling
@CopilotExperimental public CompletableFuture<SessionMcpExecuteSamplingResult> executeSampling(SessionMcpExecuteSamplingParams params) Runs an MCP sampling inference on behalf of an MCP server.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
cancelSamplingExecution
@CopilotExperimental public CompletableFuture<SessionMcpCancelSamplingExecutionResult> cancelSamplingExecution(SessionMcpCancelSamplingExecutionParams params) Cancels an in-flight MCP sampling execution by request ID.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
setEnvValueMode
@CopilotExperimental public CompletableFuture<SessionMcpSetEnvValueModeResult> setEnvValueMode(SessionMcpSetEnvValueModeParams params) Sets how environment-variable values supplied to MCP servers are resolved (direct or indirect).Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
removeGitHub
Removes the auto-managed `github` MCP server when present.- Since:
- 1.0.0
-
startServer
Starts an individual MCP server on the live session. Omit `config` for a config-free start-by-name of an already-configured server (reuses the server's already-registered configuration); supply `config` to start from a caller-supplied configuration. Session-scoped and ephemeral: the server is added to this session's running set only and is reaped when the session ends. Does NOT modify persistent user configuration (`mcp.config.*`), so it does not affect future sessions. The server surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / `session.mcp_server_status_changed` events like any other server.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
startServer
@CopilotExperimental public CompletableFuture<Void> startServer(SessionMcpStartServerRequest request) Starts an individual MCP server on the live session. Omit `config` for a config-free start-by-name of an already-configured server (reuses the server's already-registered configuration); supply `config` to start from a caller-supplied configuration. Session-scoped and ephemeral: the server is added to this session's running set only and is reaped when the session ends. Does NOT modify persistent user configuration (`mcp.config.*`), so it does not affect future sessions. The server surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / `session.mcp_server_status_changed` events like any other server.Accepts the extensible request, including inputs added after the params record.
- Since:
- 1.0.0
-
restartServer
@CopilotExperimental public CompletableFuture<Void> restartServer(SessionMcpRestartServerParams params) Restarts an individual MCP server on the live session (stops then starts). Omit `config` for a config-free restart-by-name of an already-configured server; supply `config` to restart with a replacement configuration. Session-scoped and ephemeral: does NOT modify persistent user configuration (`mcp.config.*`).Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
restartServer
@CopilotExperimental public CompletableFuture<Void> restartServer(SessionMcpRestartServerRequest request) Restarts an individual MCP server on the live session (stops then starts). Omit `config` for a config-free restart-by-name of an already-configured server; supply `config` to restart with a replacement configuration. Session-scoped and ephemeral: does NOT modify persistent user configuration (`mcp.config.*`).Accepts the extensible request, including inputs added after the params record.
- Since:
- 1.0.0
-
stopServer
Stops an individual MCP server on the session's host.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
stopServer
Stops an individual MCP server on the session's host.Accepts the extensible request, including inputs added after the params record.
- Since:
- 1.0.0
-
isServerRunning
@CopilotExperimental public CompletableFuture<SessionMcpIsServerRunningResult> isServerRunning(SessionMcpIsServerRunningParams params) Checks whether a named MCP server is currently running on the session's host.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-