Elffuss BraidHub

kikocis/continue public

main · 2.3 KiBRenderedRawPermalink
1# Continue CLI Model Context Protocol (MCP) integration
2
3## Intro
4
5Model 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.
6
7## MCP Service
8
9The CLI has an MCP Service should manage connections to MCP servers and provide state to the terminal app regarding MCP server connections.
10Service 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.
11All configured server connections can be initialized simultaneously using Promise.all
12Each 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.
13Servers should have a status "idle", "connecting", "connected", or "error". Only "connected" servers contribute prompts and tools.
14If 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.
15When the process exits, all servers should be shut down and disconnected.
16Only MCP servers for the CURRENT config should be loaded
17
18- Logs from MCP servers should be routed through the winston logger, not the standard console.log (since this is a terminal app)
19
20## MCP slash command
21
22Users can manage MCP connections using the /mcp slash command.
23/mcp shows a menu with the following options
24
25- "No servers" if there are no servers
26- Restart all servers
27- Stop all servers
28- View servers
29- Back (esc also goes back)
30
31View servers should open a submenu that has each server name with its status icon
32
33- red if error, yellow if warnings, green if connected, gray if idle
34- "No Servers" if there are none
35- Back (esc also goes back)
36
37Finally, selecting a server opens a sub-submenu that keeps the name/icon as header and lists
38
39- Back (esc also goes back)
40- Restart server
41- Stop server
42- warnings the server currently has
43- prompts the server contributes
44- tools the server contributes