registerMcpServerDefinitionProvider
fun registerMcpServerDefinitionProvider(id: String, provider: McpServerDefinitionProvider<*>): Disposable(source)
Registers a provider that publishes Model Context Protocol servers for the editor to consume. This allows MCP servers to be dynamically provided to the editor in addition to those the user creates in their configuration files.
Before calling this method, extensions must register the contributes.mcpServerDefinitionProviders extension point with the corresponding id, for example:
"contributes": {
"mcpServerDefinitionProviders": [
{
"id": "cool-cloud-registry.mcp-servers",
"label": "Cool Cloud Registry",
}
]
}Content copied to clipboard
When a new McpServerDefinitionProvider is available, the editor will, by default, automatically invoke it to discover new servers and tools when a chat message is submitted. To enable this flow, extensions should call registerMcpServerDefinitionProvider during activation.
Parameters
id
The ID of the provider, which is unique to the extension.
provider
The provider to register