Setting Up MCP Servers for Claude Desktop: A Comprehensive Guide

Prerequisites

Before beginning, ensure you have the following installed:

  • Node.js and npm (Node Package Manager) from nodejs.org
  • Claude Desktop application
  • A text editor for modifying configuration files
  • Git (for GitHub integration)
  • SQLite (for database operations)

Understanding the Environment

The claude_desktop_config.json file is where you'll configure your MCP servers. This file is typically located at:

  • Windows: C:\Users\YourUsername\AppData\Roaming\Claude\claude_desktop_config.json

The server directories (where the MCP servers are installed) can be in two locations:

  • Global installation: C:\Users\YourUsername\AppData\Roaming\npm\node_modules
  • Local installation: In your project's node_modules directory

Setting Up the Filesystem Server

The filesystem server allows Claude to access specified directories on your computer.

  1. Create a project directory (if you haven't already):
mkdir ClaudeMCP cd ClaudeMCP
  1. Install and build the server:
npm install -g @modelcontextprotocol/server-filesystem 
cd node_modules/@modelcontextprotocol/server-filesystem 
npm install npm run build
  1. Configure Claude: Add this to your claude_desktop_config.json:
{
  "mcpServers": {
    "filesystem": {
      "command": "node",
      "args": [
        "C:\\path\\to\\ClaudeMCP\\node_modules\\@modelcontextprotocol\\server-filesystem\\dist\\index.js",
        "C:\\path\\to\\allowed\\directory"
      ]
    }
  }
}


Note: Replace the paths with your actual paths. The second argument specifies which directory Claude can access.

Setting Up the SQLite Server

The SQLite server enables Claude to interact with SQLite databases.

  1. Install the SQLite server (Globally, with the -g switch):
npm install -g @modelcontextprotocol/server-sqlite

 

  1. Create a test database (optional):
CREATE TABLE products ( id INTEGER PRIMARY KEY, name TEXT, price REAL ); INSERT INTO products (name, price) VALUES ('Widget', 19.99), ('Gadget', 29.99);
  1. Configure Claude: Add this to your claude_desktop_config.json:
{
  "mcpServers": {
    "sqlite": {
      "command": "npx",
      "args": [
        "mcp-server-sqlite",
        "--db-path",
        "C:\\path\\to\\your\\database.db"
      ]
    }
  }
}

Note: Replace the database path with your actual database file location.

Setting Up the GitHub Server

The GitHub server allows Claude to interact with GitHub repositories.

  1. Create a GitHub Personal Access Token (PAT):
    • Go to GitHub.com → Settings → Developer settings → Personal access tokens
    • Generate a new token with the 'repo' scope
    • Save the token securely; you'll need it for configuration
  2. Install and build the server:
mkdir -p ClaudeMCP/servers/src/github 
cd ClaudeMCP/servers/src/github 
npm install @modelcontextprotocol/server-github 
npm install node-fetch @types/node npm run build

 

  1. Configure Claude: Add this to your claude_desktop_config.json:
{
  "mcpServers": {
    "github": {
      "command": "node",
      "args": [
        "C:\\path\\to\\ClaudeMCP\\servers\\src\\github\\dist\\index.js"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your_github_pat_here"
      }
    }
  }
}

Note: Replace the path with your actual path and your_github_pat_here with your actual GitHub Personal Access Token.

Final Configuration

Your complete claude_desktop_config.json should look something like this:

{
  "globalShortcut": "Alt+C",
  "mcpServers": {
    "github": {
      "command": "node",
      "args": [
        "C:\\path\\to\\ClaudeMCP\\servers\\src\\github\\dist\\index.js"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your_github_pat_here"
      }
    },
    "sqlite": {
      "command": "npx",
      "args": [
        "mcp-server-sqlite",
        "--db-path",
        "C:\\path\\to\\your\\database.db"
      ]
    },
    "filesystem": {
      "command": "node",
      "args": [
        "C:\\path\\to\\ClaudeMCP\\node_modules\\@modelcontextprotocol\\server-filesystem\\dist\\index.js",
        "C:\\path\\to\\allowed\\directory"
      ]
    }
  }
}

Testing the Setup

  1. Save your claude_desktop_config.json file
  2. Restart Claude Desktop
  3. Test each server:
    • Filesystem: Ask Claude to read or list files in your allowed directory
    • SQLite: Ask Claude to query your database
    • GitHub: Ask Claude to access one of your repositories

Troubleshooting

If you encounter issues:

Remember, these servers run locally, so they need to be installed/set up as noted above:

  1. Verify paths in claude_desktop_config.json are correct and use double backslashes (\) for Windows paths
  2. Ensure all npm install and npm run build commands completed successfully for each service
  3. Check that your GitHub PAT has the correct permissions and hasn't expired
  4. Verify the allowed directory for filesystem access exists and is readable
  5. Make sure your SQLite database file exists and is accessible
  6. Restart Claude Desktop after making configuration changes

Security Considerations

  • Only grant filesystem access to directories that Claude needs to access
  • Use a GitHub PAT with minimal necessary permissions
  • Keep your claude_desktop_config.json file secure, as it contains sensitive information
  • Regularly rotate your GitHub PAT for security

Note: Remember to replace all placeholder paths (C:\path\to\...) with your actual file paths. Windows users should use double backslashes (\) in paths within the JSON configuration.

Share this Post