Loading...
Master MCP server installation and configuration for Claude Desktop. Complete step-by-step setup guide with optimization tips and best practices for 2025.
MCP (Model Context Protocol) servers enable Claude Desktop to interact with external tools and systems. This guide provides a complete walkthrough for setting up MCP servers, from installation to advanced configuration, with practical examples and troubleshooting tips.
Download and install Node.js from nodejs.org. Verify installation with 'node --version'
node --version
npm --versionFind your Claude Desktop configuration file based on your operating system
# macOS
~/Library/Application Support/Claude/claude_desktop_config.json
# Windows
%APPDATA%\Claude\claude_desktop_config.json
# Linux
~/.config/Claude/claude_desktop_config.jsonInstall the filesystem MCP server as a starting point
npm install -g @modelcontextprotocol/server-filesystemAdd the server configuration to claude_desktop_config.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory"]
}
}
}Close and reopen Claude Desktop to load the new configuration
# Verify server is loaded by typing in Claude:
'What MCP servers are available?'Manage repositories, issues, and pull requests directly from Claude
Read, write, and organize Google Drive files and folders
Send messages and manage Slack workspaces
Query and manage PostgreSQL databases
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}{
"mcpServers": {
"project1-fs": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/projects/project1"]
},
"project2-fs": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/projects/project2"]
}
}
}import { Server } from '@modelcontextprotocol/sdk';
const server = new Server({
name: 'my-custom-server',
version: '1.0.0'
});
server.setRequestHandler('tools/list', async () => {
return {
tools: [{
name: 'my_tool',
description: 'Custom tool description',
inputSchema: {
type: 'object',
properties: {
query: { type: 'string' }
}
}
}]
};
});
server.connect(process.stdin, process.stdout);"Security should be your top priority when configuring MCP servers. Never hardcode API keys or credentials directly in configuration files. Use environment variables or secure credential stores instead."
Answers to common questions about MCP server configuration
Loading reviews...