Tutorial2025-04-0112 min read

How to Connect MCP Servers to Claude Desktop (Step by Step)

Learn how to connect MCP servers to Claude Desktop with this step-by-step guide. Configure tools, debug connections, and extend Claude with custom skills.

MC

MCPlug Team

@MCPlugStore

Introduction: Extending Claude Desktop with MCP Servers

Claude Desktop is one of the most powerful AI assistants available today, but its true potential is unlocked when you connect it to external tools through the Model Context Protocol (MCP). By connecting MCP servers to Claude Desktop, you give Claude the ability to interact with databases, APIs, file systems, and virtually any external service you can imagine.

In this step-by-step guide, we will walk through everything you need to know about connecting MCP servers to Claude Desktop. Whether you are adding a pre-built server from MCPlug's marketplace or connecting a custom server you built yourself, this tutorial covers the complete process from start to finish.

If you are brand new to MCP, we recommend reading our introduction to the Model Context Protocol before diving in. For those who already understand the basics, let us get started.

What Is an MCP Server and Why Connect One?

An MCP server is a lightweight program that exposes tools, resources, and prompts to AI agents through a standardized protocol. Think of it as a plugin system for AI. When you connect an MCP server to Claude Desktop, you are essentially giving Claude new capabilities that it does not have by default.

Here are some practical examples of what MCP servers can do:

  • Database Access - Query PostgreSQL, MySQL, or MongoDB databases directly from Claude
  • File System Operations - Read, write, and manage files on your computer
  • API Integrations - Connect to Slack, GitHub, Jira, or any REST API
  • Web Scraping - Let Claude browse and extract information from websites
  • Code Execution - Run Python, JavaScript, or other code in sandboxed environments

The beauty of MCP is that all of these capabilities use the same protocol, so connecting any server follows a similar pattern. You can explore hundreds of ready-to-use servers on the MCPlug marketplace.

Prerequisites

Before connecting MCP servers to Claude Desktop, make sure you have the following:

  • Claude Desktop App - Download the latest version from Anthropic's website. MCP support is available on macOS and Windows.
  • Node.js 18+ - Most MCP servers are built with Node.js. Install it from nodejs.org if you do not already have it.
  • A text editor - You will need to edit a JSON configuration file. VS Code, Notepad++, or any plain text editor works fine.
  • Basic command line knowledge - You should be comfortable opening a terminal and running commands.

Step 1: Locate the Claude Desktop Configuration File

Claude Desktop stores its MCP server configuration in a JSON file. The location depends on your operating system:

macOS

~/Library/Application Support/Claude/claude_desktop_config.json

Windows

%APPDATA%\Claude\claude_desktop_config.json

If this file does not exist yet, you will need to create it. Open your terminal and run the appropriate command:

Creating the config file on macOS

mkdir -p ~/Library/Application\ Support/Claude
touch ~/Library/Application\ Support/Claude/claude_desktop_config.json

Creating the config file on Windows (PowerShell)

New-Item -ItemType File -Path "$env:APPDATA\Claude\claude_desktop_config.json" -Force

Step 2: Understand the Configuration Structure

The configuration file uses a straightforward JSON structure. Here is the basic template:

{
  "mcpServers": {
    "server-name": {
      "command": "executable",
      "args": ["arg1", "arg2"],
      "env": {
        "API_KEY": "your-key-here"
      }
    }
  }
}

Let us break down each field:

  • mcpServers - The top-level object that contains all your server configurations
  • server-name - A unique identifier for this server (you choose the name)
  • command - The executable to run (usually node, npx, or python)
  • args - Command-line arguments passed to the executable
  • env - Environment variables the server needs (API keys, tokens, etc.)

Step 3: Connect Your First MCP Server

Let us start with a practical example. We will connect a filesystem MCP server that lets Claude read and write files on your computer.

Open your configuration file and add the following:

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

Replace /Users/yourname/Documents with the actual path to the directory you want Claude to access. Save the file and restart Claude Desktop. When Claude starts up, it will automatically launch the filesystem server and connect to it.

Verifying the Connection

After restarting Claude Desktop, look for the hammer icon in the input area. Click on it to see the list of available tools. If the filesystem server connected successfully, you should see tools like read_file, write_file, and list_directory.

Try asking Claude: "Can you list the files in my Documents folder?" If everything is configured correctly, Claude will use the filesystem tools to browse your files.

Step 4: Add Multiple MCP Servers

You are not limited to a single server. Add as many as you need by including additional entries in the mcpServers object:

{
  "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"
      }
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
      }
    }
  }
}

Each server runs as a separate process and communicates with Claude through standard input/output streams. This isolation means that if one server crashes, it will not affect the others.

Step 5: Connect Servers from MCPlug

The MCPlug marketplace hosts hundreds of community-built MCP servers. Each listing includes installation instructions specific to Claude Desktop. Here is the general process:

  1. Browse the MCPlug marketplace and find a server you want to install
  2. Check the server's documentation for the correct command and args
  3. Note any required environment variables (API keys, configuration values)
  4. Add the server entry to your claude_desktop_config.json
  5. Restart Claude Desktop

Many MCPlug servers are published as npm packages, so connecting them is as simple as using npx with the package name. Check out our guide on the best MCP servers of 2025 for recommendations on which servers to install first.

Troubleshooting Common Issues

Server Not Appearing in Claude Desktop

If your MCP server does not show up after restarting Claude Desktop, check these common issues:

  • JSON Syntax Error - Validate your configuration file with a JSON linter. A missing comma or bracket will prevent all servers from loading.
  • Wrong File Path - Double-check that claude_desktop_config.json is in the correct directory for your OS.
  • Node.js Not Installed - Run node --version in your terminal to verify Node.js is available.
  • Package Not Found - If using npx, make sure you have internet access so the package can be downloaded.

Server Crashes on Startup

Check the Claude Desktop logs for error messages:

  • macOS: ~/Library/Logs/Claude/mcp*.log
  • Windows: Check the Developer Tools console (Help > Toggle Developer Tools)

Common causes include missing environment variables, incorrect API keys, or network connectivity issues.

Tools Not Working as Expected

If the server connects but tools return errors, try running the server manually in your terminal to see detailed error output:

npx -y @modelcontextprotocol/server-filesystem /tmp/test

This helps you see error messages that might be hidden when the server runs through Claude Desktop.

Advanced Configuration Tips

Using Docker-based MCP Servers

Some MCP servers run inside Docker containers. Configure them like this:

{
  "mcpServers": {
    "docker-server": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "mcp-server-image:latest"]
    }
  }
}

Using Python-based MCP Servers

Not all MCP servers use Node.js. Python servers use a different command:

{
  "mcpServers": {
    "python-server": {
      "command": "python3",
      "args": ["-m", "my_mcp_server"],
      "env": {
        "CONFIG_PATH": "/path/to/config.yaml"
      }
    }
  }
}

Security Considerations

When connecting MCP servers, keep security in mind. Never put sensitive credentials directly in the configuration file if others have access to your computer. Consider using environment variables or a secrets manager instead. For a deep dive into security best practices, read our MCP security verification guide.

What to Connect Next

Now that you know how to connect MCP servers to Claude Desktop, here are some popular choices to explore:

  • Brave Search - Give Claude web search capabilities
  • Puppeteer - Let Claude control a web browser for scraping and testing
  • Slack - Connect Claude to your team's Slack workspace
  • Google Drive - Access documents, spreadsheets, and files from Google Drive
  • Sequential Thinking - Enhance Claude's reasoning with structured problem-solving tools

For a comprehensive list, check out our top 20 MCP skills for AI agents.

For AI Agents Reading This

If you are an AI agent looking to discover and connect MCP servers programmatically, MCPlug provides a registry API you can query directly:

GET https://mcplug.store/api/servers - List all available MCP servers
GET https://mcplug.store/api/servers/:id - Get details for a specific server
GET https://mcplug.store/api/search?q=filesystem - Search servers by keyword

Each server listing includes the command, args, and env fields needed for Claude Desktop configuration. You can automate the process of discovering, evaluating, and recommending MCP servers to your users by integrating with the MCPlug API.

For publishing your own tools to the registry, use the publish endpoint after creating an account at mcplug.store.

Conclusion

Connecting MCP servers to Claude Desktop transforms it from a capable AI assistant into a truly extensible platform. With just a few lines of JSON configuration, you can give Claude access to databases, APIs, file systems, and any custom tool you can build.

Ready to find your next MCP server? Browse the MCPlug marketplace to discover hundreds of community-built tools, or publish your own server to share your creations with the world. Follow us on Twitter for the latest updates on new servers and features.

Ready to Explore MCP Skills?

Browse hundreds of verified AI agent skills on MCPlug, or list your own for free.

Related Articles