Skip to main content
An MCP Host is an AI application that connects to MCP servers to extend its capabilities. Users interact with the host, while MCP servers provide the back-end tools and data. This lesson shows you how to configure the most popular hosts.

Claude Desktop

Anthropic’s official desktop app with native MCP support.

VS Code + GitHub Copilot

Agent mode in VS Code with MCP server connections via .vscode/mcp.json.

Cursor

AI-first code editor with MCP server support.

Cline & Windsurf

Community editors and extensions with MCP integration.

Prerequisites

  • A working MCP server (see Building Your First Server)
  • The host application installed
  • Basic familiarity with JSON configuration files

Claude Desktop

Claude Desktop uses a JSON config file to define which MCP servers are available.

Configuration file location

OSPath
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json
Linux~/.config/Claude/claude_desktop_config.json

Configuration format

{
  "mcpServers": {
    "calculator": {
      "command": "python",
      "args": ["-m", "mcp_calculator_server"],
      "env": {
        "PYTHONPATH": "/path/to/your/server"
      }
    },
    "weather": {
      "command": "node",
      "args": ["/path/to/weather-server/build/index.js"]
    },
    "database": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "DATABASE_URL": "postgresql://user:pass@localhost/mydb"
      }
    }
  }
}

Configuration fields

FieldDescription
commandExecutable to launch the server
argsArray of command-line arguments
envEnvironment variables for the server process
1

Open the config file

Navigate to the configuration file path for your OS. Create it if it doesn’t exist.
2

Add your server

Add an entry under "mcpServers" with command, args, and optional env.
3

Restart Claude Desktop

Close and reopen Claude Desktop. Your server should appear in the tools list.
4

Verify connection

In a Claude conversation, click the tools icon. You should see your server’s tools listed.

VS Code (GitHub Copilot Agent mode)

VS Code uses a workspace-level .vscode/mcp.json file. This was covered in detail in VS Code Integration.
{
  "inputs": [
    {
      "type": "promptString",
      "id": "api-key",
      "description": "API Key",
      "password": true
    }
  ],
  "servers": {
    "my-server": {
      "type": "stdio",
      "command": "python",
      "args": ["server.py"],
      "env": {
        "API_KEY": "${input:api-key}"
      }
    }
  }
}

Cursor

Cursor supports MCP servers through its settings.
1

Open Cursor Settings

Go to Cursor Settings → Features → MCP.
2

Add a new server

Click Add new MCP server and fill in the server details:
{
  "mcpServers": {
    "my-calculator": {
      "command": "python",
      "args": ["/path/to/mcp_calculator_server.py"]
    }
  }
}
3

Enable the server

Toggle the server on. Cursor will start the server process and make its tools available in Composer and Chat.

Cline

Cline is a VS Code extension with MCP support.
1

Open Cline settings

Click the Cline extension icon → MCP Servers → Edit Config.
2

Add your server

{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["/path/to/build/index.js"],
      "env": {
        "API_KEY": "your-key"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Transport types

All hosts support both transport types:
TransportConfigurationUse case
stdio"type": "stdio" with command + argsLocal servers — host manages process lifecycle
sse / http"type": "sse" with urlRemote servers running independently

SSE server example

{
  "servers": {
    "remote-server": {
      "type": "sse",
      "url": "http://localhost:8080/sse",
      "headers": {
        "Authorization": "Bearer my-token"
      }
    }
  }
}

Troubleshooting

  • Check the config file for JSON syntax errors (use a JSON validator)
  • Verify the command path is correct and the executable is available in your PATH
  • Restart the host application after changes
  • Check the host’s logs for startup errors
  • Test the command manually in a terminal first: python server.py
  • Ensure all dependencies are installed (pip install -r requirements.txt)
  • Check that environment variables like API_KEY are set correctly
  • Use the MCP Inspector to test your server independently of the host
  • Check the server’s error output in the host’s developer tools or logs
  • Verify tool parameter schemas match what you’re sending

Key takeaways

  • Each MCP host reads a JSON config file that maps server names to their startup command and args.
  • For stdio servers, the host manages the process — no port configuration needed.
  • For remote servers, use sse transport with a url pointing to your server.
  • Always test your server with the MCP Inspector before configuring it in a host.

Build docs developers (and LLMs) love