Elffuss BraidHub

kikocis/continue public

245005345e6e · 5.4 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
60For complete setup instructions, troubleshooting, and usage examples, see the [Continue MCP Reference](/reference/continue-mcp).
61
62## Using MCP Servers
63
64To set up your own MCP server, read the [MCP
65quickstart](https://modelcontextprotocol.io/quickstart) and then [create an
66`mcpServers`
67block](https://hub.continue.dev/new?type=block&blockType=mcpServers) or add a local MCP
68server block to your [config file](./configuration.md):
69
70<Tabs>
71 <Tab title="YAML">
72 ```yaml title="config.yaml"
73 mcpServers:
74 - name: SQLite MCP
75 command: npx
76 args:
77 - "-y"
78 - "mcp-sqlite"
79 - "/path/to/your/database.db"
80
81````
82</Tab>
83<Tab title="JSON">
84```json title="config.json"
85{
86 "experimental": {
87 "modelContextProtocolServers": [
88 {
89 "transport": {
90 "type": "stdio",
91 "command": "uvx",
92 "args": ["mcp-server-sqlite", "--db-path", "/path/to/your/database.db"]
93 }
94 }
95 ]
96 }
97}
98````
99
100 </Tab>
101</Tabs>
102
103### Syntax
104
105MCP blocks follow the established syntax for blocks, with a few additional properties specific to MCP servers.
106
107- `name`: A display name for the MCP server.
108- `type`: The type of the MCP server: `sse`, `stdio`, `streamable-http`
109- `command`: The command to run to start the MCP server.
110- `args`: Arguments to pass to the command.
111- `env`: Secrets to be injected into the command as environment variables.
112
113### Transport Types
114
115MCP 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.
116
117#### Server-Sent Events Transport (`sse`)
118
119For real-time streaming communication, use the SSE transport:
120
121```yaml
122mcpServers:
123 - name: Name
124 type: sse
125 url: https://....
126```
127
128#### Standard Input/Output (`stdio`)
129
130For local MCP servers that communicate via standard input and output:
131
132```yaml
133mcpServers:
134 - name: Name
135 type: stdio
136 command: npx
137 args:
138 - "@modelcontextprotocol/server-sqlite"
139 - "/path/to/your/database.db"
140```
141
142#### Streamable HTTP Transport (`streamable-http`)
143
144For standard HTTP-based communication with streaming capabilities:
145
146```yaml
147mcpServers:
148 - name: Name
149 type: streamable-http
150 url: https://....
151```
152
153These 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.
154
155For 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).
156
157### Working with Secrets
158
159With some MCP servers you will need to use API keys or other secrets. You can leverage locally stored environments secrets
160as 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`.
161
162```yaml
163mcpServers:
164 - name: Supabase MCP
165 command: npx
166 args:
167 - -y
168 - "@supabase/mcp-server-supabase@latest"
169 - --access-token
170 - ${{ secrets.SUPABASE_TOKEN }}
171 env:
172 SUPABASE_TOKEN: ${{ secrets.SUPABASE_TOKEN }}
173 - name: GitHub
174 command: npx
175 args:
176 - "-y"
177 - "@modelcontextprotocol/server-github"
178 env:
179 GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}
180```