How to Integrate MCP with Cline in VS Code
Connect Cline to local and remote MCP servers in VS Code, fix 405 errors, secure credentials, and automate screenshots with ScreenshotNeo.

Direct answer: Install the Cline extension, open its MCP Servers panel, choose Configure MCP Servers, and add a server under the top-level mcpServers object. Use a command and arguments for a local STDIO server. Use a complete URL, type: 'streamableHttp', and any required headers for a hosted server. Save the file, enable the server, and confirm that its tools appear in Cline.
MCP (Model Context Protocol) lets Cline use external tools and data sources through MCP servers. Cline can start a local process on your machine or connect to a hosted server over Streamable HTTP. The two transports have different configuration, credential, latency, and troubleshooting considerations.
What you need before starting
- Visual Studio Code with the Cline extension installed and enabled.
- An MCP server you trust. You need either its local launch command or its hosted endpoint.
- Credentials supplied by the server, preferably stored in environment variables or secret storage.
- Permission to run local processes if you choose STDIO.
Keep Cline’s configuration separate from VS Code’s native MCP configuration. Cline opens its own JSON file from the Cline panel and expects mcpServers. VS Code’s native configuration normally uses .vscode/mcp.json with a top-level servers object. Adding a server to one does not prove that the other has loaded it. See the Cline documentation and VS Code MCP documentation for current UI details.
Configure a local MCP server with STDIO
STDIO starts the MCP server as a child process on the same computer as VS Code. It is useful for scripts, local databases, private repositories, and tools that should not be exposed on a network.

- Open VS Code and install or open Cline.
- In the Cline panel, select the MCP Servers icon in the top toolbar.
- Open the Configure tab and select Configure MCP Servers.
- Add a named entry below
mcpServers. - Save the file, return to the MCP panel, and enable the server.
- Start a Cline task and check that the server’s tools are listed before asking Cline to call one.
{
"mcpServers": {
"local-server": {
"command": "node",
"args": ["/absolute/path/to/server.js"],
"env": {
"API_KEY": "your_api_key"
},
"disabled": false,
"autoApprove": []
}
}
}
Use an absolute path when possible. The command must be available in the environment used by VS Code, which can differ from the shell in your terminal. For Python servers, the command might be python or an absolute virtual-environment path, with the script in args. For package-based servers, put package arguments in the same array and avoid shell-only syntax that requires a shell wrapper.
Configuration fields
| Field | Purpose | Practical guidance |
|---|---|---|
command |
Executable used to start the server. | Use an installed executable or an absolute path. |
args |
Command-line arguments. | Keep each argument as a separate array item. |
env |
Environment variables passed to the process. | Put API keys here instead of hard-coding them in source files. |
disabled |
Temporarily prevents startup. | Set to false when the server should be available. |
autoApprove |
Tools Cline may call without an interactive approval. | Leave empty until you understand each tool’s effects. |
Connect a hosted server with Streamable HTTP
A remote server runs elsewhere and exposes an MCP endpoint. This is convenient when several machines or developers need the same service, but it moves authentication and network troubleshooting into the setup.
- Open the Cline MCP Servers panel.
- Choose the Remote Servers tab, or edit the JSON directly.
- Set the complete endpoint in
url. - Set
typeto the exact camel-case valuestreamableHttp. - Add authorization or other required headers.
- Save, enable the server, and inspect the discovered tools.
{
"mcpServers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"type": "streamableHttp",
"disabled": false,
"headers": {
"Authorization": "Bearer <YOUR_GITHUB_PAT>"
},
"autoApprove": []
}
}
}
The transport spelling matters. Cline’s GitHub MCP guidance requires streamableHttp. Values such as streamable-http, or omitting the field, can cause Cline to fall back to SSE and produce an HTTP 405 response.
Local versus remote transport
| Decision | STDIO | Streamable HTTP |
|---|---|---|
| Where it runs | On the same computer as VS Code. | On a hosted service or another machine. |
| Credentials | Environment variables or local secret files. | Request headers, usually an authorization token. |
| Sharing | Each user installs and maintains the process. | One endpoint can serve multiple clients. |
| Latency | Usually avoids a network hop. | Depends on network and server response time. |
| Failure surface | Executable path, dependencies, permissions, process logs. | URL, DNS, TLS, authentication, transport type, and server availability. |
Verify that Cline discovered the tools
Do not treat a saved JSON file as a successful connection. In the MCP panel, check that the server is enabled and that its tool list is visible. Ask Cline for a harmless read-only operation first. If the tool list is empty, inspect the server process or HTTP response before changing task prompts.
- Confirm the server name is unique and nested under
mcpServers. - Check that
disabledis nottrue. - For STDIO, run the command manually from a terminal using the same path and environment.
- For HTTP, open the exact endpoint configuration and verify the authorization header.
- Increase Cline’s MCP timeout when the server is valid but slow to initialize or respond.
- Restart or reload Cline after changing configuration if the panel still shows stale status.
Common errors and fixes
HTTP 405 or “method not allowed”
Cause: Cline is using the wrong transport or has fallen back to SSE. Fix: set "type": "streamableHttp" exactly, including capitalization, and use the endpoint supplied by the server. Do not substitute streamable-http.
Server does not appear in the panel
Cause: The entry is in VS Code’s native MCP file, malformed JSON, disabled, or outside the top-level mcpServers object. Fix: open the file from Cline’s MCP Servers panel, validate commas and braces, and confirm the entry is enabled.
“Command not found” or immediate process exit
Cause: VS Code cannot find the executable, a dependency is missing, or the script path is relative. Fix: use an absolute command and script path, install dependencies in the intended environment, and run the same command manually. Check file permissions on macOS and Linux.
Unauthorized, forbidden, or empty tool list
Cause: Missing, expired, or incorrectly formatted credentials. Fix: confirm the header name and token prefix required by the server, rotate expired tokens, and pass secrets through env or headers rather than committing them.
Connection timeout
Cause: Slow startup, a blocked network request, or a server that is waiting on an upstream dependency. Fix: test the endpoint independently, check DNS and proxy settings, and increase the MCP timeout when the server is healthy but slow. Avoid masking repeated failures with an extremely long timeout.
Tools work once and then disappear
Cause: The local process is crashing or the remote session is expiring. Fix: inspect process output, memory usage, token expiry, and server logs. Configure the server’s keep-alive or reauthentication behavior according to its documentation.
Security and approval choices
Only install MCP servers from sources you trust. A local MCP server is executable code with the permissions of the process that starts it. Review the publisher, repository, install script, command, arguments, and environment variables before enabling it.
Keep autoApprove restrictive. Read-only tools that inspect a file or query a safe endpoint may be appropriate after review; tools that delete files, modify repositories, send messages, or make purchases should require an explicit approval. Store tokens outside source control, use the narrowest server permissions available, and remove credentials from logs and screenshots.
Using Cline’s CLI to manage servers
Cline’s CLI includes an MCP wizard for listing, adding, editing, enabling, disabling, and deleting servers. For scripts or audits, the documentation also lists:
cline config mcp
cline config mcp --json
Use the interactive wizard when you need prompts and validation. Use the JSON form when you need to inspect configuration in automation. Keep the CLI-managed configuration aligned with the file opened by the Cline extension.
Or skip the browser setup
If your Cline workflow needs screenshots, ScreenshotNeo provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, Cline, and other MCP clients. It removes cookie and consent banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and each response reports the result through X-Page-Verdict and X-Billed headers.
You can also call the API directly. See the ScreenshotNeo API documentation for the complete option list.
cURL
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo supports full-page and element captures, dark mode, device presets, custom viewports, retina scale, PDF output, custom CSS and JavaScript, clicks, waits, blocked resources, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, caching, signed links, asynchronous jobs, bulk capture, usage reporting, and an OpenAPI specification. Only clean shots are billed. The free plan includes 1,000 screenshots each month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
Performance, reliability, and cost considerations
For local STDIO, startup time is often dominated by loading the runtime and dependencies. Keep a server process warm when the client supports it, avoid unnecessary initialization, and return small tool payloads. For remote HTTP, reduce avoidable round trips, select a nearby deployment when the provider offers one, and set a timeout that matches the operation rather than waiting indefinitely.

Reliability improves when tools are narrow and idempotent. Return structured errors that explain whether a failure is authentication, validation, an upstream timeout, or a transient server condition. For jobs that can be retried, use request identifiers or other deduplication controls so a retry does not repeat an irreversible action. Monitor local process exits and remote HTTP status codes.
Cost depends on the MCP server and any downstream APIs it calls. Limit automatic approvals and high-volume loops. For ScreenshotNeo, cache hits and failed or unusable captures are not billed; choose a cache TTL when repeated URLs do not need a fresh render, and use bulk capture for up to 100 URLs per call when that fits the workflow.
FAQ
Does Cline use the same MCP file as VS Code?
No. Cline manages its own settings from the Cline MCP Servers panel and uses mcpServers. VS Code’s native configuration uses a different surface and schema.
Can I use both local and remote servers?
Yes. Add separate entries under mcpServers, using command for local STDIO and url plus streamableHttp for hosted servers.
Why is the transport value camel case?
Cline’s hosted MCP configuration expects the exact value streamableHttp. A different spelling can trigger SSE fallback and a 405 response.
Should every tool be auto-approved?
No. Start with an empty autoApprove list and add only tools whose effects you understand and accept.
Can Cline use ScreenshotNeo without writing browser automation?
Yes. Install ScreenshotNeo’s MCP server through its documented setup, or call its screenshot endpoint directly with cURL, Python, or Node.js.


