How to Set Up MCP Servers in Cursor, Claude Code, and Windsurf

Step-by-step guide to setting up MCP servers in Cursor, Claude Code, and Windsurf. Configure Context7, GitHub, Supabase, and more.

Cover Image for How to Set Up MCP Servers in Cursor, Claude Code, and Windsurf

MCP (Model Context Protocol) connects your AI coding tools to external data sources — documentation, databases, APIs, and code repositories. Instead of pasting context manually, MCP servers feed it directly to your AI. This guide walks through setup for the three major tools: Cursor, Claude Code, and Windsurf.


What You Need

Before starting, make sure you have:

  • Node.js 18+ installed (MCP servers run as Node processes)
  • The AI tool you want to configure (Cursor, Claude Code, or Windsurf)
  • API tokens for any authenticated servers (GitHub, Supabase, etc.)
  • A rough idea of which servers you need — if you're unsure, start with the recommended stack below

MCP in Cursor

Cursor has the simplest MCP setup of any tool.

One-click install: Open Settings, navigate to the MCP panel, browse the marketplace, and install servers directly. No config files needed.

Manual configuration: Create .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "your-token-here" }
    }
  }
}

Restart Cursor after adding or modifying servers. Open the MCP panel to confirm each server shows a green status indicator. For more on Cursor's full feature set, see the Cursor IDE Guide.


MCP in Claude Code

Claude Code configures MCP from the command line. No config files to manage manually.

Add a server:

claude mcp add context7 -- npx -y @upstash/context7-mcp

Add a server with environment variables:

claude mcp add github -e GITHUB_TOKEN=your-token-here -- npx -y @modelcontextprotocol/server-github

Verify your servers:

claude mcp list

Servers persist across sessions. You can also reference MCP tools in your CLAUDE.md file so the agent knows what's available. See the full Claude Code Guide for setup details and best practices.


MCP in Windsurf

Windsurf uses the same JSON format as Cursor. Open Windsurf settings, navigate to the MCP configuration section, and add your servers using the identical mcpServers structure shown above. Windsurf supports shared configurations across enterprise teams, making it straightforward to standardize servers across your organization.


MCP in Xcode 26.3

Apple added built-in MCP support in Xcode 26.3. Claude Agent and Codex connect automatically through the agent framework — no manual server configuration required. MCP enables these agents to access documentation, run tests, and interact with external services directly from Xcode. See Xcode Agentic Coding for the full breakdown.


These three servers cover the most common needs. Start here, then add more as your workflow demands.

Context7 — Pulls up-to-date documentation for any library or framework. This is the single most impactful server you can install. It prevents your AI from suggesting deprecated APIs or outdated patterns.

GitHub MCP — Gives your AI direct access to code search, pull request context, and issue management. Essential if you work across multiple repositories.

Supabase or Postgres MCP — Connects your AI to your actual database schema and data. Instead of describing your tables, the AI reads them directly. Dramatically improves query generation and schema-aware code.


Troubleshooting

Server not appearing: Restart your tool completely. MCP servers load at startup, not hot-reload.

"Command not found": Verify Node.js is installed (node --version) and that npx is in your PATH. If using nvm, ensure the correct version is active.

Authentication errors: Double-check environment variables. Tokens expire — regenerate if needed. In Cursor, verify the env block in your JSON.

Server timeout: Some servers need network access to initialize. Check firewall, VPN, or proxy settings.

Silent crashes: Run the server command directly in your terminal (e.g., npx -y @upstash/context7-mcp) to see error output.


Security Best Practices

  • Use environment variables for tokens — never hardcode secrets in config files that get committed to version control
  • Only install servers from trusted sources — verify the npm package author and check download counts before installing
  • Review what data each server accesses — MCP servers can read files, query databases, and make API calls on your behalf
  • Scope tokens to minimum permissions — use fine-grained GitHub tokens with only the repository access you need

For a deeper look at security in AI-assisted development, read Vibe Coding Security.


Related: What Is MCP? | Best MCP Servers 2026 | Cursor IDE Guide

Browse: MCP Servers Directory | AI Coding Tools

Comments (0)

Sign in to leave a comment or vote

Sign In

No comments yet. Be the first to comment!

Stay in the loop

Get weekly updates on trending AI coding tools and projects.