Files
cline/docs/mcp/mcp-overview.mdx
T
Tran Binh MinhandMinhkunn d8a3086eaa docs(mcp): set type=streamableHttp in remote server example (#11670) (#11690)
The remote-server JSON example omitted the `type` field. Because the
config schema's z.union lists the SSE branch before streamableHttp
(intentionally, for backward compat), an untyped remote entry silently
resolves to the deprecated legacy SSE transport — the opposite of the
docs' own "Streamable HTTP (recommended)" guidance.

Add `"type": "streamableHttp"` to the example, rename the heading to
match, and add a sentence explaining that omitting `type` defaults to
legacy SSE.

Fixes #11670

Co-authored-by: Minhkunn <minh.12072k6@gmail.com>
2026-06-24 20:59:31 +02:00

148 lines
3.9 KiB
Plaintext

---
title: "MCP"
sidebarTitle: "MCP"
description: "Add, configure, and use MCP servers in Cline."
---
MCP (Model Context Protocol) lets Cline use external tools and data sources through MCP servers.
## What MCP gives you
- Connect Cline to external APIs and services
- Add custom tools beyond built-in Cline tools
- Use either local servers or remote hosted servers
## Quick start
1. Open **MCP Servers** in Cline
2. Add a local server manually, or connect to a hosted remote server
3. Configure credentials/environment variables
4. Verify tools appear and test one tool call
## Add servers
### Manual config
Edit your MCP config file and add either:
- **CLI:** `~/.cline/mcp.json`
- **IDE extensions:**
1. In the Cline panel, click the **MCP Servers** icon (stacked server icon in the top toolbar).
2. Open the **Configure** tab.
3. Click **Configure MCP Servers** (button near the bottom).
4. This opens the MCP settings JSON used by the extension; add/update entries under `mcpServers`.
- If you're adding a hosted endpoint (instead of editing JSON directly), use the **Remote Servers** tab:
1. Enter **Server Name** (any unique label).
2. Enter **Server URL** (full endpoint URL).
3. Choose **Transport Type**:
- **Streamable HTTP** (recommended)
- **SSE (Legacy)**
4. Click **Add Server**.
- Server config shape:
- **Local (STDIO)** server using `command` + `args`
- **Remote (HTTP/SSE)** server using `url`
### CLI MCP wizard
From CLI, run:
```bash
cline mcp
```
The wizard supports:
| Action | Description |
|---|---|
| List servers | Show configured servers and enabled/disabled status |
| Add server | Create a new MCP server entry |
| Edit server | Modify an existing server |
| Enable/Disable | Toggle a server without deleting it |
| Delete server | Remove a server permanently |
When adding a server, the CLI prompts for server name, transport type, command/args (for stdio), or URL/headers (for remote transports).
## Configuration examples
### Local server (STDIO)
```json
{
"mcpServers": {
"local-server": {
"command": "node",
"args": ["/path/to/server.js"],
"env": {
"API_KEY": "your_api_key"
},
"disabled": false,
"autoApprove": []
}
}
}
```
### Remote server (Streamable HTTP)
```json
{
"mcpServers": {
"remote-server": {
"type": "streamableHttp",
"url": "https://example.com/mcp",
"headers": {
"Authorization": "Bearer your-token"
},
"disabled": false,
"autoApprove": []
}
}
}
```
The `type` field selects the transport. Omitting it defaults to the legacy `sse` transport for backward compatibility, so set `"type": "streamableHttp"` explicitly for the recommended transport. Use `"type": "sse"` only for legacy SSE servers.
## Transport types
- **STDIO**: local process, lower latency, simpler local setup
- **Remote HTTP/SSE**: hosted endpoint, centralized deployment, supports multi-client usage
Use STDIO for local tools and remote transport for shared hosted services.
## Managing servers
In MCP settings you can:
- Enable/disable servers
- Restart unresponsive servers
- Set request timeouts
- Remove servers
## Security basics
- Only install servers you trust
- Store secrets in environment variables
- Limit `autoApprove` to safe tools
- Review tool calls before approval
## Troubleshooting
| Issue | Fix |
|---|---|
| Server won't connect | Verify command/URL, server process status, and port |
| Missing tools | Confirm server started successfully and tools are exposed |
| Auth errors | Re-check API keys/tokens and required headers |
| Timeout errors | Increase MCP timeout and test server response directly |
## CLI
MCP also works in Cline CLI. Configure servers in CLI MCP settings and use the same server definitions.
You can also list servers non-interactively:
```bash
cline config mcp
cline config mcp --json
```