| 1 | --- |
| 2 | title: MCP |
| 3 | description: MCP use and customization |
| 4 | keywords: [tool, use, function calling, claude, automatic] |
| 5 | --- |
| 6 | |
| 7 | As AI systems get better, they're still held back by their training data and |
| 8 | can't access real-time information or specialized tools. The [Model Context |
| 9 | Protocol](https://modelcontextprotocol.io/introduction) (MCP) fixes this by |
| 10 | letting AI models connect with outside data sources, tools, and environments. |
| 11 | This allows smooth sharing of information and abilities between AI systems and |
| 12 | the wider digital world. This standard, created by Anthropic to bring together |
| 13 | prompts, context, and tool use, is key for building truly useful AI experiences |
| 14 | that can be set up with custom tools. |
| 15 | |
| 16 | ## How it works |
| 17 | |
| 18 | Currently custom tools can be configured using the Model Context |
| 19 | Protocol standard to unify prompts, context, and tool use. |
| 20 | |
| 21 | MCP Servers can be added to hub Assistants using `mcpServers` blocks. You can |
| 22 | explore 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 | |
| 29 | Below is a quick example of setting up a new MCP server for use in your assistant: |
| 30 | |
| 31 | 1. Create a folder called `.continue/mcpServers` at the top level of your workspace |
| 32 | 2. Add a file called `playwright-mcp.yaml` to this folder. |
| 33 | 3. Write the following contents to `playwright-mcp.yaml` and save. |
| 34 | |
| 35 | ```yaml title=".continue/mcpServers/playwright-mcp.yaml" |
| 36 | name: Playwright mcpServer |
| 37 | version: 0.0.1 |
| 38 | schema: v1 |
| 39 | mcpServers: |
| 40 | - name: Browser search |
| 41 | command: npx |
| 42 | args: |
| 43 | - "@playwright/mcp@latest" |
| 44 | ``` |
| 45 | |
| 46 | Now test your MCP server by prompting the following command: |
| 47 | |
| 48 | ``` |
| 49 | Open the browser and navigate Hacker News. Save the top 10 headlines in a hn.txt file. |
| 50 | ``` |
| 51 | |
| 52 | The result will be a generated file called `hn.txt` in the current working directory. |
| 53 | |
| 54 |  |
| 55 | |
| 56 | ## Continue Documentation Search |
| 57 | |
| 58 | You 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 | |
| 60 | For complete setup instructions, troubleshooting, and usage examples, see the [Continue MCP Reference](/reference/continue-mcp). |
| 61 | |
| 62 | ## Using MCP Servers |
| 63 | |
| 64 | To set up your own MCP server, read the [MCP |
| 65 | quickstart](https://modelcontextprotocol.io/quickstart) and then [create an |
| 66 | `mcpServers` |
| 67 | block](https://hub.continue.dev/new?type=block&blockType=mcpServers) or add a local MCP |
| 68 | server 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 | |
| 105 | MCP 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 | |
| 115 | MCP 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 | |
| 119 | For real-time streaming communication, use the SSE transport: |
| 120 | |
| 121 | ```yaml |
| 122 | mcpServers: |
| 123 | - name: Name |
| 124 | type: sse |
| 125 | url: https://.... |
| 126 | ``` |
| 127 | |
| 128 | #### Standard Input/Output (`stdio`) |
| 129 | |
| 130 | For local MCP servers that communicate via standard input and output: |
| 131 | |
| 132 | ```yaml |
| 133 | mcpServers: |
| 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 | |
| 144 | For standard HTTP-based communication with streaming capabilities: |
| 145 | |
| 146 | ```yaml |
| 147 | mcpServers: |
| 148 | - name: Name |
| 149 | type: streamable-http |
| 150 | url: https://.... |
| 151 | ``` |
| 152 | |
| 153 | These 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 | |
| 155 | For 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 | |
| 159 | With some MCP servers you will need to use API keys or other secrets. You can leverage locally stored environments secrets |
| 160 | as 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 |
| 163 | mcpServers: |
| 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 | ``` |