Skip to main content

MCPServersSelector

Portal only

Works only inside an ONLYOFFICE Apps portal: it needs the portal's API client, stores and translations, and is not part of the public API.

MCPServersSelector is a multi-select panel for choosing available MCP (Model Context Protocol) servers to connect to an AI agent.

Features​

  • Live API mode — Fetches available MCP servers from the API in batches of 100 with infinite scroll
  • Multi-select — Users can select and deselect multiple servers simultaneously
  • Pre-selection — Pass initedSelectedServers with server IDs to restore a previous selection on open
  • Disabled items — Servers with needReset: true are rendered as disabled
  • Back navigation — Separate onBackClick and onClose callbacks for two-level navigation
  • Cancel button — Built-in cancel button that triggers onBackClick

Default​

A basic MCPServersSelector with default settings.

DefaultDefault
import MCPServersSelector from "@onlyoffice/apps-ui-kit/selectors/MCPServers";

<MCPServersSelector
initedSelectedServers={["server-id-1"]}
onSubmit={(servers) => saveConnectedServers(servers.map((s) => s.id))}
onClose={() => setOpen(false)}
onBackClick={() => navigateBack()}
/>

Properties​

PropertyTypeDescription
useAside?booleanundefinedRender the selector inside an Aside panel with a backdrop. Default: false.
onClose?VoidFunctionundefinedCalled to fully close the selector.
withoutBackground?booleanundefinedRemove the background overlay in Aside mode. Default: false.
withBlur?booleanundefinedApply blur effect to the Aside backdrop. Default: false.
onSubmit(servers: TSelectorItem[]) => voidCalled with the array of selected TSelectorItem servers when the user confirms.
onBackClickVoidFunctionCalled when the back button or cancel button is clicked — navigate to previous view.
initedSelectedServers?string[] | undefinedArray of server IDs that should be pre-selected when the selector opens.