How to Add an MCP Server to Cline
Extend Cline with a Model Context Protocol server so the agent can use external tools like a filesystem or web fetch.
The Model Context Protocol, or MCP, lets agents call external tools through a standard interface. Cline supports MCP servers, which means you can give the agent abilities like fetching web pages, querying a database, or browsing a sandboxed filesystem. This guide adds an MCP server to Cline and confirms the new tools appear.
What you need
- Cline installed and connected to a model
- Node.js installed so npx can run server packages
- About 9 minutes
Step 1: Open the MCP servers panel
In the Cline panel, open the menu and choose MCP Servers. This view lists installed servers and has an option to edit the configuration file directly. The config is JSON and maps a server name to the command that launches it.
Step 2: Add a server to the config
Click Edit Configuration to open the JSON file. Add an entry under mcpServers with a command and its arguments. The example below adds the official filesystem server, scoped to a single project directory so the agent cannot reach outside it.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/you/projects/demo"
]
}
}
}Step 3: Save and let the server start
Save the file. Cline launches the server with npx, which downloads the package on first use. When it connects, the server appears in the MCP Servers list with a green status dot and its available tools listed underneath.
Step 4: Use the new tools in a task
Give Cline a task that needs the tool, such as list every Markdown file in the project and summarize each one. The agent now calls the MCP tools to do it, asking for approval just like any other action.
Result
Cline now has access to an MCP server and its tools, scoped safely to one directory. You can extend the agent with any MCP-compatible server the same way, growing what it can do without changing the extension itself.
Watch related tutorials
12:36
18:52
14:05
22:40
7:18
14:27