TL;DR — Key Takeaways
- Claude Code:
mcpServersin.claude/settings.json - Cursor: MCP section in settings UI or
~/.cursor/settings.json - Cline: MCP Servers panel in VS Code sidebar
- Debug:
claude mcp list→ check status and error logs
MCP Configuration Across Tools
The Model Context Protocol (MCP) is an open standard, which means the same MCP server can work with Claude Code, Cursor, and Cline — each connecting via its own configuration method. Once you've found or built an MCP server, connecting it to your AI tools is a matter of providing the server's startup command and any required environment variables.
This guide covers the exact configuration for each major AI coding tool, with working examples for the most common servers.
How MCP Client-Server Connection Works
MCP servers are standalone processes. When an AI tool starts, it reads its MCP configuration and launches each configured server as a subprocess. Communication happens over stdio (standard input/output) using the MCP protocol.
The general pattern for any tool:
- Configure the server: command to run, arguments, environment variables
- The tool starts the server process when it launches
- The server registers its tools/resources with the client
- The AI can now call those tools like any other capability
All three major tools (Claude Code, Cursor, Cline) support this pattern — just with different configuration locations and syntax.
Connecting MCP Servers to Claude Code
Claude Code reads MCP server configuration from .claude/settings.json in the project directory (project-scoped) or ~/.claude/settings.json in your home directory (user-scoped, applies across all projects).
Basic connection:
{
"mcpServers": {
"my-server": {
"command": "node",
"args": ["/absolute/path/to/server/dist/index.js"]
}
}
}
With environment variables:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"POSTGRES_URL": "postgresql://localhost/myapp_dev"
}
}
}
}
Multiple servers in one config:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/projects"]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
},
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "your_brave_api_key"
}
}
}
}
Verifying the connection:
claude mcp list
This shows all configured servers and their status (running, stopped, error). To get details on a specific server:
claude mcp get postgres
To check available tools from within a Claude Code session:
/mcp
This shows connected servers and the tools they expose.
Connecting MCP Servers to Cursor
Cursor added MCP support and reads its configuration from ~/.cursor/settings.json (global) or from the project-level Cursor settings.
Via the Cursor UI:
- Open Cursor Settings (Cmd/Ctrl + Shift + J)
- Navigate to the "MCP" section
- Click "Add Server"
- Fill in the server name, command, arguments, and environment variables
- Save — Cursor restarts the server connection
Via ~/.cursor/settings.json directly:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"POSTGRES_URL": "postgresql://localhost/myapp_dev"
}
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
}
}
}
The schema is nearly identical to Claude Code's configuration — the mcpServers key with the same command, args, env structure. If you have a working Claude Code config, the same server definitions work in Cursor with minimal changes.
Verifying in Cursor: Open a Cursor Chat (Cmd/Ctrl + K or the chat panel). In Agent mode, the connected MCP tools appear in the tool selection — you should see your server's tools listed.
Connecting MCP Servers to Cline
Cline (formerly Claude Dev) integrates MCP server configuration through the VS Code sidebar panel.
Via the Cline MCP Servers panel:
- Open VS Code
- Find the Cline extension in the sidebar
- Click the "MCP Servers" section
- Click "Add Server"
- Enter the server name, command, and arguments
- Add any required environment variables
- Save — Cline will start the server
Via cline_mcp_settings.json directly:
Cline stores its MCP configuration in:
- Windows:
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json - Mac:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
The format:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"POSTGRES_URL": "postgresql://localhost/myapp_dev"
},
"disabled": false,
"alwaysAllow": []
}
}
}
The disabled and alwaysAllow fields are Cline-specific:
disabled: truestops the server without removing its configalwaysAllow: ["tool_name"]auto-approves specific tools without prompting
Using the Same Server in Multiple Tools
A single MCP server can be connected to Claude Code, Cursor, and Cline simultaneously. Each tool starts its own instance of the server process — they don't share the same process, but they use the same server code.
Practical benefit: You configure and build an MCP server once, then add the same configuration (with the same command, args, env) to each tool's config file. All three tools then have access to the same capabilities.
For shared team MCP servers (hosted instead of running locally):
{
"mcpServers": {
"team-tools": {
"command": "node",
"args": ["/shared/team-mcp-server/dist/index.js"],
"env": {
"INTERNAL_API_KEY": "shared-key-here"
}
}
}
}
Teams can run a shared MCP server on an internal host and have all developers connect to the same instance — this is the pattern for internal tooling servers (deploy pipelines, feature flags, error tracking).
Common Configuration Mistakes and Fixes
Problem: Server not showing up after configuration
# Check status:
claude mcp list
# Common causes:
# 1. Wrong path — use absolute paths, not relative
# 2. Server crashes on startup — check with: claude mcp get <server-name>
# 3. JSON syntax error in settings.json — validate the JSON
# 4. Package not installed — the npx -y flag installs it automatically
Problem: Server starts but tools don't work
# Symptom: Claude says it can't find tool 'X'
# Fix: Confirm tool names with /mcp — tool names are case-sensitive
# Fix: Confirm server initialized without errors
Problem: Environment variables not passed
// Wrong — string concatenation doesn't work in JSON env
{
"env": {
"POSTGRES_URL": "postgresql://localhost/" + process.env.DB_NAME
}
}
// Right — hardcode the full URL or reference from shell env
{
"env": {
"POSTGRES_URL": "postgresql://localhost/myapp_dev"
}
}
Problem: npx is slow because it installs every time
// Faster — install the package globally first, then use node directly:
// npm install -g @modelcontextprotocol/server-postgres
{
"command": "mcp-server-postgres",
"args": []
}
Tool-Specific Notes
Claude Code: The most mature MCP integration as of 2026, since MCP was designed by Anthropic. The /mcp slash command provides real-time server status and tool listings.
Cursor: MCP support added in 2025. Works well in Composer Agent mode. Some servers that use streaming responses may have compatibility limitations — test with the specific server.
Cline: The alwaysAllow setting is particularly useful for automation workflows where you don't want to approve every tool call manually. For trusted servers, set alwaysAllow for the tools you use most.
Key Takeaways
- All three major tools (Claude Code, Cursor, Cline) use nearly identical MCP configuration:
command,args,envunder amcpServerskey - Claude Code:
.claude/settings.json(project) or~/.claude/settings.json(user-level) - Cursor:
~/.cursor/settings.jsonor via the Settings MCP panel - Cline:
cline_mcp_settings.jsonin VS Code global storage, or via the Cline sidebar - The same server config works across all three tools — configure once, share the config
- Verify Claude Code connections with
claude mcp listor/mcpin-session - Use absolute paths in
argsto avoid path resolution issues
Related: Model Context Protocol (MCP): The Complete Developer Guide · Claude Code MCP Servers: What They Are & How to Use · MCP Server Examples and Use Cases