Last Updated: 2025-01-11 Based on: Official Claude documentation and MCP specifications
| Platform | Config File | Config Key | Scope Support | Primary Use Case |
|---|---|---|---|---|
| Claude Code CLI | ~/.claude.json |
mcpServers |
local, project, user | Development, coding, automation |
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) |
mcpServers |
Global only | General use,写作, brainstorming |
| Factory Droid | ~/.factory/mcp.json |
mcpServers |
Global only | Factory AI Droid CLI |
| Cursor | ~/.cursor/mcp.json |
mcpServers |
Global only | VS Code alternative |
| Claude Desktop (Windows) | %APPDATA%\Claude\claude_desktop_config.json |
mcpServers |
Global only | General use, Windows |
Primary Configuration:
~/.claude.json
MCP Server Configuration Structure:
{
"mcpServers": {
"server-name": {
"type": "stdio",
"command": "node",
"args": ["/path/to/server.js"],
"env": {
"API_KEY": "value"
}
}
},
"otherSettings": {...}
}Additional Files:
~/.claude/settings.json- User preferences, hooks, plugins~/.claude/projects/- Project-specific settings./.mcp.json- Project-scoped MCP servers (when using--scope project)
macOS Location:
~/Library/Application Support/Claude/claude_desktop_config.json
Windows Location:
%APPDATA%\Claude\claude_desktop_config.json
Configuration Structure:
{
"mcpServers": {
"server-name": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/directory"],
"env": {
"API_KEY": "value"
}
}
}
}Access Method:
- Open Claude Desktop
- Settings → Developer → Edit Config
- This creates/opens the config file
Factory Droid:
~/.factory/mcp.json
Cursor:
~/.cursor/mcp.json
Advantages:
- Three configuration scopes: local, project, user
- Project-aware: Deep codebase understanding
- CLI-based: Scriptable and automatable
- Development-focused: Built for coding workflows
- Multiple transport types: stdio, HTTP, SSE
- Plugin system: Extensible with plugins
- Hot-reload:
restart_servercommand for MCP development
Configuration Methods:
- CLI Commands:
claude mcp add,claude mcp list,claude mcp remove - Direct file editing: Edit
~/.claude.json - JSON import:
claude mcp add-json - Project configs:
.mcp.jsonfiles (committed to Git)
Scope Hierarchy (highest to lowest priority):
- Local scope (
--scope local) - Project-specific, user-private - Project scope (
--scope project) - Team-shared via Git - User scope (
--scope user) - Cross-project, user-private
Example Commands:
# Add server with different scopes
claude mcp add --transport stdio xcodebuild -- node /path/to/xcodebuildmcp
claude mcp add --transport http sentry --scope user https://mcp.sentry.dev/mcp
claude mcp add --transport http stripe --scope project https://mcp.stripe.com
# List and manage
claude mcp list
claude mcp get server-name
claude mcp remove server-name
# Import from Claude Desktop
claude mcp add-from-claude-desktopAdvantages:
- User-friendly: GUI-based configuration
- Simple setup: Edit config file through Settings menu
- Visual interface: Better for non-developers
- Consumer-focused: Writing, brainstorming, general tasks
Limitations:
- Single scope: Global configuration only
- Manual editing: No CLI commands for management
- Restart required: Must restart app for config changes
- Limited transports: Primarily stdio-based servers
Configuration Process:
- Open Claude Desktop
- Click Settings → Developer → Edit Config
- Edit JSON manually
- Save and restart Claude Desktop
Local Scope (Default)
- Storage: Project-specific user settings
- Visibility: Private to user, current project only
- Use case: Personal development servers, sensitive credentials
- Command:
claude mcp add --scope local <server>
Project Scope
- Storage:
./.mcp.json(committed to version control) - Visibility: Shared with entire team
- Use case: Team collaboration, project-specific tools
- Command:
claude mcp add --scope project <server> - Approval: Requires user approval for security
User Scope
- Storage: Cross-project user configuration
- Visibility: Private to user, all projects
- Use case: Personal utilities, frequently-used services
- Command:
claude mcp add --scope user <server>
Global Scope Only
- Storage: Single user configuration file
- Visibility: Available across all Claude Desktop sessions
- No project-level isolation
-
stdio (Standard Input/Output)
- Local process execution
- Best for system access tools
- Example:
claude mcp add --transport stdio filesystem -- npx -y @modelcontextprotocol/server-filesystem /path/to/dir
-
HTTP (Remote servers)
- Most widely supported for cloud services
- Supports authentication headers
- Example:
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
-
SSE (Server-Sent Events)
- Deprecated but still supported
- Real-time communication
- Example:
claude mcp add --transport sse asana https://mcp.asana.com/sse
-
stdio (Main transport)
- Local command execution
- Most reliable for Desktop environment
- Example:
"command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"]
-
Limited HTTP/SSE support
- Possible but not well-documented
- Workarounds required for remote servers
Supported syntax:
${VAR}- expands to environment variable${VAR:-default}- expands with default value
Expansion locations:
{
"mcpServers": {
"api-server": {
"type": "http",
"url": "${API_BASE_URL:-https://api.example.com}/mcp",
"headers": {
"Authorization": "Bearer ${API_KEY}"
},
"command": "${CUSTOM_SERVER_PATH:-/usr/local/bin/server}",
"args": ["--config", "${CONFIG_DIR}"],
"env": {
"DATABASE_URL": "${DB_URL}"
}
}
}
}Limited expansion support:
- Basic
${VAR}syntax works - Some limitations reported with complex expansions
- Best to use absolute paths for reliability
OAuth 2.0 Support:
- Built-in OAuth flow via
/mcpcommand - Secure token storage and refresh
- Works with HTTP servers
- Example workflow:
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp- In Claude Code:
/mcp - Select "Authenticate" for Sentry
- Complete browser flow
Manual token management:
- Tokens stored in config file
- Manual setup for authentication
- No built-in OAuth flows
- Example:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "your-token-here"
}
}
}
}Plugin MCP Servers:
- Plugins can bundle MCP servers
- Automatic lifecycle management
- Configuration via
plugin.jsonor.mcp.json - Environment variable:
${CLAUDE_PLUGIN_ROOT}
Example Plugin MCP:
{
"name": "my-plugin",
"mcpServers": {
"plugin-api": {
"command": "${CLAUDE_PLUGIN_ROOT}/servers/api-server",
"args": ["--port", "8080"]
}
}
}No plugin system:
- Manual configuration only
- No automatic server discovery
- Static configuration file
Windows stdio setup:
# Required for npx servers on Windows
claude mcp add --transport stdio my-server -- cmd /c npx -y @some/packageWindows paths:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"C:\\Users\\yourname\\Desktop",
"C:\\Users\\yourname\\Downloads"
]
}
}
}Development features:
- Hot-reload with
restart_servertool - Debug mode:
--mcp-debugflag - Timeout configuration:
MCP_TIMEOUTenvironment variable - Output limits:
MAX_MCP_OUTPUT_TOKENSenvironment variable - Verbose logging for troubleshooting
Debugging limitations:
- No built-in debugging tools
- Requires manual log inspection
- Must restart for config changes
- No hot-reload capabilities
- Software development: Deep codebase integration
- Team collaboration: Project-scoped configurations
- Automation: CLI-driven workflows
- MCP development: Hot-reload and debugging tools
- Complex setups: Multiple scopes and transport types
- Professional use: Enterprise features and security
- General writing: User-friendly interface
- Simple integrations: Basic MCP server setup
- Non-developers: GUI-based configuration
- Consumer tasks: Writing, brainstorming, research
- Single machine: Simple setup without project complexity
# Import existing configurations
claude mcp add-from-claude-desktop
# Or manually convert format
# Desktop: {"servers": {...}}
# Code: {"mcpServers": {...}}- Copy server configurations from
~/.claude.json - Convert to Desktop format if needed
- Paste into
claude_desktop_config.json - Restart Claude Desktop
Advantages:
- Project isolation with scopes
- Approval prompts for project-scoped servers
- Secure OAuth flows
- Environment variable isolation
Considerations:
- Global configuration exposure
- Manual token management
- No approval workflows
- Static credential storage
Common commands:
# Check server status
/mcp
# Reset project approvals
claude mcp reset-project-choices
# Debug mode
claude --mcp-debug
# Check configuration
claude mcp list
claude mcp get server-nameTroubleshooting steps:
- Check config file syntax
- Verify Node.js installation
- Restart application
- Check server command paths
- Monitor logs for errors
Claude Code CLI is the superior choice for:
- Developers and technical users
- Team collaboration
- Complex MCP configurations
- Professional development workflows
Claude Desktop excels for:
- General consumers
- Simple use cases
- Writing and brainstorming
- Users preferring GUI interfaces
The choice depends on your technical requirements, collaboration needs, and preferred interaction model. For serious development work, Claude Code CLI's advanced features and configuration options provide significantly more power and flexibility.