Client Integration
Connect your MCP servers to Claude Desktop, Claude Code CLI, Cline, Kilocode, and custom applications.
Claude Desktop
Claude Desktop is the most popular MCP client. Configure it by editing the claude_desktop_config.json file:
# macOS ~/Library/Application Support/Claude/claude_desktop_config.json # Windows %APPDATA%\Claude\claude_desktop_config.json # Linux ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/you/Documents",
"/Users/you/Projects"
]
},
"weather": {
"command": "node",
"args": ["/path/to/weather-server/dist/index.js"]
},
"python-server": {
"command": "python",
"args": ["/path/to/server.py"]
}
}
}
Claude Code CLI
Claude Code supports MCP servers through its configuration. Add servers using the claude mcp command:
# Add a stdio MCP server claude mcp add filesystem npx -y @modelcontextprotocol/server-filesystem /path/to/dir # Add a custom server claude mcp add weather node /path/to/weather-server/dist/index.js # Add a Python server claude mcp add my-server python /path/to/server.py # List configured servers claude mcp list # Remove a server claude mcp remove weather
Cline (VS Code Extension)
Cline supports MCP servers through its VS Code settings. Open the Cline MCP settings panel:
-
Open Cline Settings
Click the Cline icon in the VS Code sidebar, then click the server icon (MCP Servers) at the top of the panel.
-
Add Server Configuration
Click "Edit MCP Settings" to open the configuration file. Add your server:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/allowed/directory"
],
"disabled": false
}
}
}
Kilocode (VS Code Extension)
Kilocode uses the same MCP configuration format as Cline. Access MCP settings from the Kilocode panel in VS Code:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
}
}
}
Multi-Server Setup
You can connect multiple MCP servers simultaneously. Each server provides its own set of tools, resources, and prompts:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user"]
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"POSTGRES_CONNECTION_STRING": "postgresql://localhost/mydb"
}
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..."
}
},
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "BSA..."
}
}
}
}
Environment Variables
Pass environment variables to MCP servers using the env field. This is commonly used for API keys and connection strings:
{
"my-server": {
"command": "node",
"args": ["dist/index.js"],
"env": {
"API_KEY": "sk-...",
"DATABASE_URL": "postgresql://...",
"LOG_LEVEL": "debug"
}
}
}
Debugging Connections
When an MCP server fails to connect, use these debugging strategies:
-
Check the server logs
For Claude Desktop, open Developer Tools (Help → Toggle Developer Tools) and check the Console tab. Look for MCP-related error messages.
-
Test the server manually
Run the server command directly in your terminal to verify it starts without errors.
-
Use the MCP Inspector
Run
npx @modelcontextprotocol/inspectorto test your server interactively and see JSON-RPC messages. -
Verify paths and permissions
Ensure all file paths are absolute and the server binary/script has execute permissions.
What's Next?
The next lesson explores popular community MCP servers you can install and use right away.
Lilly Tech Systems