Connect MCP servers to the Cline VS Code extension for agentic coding.
Cline is a VS Code extension that acts as an autonomous coding agent. It supports Model Context Protocol (MCP) servers so the agent can use external tools beyond built-in file operations — official reference servers for filesystem access, persistent memory, Git, web fetch, and more.
PREREQUISITES
From the official modelcontextprotocol/servers repository:
- Node.js 18+ for npx servers (Filesystem, Memory, Sequential Thinking, Everything)
- uv / uvx for Python servers (Git, Fetch, Time)
Test in a terminal before configuring Cline:
npx -y @modelcontextprotocol/server-memory
uvx mcp-server-fetch
OPENING MCP SETTINGS IN CLINE
Cline exposes MCP configuration inside the extension panel:
1. Open VS Code (or a VS Code fork) with Cline installed.
2. Open the Cline sidebar / panel.
3. Navigate to MCP Servers (wording may appear as "MCP" or a server icon in the Cline UI).
4. Add a server via JSON config or the built-in form, depending on your Cline version.
Because Cline releases frequently, menu labels can differ. If you cannot find MCP settings, consult Cline's official documentation or GitHub repository for the current location.
CONFIG STRUCTURE
Cline accepts the same command/args pattern documented for Claude Desktop in the official MCP servers README:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/allowed/dir"
]
}
}
}
On Windows, use cmd /c for npx:
{
"mcpServers": {
"filesystem": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-filesystem",
"C:\\Users\\you\\project"
]
}
}
}
EXAMPLE: FILESYSTEM + MEMORY
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/you/project"
]
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
}
Optional Git server for the same repo (Python, uvx — no Windows cmd wrapper):
{
"mcpServers": {
"git": {
"command": "uvx",
"args": ["mcp-server-git", "--repository", "/Users/you/project"]
}
}
}
Install command from official README: uvx mcp-server-git --repository path/to/git/repo
USING MCP TOOLS WITH CLINE
Once connected, Cline's agent can propose tool calls to MCP servers during tasks — reading allowed directories, storing entities in Memory, fetching URLs via Fetch, etc. Review Cline's approval settings: you may want to confirm destructive filesystem operations before execution.
TROUBLESHOOTING
- Server not listed: Confirm JSON is valid and the command works in an external terminal.
- Permission errors: Check allowed directory paths and repository paths exist.
- uvx not found: Install uv from Astral's documentation and ensure uvx is on PATH visible to VS Code.
SECURITY
Cline can chain multiple tool calls autonomously. Limit filesystem roots to the workspace. Remember that reference servers are educational — evaluate risks before connecting production databases or credentials.
REFERENCES
- Official MCP servers: https://github.com/modelcontextprotocol/servers
- Cline MCP docs: see the Cline extension documentation for version-specific steps.