MCP (Model Context Protocol) is a protocol that connects Claude with external tools and services. This guide provides step-by-step instructions for setting up and using Claude MCP on Windows.
Node.js is the JavaScript runtime required to run MCP servers.
Download URL: https://nodejs.org/
- LTS (Long Term Support) version is recommended
- Make sure to check "Add to PATH" option during installation
- System restart is recommended after installation
Open Command Prompt (cmd) or PowerShell and verify the installation paths:
where node
where npxIf properly installed, you should see paths like:
C:\Program Files\nodejs\node.exe
C:\Program Files\nodejs\npx.cmd
MCP is only available in the Claude Desktop app, not in the web version.
Download URL: https://claude.ai/download
The MCP configuration file for Claude Desktop is located at:
C:\Users\{username}\AppData\Roaming\Claude\claude_desktop_config.json
Replace {username} with your actual Windows username.
Create the claude_desktop_config.json file at the above path and add the following content:
Important: In Windows, using "command": "npx" may cause "Cannot connect to MCP server" errors. It is strongly recommended to use the full path "command": "C:\\Program Files\\nodejs\\npx.cmd" instead.
{
"mcpServers": {
"filesystem": {
"command": "C:\\Program Files\\nodejs\\npx.cmd",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"C:\\Users\\{user}\\Downloads",
"C:\\Users\\{user}\\Documents",
"C:\\Users\\{user}\\Desktop"
]
},
"github": {
"command": "C:\\Program Files\\nodejs\\npx.cmd",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "{token}"
}
},
"memory": {
"command": "C:\\Program Files\\nodejs\\npx.cmd",
"args": [
"-y",
"@modelcontextprotocol/server-memory"
],
"env": {
"DEBUG": "*"
}
},
"playwright": {
"command": "C:\\Program Files\\nodejs\\npx.cmd",
"args": [
"@playwright/mcp@latest"
]
}
}
}Filesystem Server: Replace {user} with your actual Windows username.
GitHub Server: Replace {token} with your actual GitHub Personal Access Token.
- Function: Access local file system to perform file reading, writing, searching, and other operations
- Use Cases: Document editing, code file management, project structure analysis
- Function: Manage GitHub repositories, create issues, handle Pull Requests, etc.
- Required Setup: GitHub Personal Access Token needed
- Token Creation: GitHub Settings > Developer settings > Personal access tokens
- Function: Remember and store information during conversations to maintain context
- Use Cases: Track project progress, remember user preferences
- Function: Web browser automation and web page interaction
- Use Cases: Web scraping, automated testing, web app interaction
1. MCP Server Not Connecting:
- Completely quit and restart Claude Desktop app
- Verify JSON syntax in configuration file is correct
- Check if Node.js path is accurate
- Important: Ensure you're using the full path
"command": "C:\\Program Files\\nodejs\\npx.cmd"instead of just"command": "npx"
2. File Path Issues:
- In Windows, backslashes (
\) must be escaped (\\) - If username contains special characters, wrap in quotes
3. Permission Issues:
- Run Claude Desktop with administrator privileges
- Check permissions for folders you're trying to access
When issues occur, you can check Claude Desktop logs:
- Press Windows + R > Type
%APPDATA%\Claude\logs
SQLite Server:
"sqlite": {
"command": "C:\\Program Files\\nodejs\\npx.cmd",
"args": ["-y", "@modelcontextprotocol/server-sqlite"]
}Brave Search Server:
"brave-search": {
"command": "C:\\Program Files\\nodejs\\npx.cmd",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "{your-api-key}"
}
}Postgres Server:
"postgres": {
"command": "C:\\Program Files\\nodejs\\npx.cmd",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"POSTGRES_CONNECTION_STRING": "postgresql://username:password@localhost:5432/database"
}
}Slack Server:
"slack": {
"command": "C:\\Program Files\\nodejs\\npx.cmd",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {
"SLACK_BOT_TOKEN": "{your-bot-token}"
}
}For better security, you can use environment variables instead of hardcoding sensitive information:
-
Set Environment Variables in Windows:
- Open System Properties > Advanced > Environment Variables
- Add new variables like
GITHUB_TOKEN,SLACK_BOT_TOKEN, etc.
-
Use in Configuration:
"github": {
"command": "C:\\Program Files\\nodejs\\npx.cmd",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
}
}- Token Management: Store API keys and tokens securely and rotate them regularly
- File Access Permissions: Only add necessary directories to the Filesystem server
- Environment Variables: Manage sensitive information through environment variables
- Network Access: Be cautious when granting network access to MCP servers
MCP servers are regularly updated. To use the latest versions:
- Automatic Updates: Restart Claude Desktop (auto-updates)
- Manual Updates: Run
npx -y @modelcontextprotocol/server-{name}@latest - Check Versions: Use
npx @modelcontextprotocol/server-{name} --version
If you have a custom Node.js installation path:
"filesystem": {
"command": "C:\\Custom\\Path\\To\\npx.cmd",
"args": ["-y", "@modelcontextprotocol/server-filesystem"]
}For Filesystem server with multiple specific directories:
"filesystem": {
"command": "C:\\Program Files\\nodejs\\npx.cmd",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"C:\\Projects",
"C:\\Data",
"C:\\Backup"
]
}Enable debug mode for troubleshooting:
"memory": {
"command": "C:\\Program Files\\nodejs\\npx.cmd",
"args": ["-y", "@modelcontextprotocol/server-memory"],
"env": {
"DEBUG": "*",
"LOG_LEVEL": "debug"
}
}- Start Simple: Begin with one or two servers, then add more as needed
- Regular Backups: Keep backups of your configuration file
- Monitor Performance: Some servers may impact system performance
- Update Regularly: Keep both Claude Desktop and MCP servers updated
- Test Configuration: Test each server individually before adding multiple servers