> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/cline/cline/llms.txt
> Use this file to discover all available pages before exploring further.

# Adding and configuring servers

> Manually add MCP servers to Cline by editing the MCP configuration JSON. Covers stdio and SSE transports, required config fields, enabling/disabling servers, and troubleshooting.

This page explains how to add MCP servers manually by editing Cline's configuration file, and how to manage them once installed. If you prefer a guided experience, the [MCP Marketplace](/mcp/mcp-marketplace) can install many popular servers for you automatically.

## Finding MCP servers

<Columns cols={2}>
  <Card title="MCP Marketplace" icon="store" href="/mcp/mcp-marketplace">
    One-click install from inside Cline.
  </Card>

  <Card title="Official MCP servers" icon="github" href="https://github.com/modelcontextprotocol/servers">
    Reference implementations maintained by the MCP team.
  </Card>

  <Card title="Awesome MCP servers" icon="list" href="https://github.com/punkpeye/awesome-mcp-servers">
    Community-curated collection on GitHub.
  </Card>

  <Card title="Online directories" icon="globe">
    [mcpservers.org](https://mcpservers.org/), [mcp.so](https://mcp.so/), [glama.ai](https://glama.ai/mcp/servers)
  </Card>
</Columns>

## Adding a server with Cline's help

The fastest manual approach is to let Cline handle the setup. Paste a GitHub URL into the chat and Cline will clone the repo, build it, and write the configuration entry:

```text theme={null}
User:  Add the MCP server from https://github.com/modelcontextprotocol/servers/tree/main/src/brave-search

Cline: Cloning the repository. It needs to be built — should I run "npm run build"?

User:  Yes

Cline: Build complete. This server requires a BRAVE_API_KEY environment variable.
       Where should I find it?
```

Cline handles dependencies and writes the configuration entry; you supply credentials.

## Editing the configuration file directly

To add or modify a server manually:

<Steps>
  <Step title="Open the MCP Servers panel">
    Click the **MCP Servers** icon (plug icon) in Cline's top navigation bar.
  </Step>

  <Step title="Go to the Configure tab">
    Select the **Configure** tab, then click **Configure MCP Servers**. This opens `cline_mcp_settings.json` in your editor.
  </Step>

  <Step title="Add your server entry">
    Add a key inside the `mcpServers` object. The key is your server's display name. See the config formats below.
  </Step>

  <Step title="Save the file">
    Cline detects the change automatically and launches the new server. No restart required.
  </Step>
</Steps>

## Configuration formats

### stdio transport (local servers)

Use this format for servers that run as a local process on your machine. Cline spawns the process and communicates via standard input/output.

```json theme={null}
{
  "mcpServers": {
    "brave-search": {
      "command": "node",
      "args": ["/Users/you/Documents/Cline/MCP/brave-search/build/index.js"],
      "env": {
        "BRAVE_API_KEY": "BSA1abc23def456..."
      },
      "alwaysAllow": ["brave_web_search"],
      "disabled": false
    }
  }
}
```

**Required fields for stdio servers:**

| Field     | Type      | Description                                                                                |
| --------- | --------- | ------------------------------------------------------------------------------------------ |
| `command` | string    | The executable to run: `node`, `python`, `python3`, or an absolute path to a binary.       |
| `args`    | string\[] | Arguments passed to the command. Usually the path to the built server entry point.         |
| `env`     | object    | Environment variables injected into the server process. Use this for API keys and secrets. |

**Optional fields:**

| Field         | Type      | Default | Description                                                        |
| ------------- | --------- | ------- | ------------------------------------------------------------------ |
| `alwaysAllow` | string\[] | `[]`    | Tool names that Cline can call without asking for approval.        |
| `disabled`    | boolean   | `false` | Set to `true` to keep the config but stop the server from running. |
| `timeout`     | number    | `60`    | Seconds to wait for a server response before timing out.           |

### SSE transport (remote servers)

Use this format to connect to a server running at a remote URL. Cline connects over HTTP using Server-Sent Events or Streamable HTTP.

```json theme={null}
{
  "mcpServers": {
    "my-remote-server": {
      "url": "https://mcp.example.com/sse",
      "headers": {
        "Authorization": "Bearer eyJhbGciOiJSUzI1..."
      },
      "alwaysAllow": [],
      "disabled": false
    }
  }
}
```

**Required fields for remote servers:**

| Field | Type   | Description                                |
| ----- | ------ | ------------------------------------------ |
| `url` | string | The full URL of the server's MCP endpoint. |

**Optional fields:**

| Field         | Type      | Description                                                               |
| ------------- | --------- | ------------------------------------------------------------------------- |
| `headers`     | object    | HTTP headers to include with every request (e.g. `Authorization`).        |
| `type`        | string    | Transport protocol: `"streamableHttp"` (recommended) or `"sse"` (legacy). |
| `alwaysAllow` | string\[] | Tool names that Cline can call without approval.                          |
| `disabled`    | boolean   | Disable the server without removing its config.                           |
| `timeout`     | number    | Seconds to wait for a server response.                                    |

### Choosing between stdio and SSE

|              | stdio                                  | SSE / Streamable HTTP             |
| ------------ | -------------------------------------- | --------------------------------- |
| **Location** | Same machine as Cline                  | Any networked server              |
| **Setup**    | Simple — just a command and args       | Requires a running HTTP server    |
| **Clients**  | One Cline instance per server          | Multiple clients simultaneously   |
| **Latency**  | Very low (no network)                  | Network round-trip                |
| **Security** | Inherently local                       | Requires HTTPS + auth headers     |
| **Best for** | Local tools, file access, CLI wrappers | Shared services, SaaS APIs, teams |

## A complete real-world example

The following shows a config file with both a local Node.js server and a remote SSE server:

```json theme={null}
{
  "mcpServers": {
    "filesystem": {
      "command": "node",
      "args": ["/Users/you/Documents/Cline/MCP/filesystem/build/index.js"],
      "env": {
        "ALLOWED_DIRS": "/Users/you/projects"
      },
      "alwaysAllow": ["read_file", "list_directory"],
      "disabled": false,
      "timeout": 30
    },
    "analytics-db": {
      "url": "https://internal.company.com/mcp-analytics",
      "headers": {
        "Authorization": "Bearer your-internal-token",
        "X-Team": "engineering"
      },
      "alwaysAllow": [],
      "disabled": false,
      "timeout": 120
    }
  }
}
```

## Managing servers

### Enable and disable

Toggle the switch next to a server in the **MCP Servers** panel to enable or disable it. Disabling a server stops the process but keeps its configuration — set `"disabled": true` directly in the JSON for the same effect.

### Restart a server

If a server becomes unresponsive, click **Restart Server** in the server's detail panel. This kills and re-spawns the process without touching configuration.

### Delete a server

Click the trash icon or the **Delete Server** button in the server detail panel. This removes the entry from `cline_mcp_settings.json` immediately — there is no confirmation dialog.

<Warning>
  Deleting a server removes its configuration but does not delete any installed files. Remove the server directory from `~/Documents/Cline/MCP/` manually if you want to free disk space.
</Warning>

### Network timeout

Each server can have its own timeout. Set the `timeout` field (in seconds) in the JSON, or adjust it via the server detail panel slider (30 seconds to 1 hour). The default is 60 seconds. Increase this for servers that make slow upstream API calls.

## Global MCP mode

You can control how much MCP contributes to every request's token usage:

1. Click the **MCP Servers** icon.
2. Select the **Configure** tab.
3. Click **Advanced MCP Settings**.
4. Find the `Cline > Mcp: Mode` setting and choose your preference.

Reducing MCP mode can help lower costs if you have many servers configured but only use a few of them regularly.

## Using MCP tools in chat

After configuring a server, Cline detects its available tools automatically. When you send a message:

1. Cline evaluates whether any tool could help.
2. If so, it proposes a tool call and shows the input it would send.
3. You approve (or deny) the call.
4. The result is returned to Cline and incorporated into the response.

Tools listed in `alwaysAllow` skip the approval prompt entirely.

## Troubleshooting

| Issue                          | Solution                                                                       |
| ------------------------------ | ------------------------------------------------------------------------------ |
| Server not responding          | Check that the process is running; verify network connectivity for SSE servers |
| Permission denied / auth error | Confirm API keys and tokens are set correctly in `env` or `headers`            |
| Tool not appearing             | Ensure the server implements the tool and it is not listed as `disabled`       |
| Slow responses                 | Increase the server's `timeout` value                                          |
| Config changes not picked up   | Save the file — Cline watches for changes automatically                        |

## Related

* [MCP overview](/mcp/mcp-overview)
* [MCP Marketplace](/mcp/mcp-marketplace)
* [Building a custom MCP server](/mcp/mcp-server-development-protocol)
