Elffuss BraidHub

kikocis/continue public

7be2006a2313 · 6.2 KiBRawPermalink
1---
2title: MCP
3description: MCP use and customization
4keywords: [tool, use, function calling, claude, automatic]
5---
6
7# MCP
8
9As AI systems get better, they're still held back by their training data and
10can't access real-time information or specialized tools. The [Model Context
11Protocol](https://modelcontextprotocol.io/introduction) (MCP) fixes this by
12letting AI models connect with outside data sources, tools, and environments.
13This allows smooth sharing of information and abilities between AI systems and
14the wider digital world. This standard, created by Anthropic to bring together
15prompts, context, and tool use, is key for building truly useful AI experiences
16that can be set up with custom tools.
17
18## How it works
19
20Currently custom tools can be configured using the Model Context
21Protocol standard to unify prompts, context, and tool use.
22
23MCP Servers can be added to hub Assistants using `mcpServers` blocks. You can
24explore available MCP server blocks
25[here](https://hub.continue.dev/explore/mcp).
26
27<Info>MCP can only be used in the **agent** mode.</Info>
28
29## Quick Start
30
31Below is a quick example of setting up a new MCP server for use in your assistant:
32
331. Create a folder called `.continue/mcpServers` at the top level of your workspace
342. Add a file called `playwright-mcp.yaml` to this folder.
353. Write the following contents to `playwright-mcp.yaml` and save.
36
37```yaml title=".continue/mcpServers/playwright-mcp.yaml"
38name: Playwright mcpServer
39version: 0.0.1
40schema: v1
41mcpServers:
42 - name: Browser search
43 command: npx
44 args:
45 - "@playwright/mcp@latest"
46```
47
48Now test your MCP server by prompting the following command:
49
50```
51Open the browser and navigate Hacker News. Save the top 10 headlines in a hn.txt file.
52```
53
54The result will be a generated file called `hn.txt` in the current working directory.
55
56![playwright mcp](/images/mcp-playwright.png)
57
58## Continue Documentation Search
59
60You can set up an MCP server to search the Continue documentation directly from your agent. This is particularly useful for getting help with Continue configuration and features.
61
621. Create a folder called `.continue/mcpServers` at the top level of your workspace
632. Add a file called `continue-docs-mcp.yaml` to this folder
643. Write the following contents and save:
65
66```yaml title=".continue/mcpServers/continue-docs-mcp.yaml"
67name: Continue Documentation MCP
68version: 0.0.1
69schema: v1
70mcpServers:
71 - name: Continue Docs Search
72 type: stdio
73 command: npx
74 args:
75 - mint-mcp
76 - add
77 - continue-docs
78```
79
80Now you can search the Continue documentation by asking questions like:
81
82```
83Search for model setup instructions in the Continue docs
84```
85
86```
87Find documentation about context providers
88```
89
90```
91How do I configure autocomplete in Continue?
92```
93
94The MCP server will search the Continue documentation and provide relevant information to help with your questions.
95
96For detailed setup instructions and troubleshooting, see the [Continue MCP Reference](/reference/continue-mcp).
97
98## Using MCP Servers
99
100To set up your own MCP server, read the [MCP
101quickstart](https://modelcontextprotocol.io/quickstart) and then [create an
102`mcpServers`
103block](https://hub.continue.dev/new?type=block&blockType=mcpServers) or add a local MCP
104server block to your [config file](./configuration.md):
105
106<Tabs>
107 <Tab title="YAML">
108 ```yaml title="config.yaml"
109 mcpServers:
110 - name: SQLite MCP
111 command: npx
112 args:
113 - "-y"
114 - "mcp-sqlite"
115 - "/path/to/your/database.db"
116
117````
118</Tab>
119<Tab title="JSON">
120```json title="config.json"
121{
122 "experimental": {
123 "modelContextProtocolServers": [
124 {
125 "transport": {
126 "type": "stdio",
127 "command": "uvx",
128 "args": ["mcp-server-sqlite", "--db-path", "/path/to/your/database.db"]
129 }
130 }
131 ]
132 }
133}
134````
135
136 </Tab>
137</Tabs>
138
139### Syntax
140
141MCP blocks follow the established syntax for blocks, with a few additional properties specific to MCP servers.
142
143- `name` (**required**): A display name for the MCP server.
144- `command` (**required**): The command to run to start the MCP server.
145- `type` (optional): The type of the MCP server: `sse`, `stdio`, `streamable-http`
146- `args` (optional): Arguments to pass to the command.
147- `env` (optional): Secrets to be injected into the command as environment variables.
148
149### Transport Types
150
151MCP now supports remote server connections through HTTP-based transports, expanding beyond the traditional local stdio transport method. This enables integration with cloud-hosted MCP servers and distributed architectures.
152
153#### Server-Sent Events (SSE) Transport
154
155For real-time streaming communication, use the SSE transport:
156
157```yaml
158mcpServers:
159 - name: Name
160 type: sse
161 url: https://....
162```
163
164#### Standard Input/Output (stdio)
165
166For local MCP servers that communicate via standard input and output:
167
168```yaml
169mcpServers:
170 - name: Name
171 type: stdio
172 command: npx
173 args:
174 - "@modelcontextprotocol/server-sqlite"
175 - "/path/to/your/database.db"
176```
177
178#### Streamable HTTP Transport
179
180For standard HTTP-based communication with streaming capabilities:
181
182```yaml
183mcpServers:
184 - name: Name
185 type: streamable-http
186 url: https://....
187```
188
189These remote transport options allow you to connect to MCP servers hosted on remote infrastructure, enabling more flexible deployment architectures and shared server resources across multiple clients.
190
191For detailed information about transport mechanisms and their use cases, refer to the official MCP documentation on [transports](https://modelcontextprotocol.io/docs/concepts/transports#server-sent-events-sse).
192
193### Working with Secrets
194
195With some MCP servers you will need to use API keys or other secrets. You can leverage locally stored environments secrets
196as well as access hosted secrets in the Continue Hub. To leverage Hub secrets, you can use the `inputs` property in your MCP env block instead of `secrets`.
197
198```yaml
199mcpServers:
200 - name: Supabase MCP
201 command: npx
202 args:
203 - -y
204 - "@supabase/mcp-server-supabase@latest"
205 - --access-token
206 - ${{ secrets.SUPABASE_TOKEN }}
207 env:
208 SUPABASE_TOKEN: ${{ secrets.SUPABASE_TOKEN }}
209 - name: GitHub
210 command: npx
211 args:
212 - "-y"
213 - "@modelcontextprotocol/server-github"
214 env:
215 GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}
216```