Elffuss BraidHub

kikocis/continue public

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