Connecting to MCP Servers By Xavier Collantes
8/24/2025
The Model Context Protocol (MCP) enables LLM clients to connect to external
tools and data sources. This guide covers the technical details of setting up
MCP connections for Claude Desktop and Cursor.
For background on why and when to use MCPs, see my intro blog on MCPs.
Claude Desktop Setup (Chatbot UI)
Method 1: Desktop Extensions (Recommended)
Desktop Extensions (.dxt) provide one-click installation for supported MCP
servers.
Steps:
Open Claude Desktop
Navigate to Settings > Extensions
Browse available extensions and click Install
Extensions auto-update by default
Desktop Extensions include a built-in Node.js
environment, eliminating the need for manual Node.js installation.
Method 2: Manual Configuration
For custom servers or advanced setups, use the configuration file method.
Prerequisites:
Verify Node.js installation (LTS version recommended).
Bash 1 node --version
2 npm --version
3
Verify Node.js installation (LTS version recommended). hosted with by Xavier
Configuration Steps:
Open Claude Desktop
Go to File > Settings > Developer
Click Edit Config to open claude_desktop_config.json
Add your MCP server configuration
Example Configuration:
1 {
2 "mcpServers" : {
3 "github" : {
4 "command" : "npx" ,
5 "args" : [ "-y" , "@modelcontextprotocol/server-github" ] ,
6 "env" : {
7 "GITHUB_PERSONAL_ACCESS_TOKEN" : "your_token_here"
8 }
9 } ,
10 "filesystem" : {
11 "command" : "npx" ,
12 "args" : [
13 "-y" ,
14 "@modelcontextprotocol/server-filesystem" ,
15 "/path/to/allowed/directory"
16 ] ,
17 "env" : { }
18 }
19 }
20 }
21
Verification:
Completely quit and restart Claude Desktop
Look for the MCP server indicator in the chat input
Click the tools icon to see available MCP tools
Configuration changes require a complete
restart of Claude Desktop. Simply refreshing the conversation will not load
new servers.
Cursor Setup
Method 1: One-Click Installation (2025)
Cursor now supports pre-configured MCP servers with OAuth authentication.
Steps:
Open Command Palette (Ctrl+Shift+P
/ Cmd+Shift+P
)
Search for "Cursor Settings"
Navigate to MCP Servers and enable the feature
Browse and install available servers with one-click
Method 2: Configuration Files
Create MCP configuration files for custom setups.
Global Configuration (applies to all workspaces):
Create global MCP config.
Bash 1 mkdir -p ~/.cursor
2 touch ~/.cursor/mcp.json
3
Create global MCP config. hosted with by Xavier
Project-Specific Configuration:
Create project-specific config.
Bash 1 mkdir -p .cursor
2 touch .cursor/mcp.json
3
Create project-specific config. hosted with by Xavier
Example MCP Configuration:
1 {
2 "mcpServers" : {
3 "web-search" : {
4 "command" : "npx" ,
5 "args" : [ "-y" , "@modelcontextprotocol/server-brave-search" ] ,
6 "env" : {
7 "BRAVE_API_KEY" : "your_api_key_here"
8 }
9 } ,
10 "database" : {
11 "command" : "npx" ,
12 "args" : [ "-y" , "@modelcontextprotocol/server-postgres" ] ,
13 "env" : {
14 "POSTGRES_CONNECTION_STRING" : "postgresql://user:password@localhost:5432/dbname"
15 }
16 }
17 }
18 }
19
Transport Types:
Cursor supports three transport mechanisms:
stdio (Standard Input/Output) - Default, simpler for local development
SSE (Server-Sent Events) - HTTP-based, better for distributed teams
WebSocket - Real-time bidirectional communication
Example With SSE Transport:
1 {
2 "mcpServers" : {
3 "remote-server" : {
4 "url" : "https://your-mcp-server.com/sse" ,
5 "transport" : "sse" ,
6 "headers" : {
7 "Authorization" : "Bearer your_token"
8 }
9 }
10 }
11 }
12
Project-specific configurations override
global ones. Use project configs for tools specific to a codebase.
Authentication And Environment Variables
Both clients support secure credential management through environment variables.
Secure Token Storage:
1 {
2 "mcpServers" : {
3 "slack" : {
4 "command" : "npx" ,
5 "args" : [ "-y" , "@modelcontextprotocol/server-slack" ] ,
6 "env" : {
7 "SLACK_BOT_TOKEN" : "${SLACK_BOT_TOKEN}" ,
8 "SLACK_TEAM_ID" : "${SLACK_TEAM_ID}"
9 }
10 }
11 }
12 }
13
Environment Setup:
Add to ~/.bashrc or ~/.zshrc.
Bash 1 export SLACK_BOT_TOKEN = "xoxb-your-token-here"
2 export SLACK_TEAM_ID = "T1234567890"
3
Add to ~/.bashrc or ~/.zshrc. hosted with by Xavier
Never hardcode API keys in configuration
files. Always use environment variables or OAuth when available.
Popular MCP Servers
GitHub : Repository management, issue tracking
GitLab : CI/CD pipeline integration
Data Sources
PostgreSQL : Database queries and schema inspection
SQLite : Local database operations
Google Drive : File management and search
Web Services
Slack : Channel management and messaging
Notion : Page creation and content management
Brave Search : Real-time web search capabilities
See More
See my blog on MCP popular servers.
Installation Example:
1 # Using Composio for quick setup
2 npx @composio/mcp@latest setup "https://mcp.composio.dev/github" --client cursor
3
Common Pitfalls
.claude.json Scope
Field may not exist in the .claude.json
file but use the outer most
mcpServers
field for user scoped servers.
Claude Desktop:
Server not appearing : Ensure complete restart after config changes
Permission errors : Check file paths and environment variables
Node.js issues : Verify LTS version installation
Claude Code and Claude Desktop use different MCP server
configurations. You will need to configure both if you want to use an MCP for
each.
Cursor:
MCP option missing : Update to latest Cursor version
OAuth failures : Clear browser cache and re-authenticate
Transport errors : Verify network connectivity for remote servers
Debugging Commands
Check MCP server installation.
Bash 1 npx @modelcontextprotocol/server-github --version
2
3 # Validate JSON configuration.
4 cat ~/.cursor/mcp.json | json_pp
5
6 # Test environment variables.
7 echo $GITHUB_PERSONAL_ACCESS_TOKEN
8
Check MCP server installation. hosted with by Xavier
MCP servers are still in active development.
Check server documentation for the latest setup instructions and supported
features.
Log Analysis
Claude Desktop logs (macOS):
1 tail -f ~/Library/Logs/Claude/claude.log
2
Cursor logs :
1 # Access through Command Palette > "Developer: Show Logs"
2
Security Considerations
Use environment variables for sensitive credentials
Limit filesystem access to specific directories only
Regularly rotate API keys and tokens
Use project-specific configs for sensitive projects
MCP servers can access your local
filesystem and external APIs. Only install servers from trusted sources and
review their permissions carefully.
Further Reading