Connect MCP Servers to Claude Desktop

Register your own and community MCP servers in Claude Desktop — edit claude_desktop_config.json, add stdio servers with uv/npx/uvx, and use them safely.

Jun 17, 20266 min readFollow

Topics You Will Master

Where Claude Desktop's claude_desktop_config.json lives on Windows and macOS
Registering your own FastMCP servers over the stdio transport
Adding community servers (filesystem, SQLite, Playwright, Airbnb, Excel, PowerPoint, Notion)
Handling secrets and tokens in the config file safely

Claude Desktop is an MCP host: it can connect to many MCP servers simultaneously and expose all their tools inside a conversation. Instead of writing a client script, you register servers once in a config file, restart the app, and Claude can call them on demand.

This lesson shows how to wire up your own servers and a set of community servers through claude_desktop_config.json. Because Claude Desktop launches each server as a subprocess, every server must use the stdio transport.

Note

Prerequisites: Claude Desktop installed (see MCP Dev Setup), plus uv and Node.js on your PATH so uv, uvx, and npx work from any terminal.

95% OFF

MCP Mastery: Build AI Apps with Claude, LangChain and Ollama

Build MCP servers and clients with Python, Streamlit, ChromaDB, LangChain, LangGraph agents, and Ollama — from your first tool to cloud deployment.

Enroll Now — 95% OFF →

Servers must use stdio

Claude Desktop as a host loading your own and community MCP servers

Claude Desktop starts each server itself and talks to it over standard in/out. So the same math and weather servers from earlier switch to the stdio transport:

PYTHON
# math_server.py
from fastmcp import FastMCP

mcp = FastMCP("Demo 🚀")

@mcp.tool
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b

@mcp.tool
def multiply(a: int, b: int) -> int:
    """Multiply two numbers"""
    return a * b

@mcp.tool
def subtract(a: int, b: int) -> int:
    """Subtract two numbers"""
    return a - b

@mcp.tool
def divide(a: int, b: int) -> float:
    """Divide two numbers"""
    if b == 0:
        return "Error: Division by zero"
    return a / b

if __name__ == "__main__":
    mcp.run(transport="stdio")
    # mcp.run(transport="streamable-http", port=8000)

The weather server is the same code as before, ending in mcp.run(transport="stdio").


Finding the config file

OS Config path
Windows %APPDATA%\Claude\claude_desktop_config.json
macOS ~/Library/Application Support/Claude/claude_desktop_config.json

On Windows, paste %APPDATA%\Claude into the File Explorer address bar to open the folder.

Tip

You can also open the file from inside Claude Desktop via its settings (Developer → Edit Config). If the file does not exist yet, create it with { "mcpServers": {} } as the starting content.


Registering your own servers

Each entry under mcpServers gives the server a name plus the command to launch it. Use uv run --directory <abs-path> <script>:

JSON
{
  "mcpServers": {
    "weather": {
      "command": "uv",
      "args": [
        "run", "--directory",
        "C:\\Users\\your-username\\projects\\mcp-course\\05 MCP Servers with Claude Desktop",
        "weather_server.py"
      ]
    },
    "math_server": {
      "command": "uv",
      "args": [
        "run", "--directory",
        "C:\\Users\\your-username\\projects\\mcp-course\\05 MCP Servers with Claude Desktop",
        "math_server.py"
      ]
    }
  }
}

Important

Replace your-username and the directory with your real absolute path. JSON requires escaped backslashes (\\) on Windows.

On Linux/macOS: use a normal path such as /home/your-username/projects/mcp-course/05 MCP Servers with Claude Desktop.

After saving, fully quit and reopen Claude Desktop. Your tools appear under the tools (hammer) icon in the chat box, and you can ask things like "What's 12 times 342?" or "What's the weather in Tokyo?"

Claude Desktop launching each MCP server as a stdio subprocess


Adding community servers

Community MCP servers for files, databases, browser, and Office added via npx or uvx

The MCP ecosystem ships hundreds of ready-made servers you can add with npx (Node) or uvx (Python). Add any of these alongside your own entries:

JSON
{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest"]
    },
    "airbnb": {
      "command": "npx",
      "args": ["-y", "@openbnb/mcp-server-airbnb", "--ignore-robots-txt"]
    },
    "filesystem": {
      "command": "npx",
      "args": [
        "-y", "@modelcontextprotocol/server-filesystem",
        "C:\\Users\\your-username\\Downloads"
      ]
    },
    "sqlite": {
      "command": "uvx",
      "args": [
        "git+https://github.com/laxmimerit/mcp-server-sqlite.git",
        "--db-path",
        "C:\\Users\\your-username\\Downloads\\employees.db"
      ]
    },
    "excel": {
      "command": "cmd",
      "args": ["/c", "npx", "--yes", "@negokaz/excel-mcp-server"],
      "env": { "EXCEL_MCP_PAGING_CELLS_LIMIT": "4000" }
    },
    "ppt": {
      "command": "uvx",
      "args": ["--from", "office-powerpoint-mcp-server", "ppt_mcp_server"]
    }
  }
}

What each one adds:

  • playwright — browser automation (navigate, click, scrape pages).
  • airbnb — search Airbnb listings.
  • filesystem — read/write files in a folder you allow (here, Downloads).
  • sqlite — query a local SQLite database (--db-path points at the file).
  • excel — read and write .xlsx workbooks.
  • ppt — create and edit PowerPoint decks.

Note

On Windows, the excel server is launched through cmd /c npx so the npx shim resolves correctly. The first run of any npx/uvx server downloads it, so allow a moment before the tools appear.

Tip


Servers that need secrets

Some servers read credentials from an env block — for example a Notion integration token:

JSON
{
  "mcpServers": {
    "notionApi": {
      "command": "npx",
      "args": ["-y", "@notionhq/notion-mcp-server"],
      "env": {
        "NOTION_TOKEN": "your-notion-integration-token"
      }
    }
  }
}

Caution

claude_desktop_config.json can contain live API keys and tokens. Never commit this file to git, never paste it into a chat or screenshot, and never share it. Replace every placeholder (your-notion-integration-token, database paths, usernames) with your own values, and revoke any token that is accidentally exposed.

You can also point Claude Desktop at a remote MCP server you have deployed, using the mcp-remote bridge:

JSON
{
  "mcpServers": {
    "remote-research-server": {
      "command": "npx",
      "args": ["mcp-remote", "http://your-ec2-public-ip:8000/mcp", "--allow-http"]
    }
  }
}

Important

Replace your-ec2-public-ip with the public address of the server you deploy in Deploy an MCP Server on AWS EC2. Use --allow-http only for testing; prefer HTTPS for anything exposed to the internet.


Recap

  • Claude Desktop loads servers from claude_desktop_config.json (%APPDATA%\Claude\... on Windows).
  • Your servers must run on the stdio transport and are launched with uv run --directory <abs-path> <script>.
  • Community servers add huge capability with one npx/uvx entry.
  • Restart Claude Desktop after editing, and treat the config file as a secret.

With Excel and PowerPoint servers connected, you can now turn Claude Desktop into a data analyst — see MCP for Data Analysis with Claude Desktop.

Found this useful? Keep building with me.

New tutorials every week on YouTube — or go deeper with a full structured course.

Find this tutorial useful?

Subscribe to our YouTube channels for more practical production walk-throughs.

Discussion & Comments