Intermediate

Using MCP with Claude Desktop

Claude Desktop can connect to MCP servers, giving the desktop app access to your local files, databases, and any other tool you configure. Setup is done through a single JSON config file — no coding required to use existing servers.

Config File Location

Claude Desktop reads MCP server config from:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

If the file does not exist, create it. Claude Desktop reads it at startup — changes require a restart to take effect.

Config Format

The config file is a JSON object with an mcpServers key. Each entry under mcpServers is a named server configuration:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/yourname/Documents"
      ]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

Each server entry has:

  • command — the executable to run (e.g., npx, python, node)
  • args — arguments passed to the command
  • env (optional) — environment variables injected into the server process, used for API keys and credentials

Adding a Local stdio Server

Most community MCP servers use stdio transport — they run as local processes. To add the filesystem server (gives Claude read/write access to a directory):

  1. Install Node.js if not already installed (required for npx)
  2. Open (or create) claude_desktop_config.json
  3. Add the server entry shown above, replacing the path with a directory you want Claude to access
  4. Save the file and restart Claude Desktop

Claude Desktop will launch the server process in the background when it starts. The server process is terminated when Claude Desktop closes.

Adding a Remote SSE Server

For servers running as HTTP services (SSE transport), use the url key instead of command:

{
  "mcpServers": {
    "my-remote-server": {
      "url": "https://my-mcp-server.example.com/mcp",
      "headers": {
        "Authorization": "Bearer my-api-key"
      }
    }
  }
}

Testing: Verifying a Connection

After restarting Claude Desktop, verify the server is connected by asking Claude directly:

  • "What tools do you have access to?" — Claude will list all available tools including those from MCP servers
  • "List the files in my Documents folder" — if the filesystem server is configured correctly, Claude will execute the tool and return results
  • Check the Claude Desktop developer logs for connection errors if tools do not appear

A healthy connection shows the server's tools in Claude's tool list immediately. If the tools are missing, common causes: the server process failed to start (check the command/args), Node.js is not on the PATH, or the config JSON is malformed.

Security Considerations

  • Store API keys and credentials in the env block — do not hardcode them in args where they may appear in process listings
  • Limit filesystem server access to specific directories — not your entire home folder
  • Review what each server can do before adding it — MCP servers run with your user's permissions
  • Use a separate token with minimal permissions when connecting to GitHub or other services

Checklist: Do You Understand This?

  • Config file: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
  • Each server entry needs command + args (stdio) or url (SSE); use env for credentials
  • Changes require a Claude Desktop restart to take effect
  • Test by asking Claude "what tools do you have access to?" after restart
  • Scope filesystem access to specific directories; use minimal-permission tokens for service integrations

Page built: 01 Jun 2026