Elffuss BraidHub

kikocis/continue public

main · 2.3 KiBSourceRawPermalink

Continue CLI Model Context Protocol (MCP) integration

Intro

Model Context Protocol is a protocol for giving models access to resources and tools. MCP servers can run locally (stdio) or be remote (http/streamable/etc). See https://modelcontextprotocol.io/specification. The Continue CLI uses MCP to extend model's capabilities with MCP prompts and tools. MCP server configurations are stored in the mcpServers field of an assistant/config.yaml configuration.

MCP Service

The CLI has an MCP Service should manage connections to MCP servers and provide state to the terminal app regarding MCP server connections. Service initialization for MCP servers can take especially long, so it should not block service initialization. Instead, initialization should kick off server connections and then resolve. All configured server connections can be initialized simultaneously using Promise.all Each server configuration should have its own connection and state separated, but the service should also have an easy way to retrieve all tools and prompts from all servers to pass to the model. Servers should have a status "idle", "connecting", "connected", or "error". Only "connected" servers contribute prompts and tools. If a server successfully connects but there is an error retrieving prompts or tools, it should have an array of warning messages that can be accessed in the terminal app. When the process exits, all servers should be shut down and disconnected. Only MCP servers for the CURRENT config should be loaded

MCP slash command

Users can manage MCP connections using the /mcp slash command. /mcp shows a menu with the following options

View servers should open a submenu that has each server name with its status icon

Finally, selecting a server opens a sub-submenu that keeps the name/icon as header and lists