MCP with Cursor, VS Code & IDEs: Complete Setup Guide

Your AI coding assistant becomes much more powerful with MCP servers. This guide covers setup for every major AI-powered IDE — Cursor, VS Code (with Cline or Continue), Windsurf, and more.

Why MCP in Your IDE?

AI coding assistants are great, but they're limited to what's in your current file and context window. MCP servers extend them with:

  • Database access — Query your actual database schemas and data
  • GitHub integration — Create issues, PRs, search code across repos
  • Documentation — Pull in API docs, internal wikis, Notion pages
  • External APIs — Interact with any service you use
  • File operations — Advanced file management beyond the IDE's built-in

Instead of copy-pasting context, your AI assistant can pull what it needs directly.

Cursor Setup

Cursor is a VS Code fork built for AI coding. It has native MCP support (in beta as of early 2025).

Step 1: Enable MCP in Settings

Open Cursor Settings → Features → look for "MCP Servers" or "Model Context Protocol". Enable it if it's not already on.

Step 2: Create Config File

Cursor uses a config file similar to Claude Desktop. Create ~/.cursor/mcp.json:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    },
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/yourname/projects"
      ]
    }
  }
}

Step 3: Restart Cursor

Restart Cursor completely (Cmd+Q / Alt+F4, then reopen). The MCP servers will start automatically.

Step 4: Verify It's Working

In Cursor's AI chat, try asking something that requires your MCP server:

  • "List my recent GitHub issues" (tests GitHub server)
  • "What files are in my projects folder?" (tests filesystem server)

If the AI can answer correctly, your servers are connected.

Note: Cursor's MCP support is evolving. Check their docs for the latest config format. Some features may require Cursor Pro.

VS Code + Cline

Cline (formerly Claude Dev) is a VS Code extension that brings Claude to your editor. It has excellent MCP support.

Step 1: Install Cline

  1. Open VS Code Extensions (Cmd+Shift+X)
  2. Search for "Cline"
  3. Install the extension by saoudrizwan
  4. Reload VS Code

Step 2: Configure Cline

Open Cline settings (gear icon in the Cline sidebar panel) and add your API key. Then find the MCP Servers section.

Step 3: Add MCP Servers

Cline stores MCP config in its settings. You can either:

Option A: Use the UI

  1. In Cline settings, find "MCP Servers"
  2. Click "Add Server"
  3. Enter the server name, command, and arguments

Option B: Edit settings.json directly

Add to your VS Code settings.json:

{
  "cline.mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "DATABASE_URL": "postgresql://user:pass@localhost/mydb"
      }
    }
  }
}

Step 4: Test the Connection

Open the Cline chat panel and ask something that uses your MCP server:

"Show me the schema for my users table"

If Cline can query your Postgres database and show the schema, it's working.

VS Code + Continue

Continue is another popular AI coding extension for VS Code (and JetBrains). It supports MCP for context providers.

Step 1: Install Continue

  1. Open VS Code Extensions
  2. Search for "Continue"
  3. Install and reload

Step 2: Edit config.json

Continue's config file is at ~/.continue/config.json. Add MCP servers under the experimental section:

{
  "models": [...],
  "experimental": {
    "mcpServers": {
      "filesystem": {
        "command": "npx",
        "args": [
          "-y",
          "@modelcontextprotocol/server-filesystem",
          "/Users/yourname/projects"
        ]
      },
      "memory": {
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-memory"]
      }
    }
  }
}

Step 3: Use MCP Context

In Continue's chat, use the @ symbol to reference MCP resources:

  • @files — Access filesystem server resources
  • @memory — Store and retrieve context

Continue's MCP integration focuses on context providers (resources) rather than tools. Check their docs for the latest capabilities.

Windsurf Setup

Windsurf (by Codeium) is another AI-native IDE. MCP support varies by version.

Configuration

Look for MCP settings in Windsurf's preferences. The config format is similar to other IDEs:

{
  "mcpServers": {
    "server-name": {
      "command": "command-to-run",
      "args": ["arg1", "arg2"],
      "env": {
        "ENV_VAR": "value"
      }
    }
  }
}

Check Windsurf's documentation for the exact config file location and format for your version.

Best MCP Servers for Coding

Here are the most useful MCP servers for development work:

Essential Servers

GitHub Server

Create issues, PRs, search code, manage repos

npx -y @modelcontextprotocol/server-github

Filesystem Server

Read/write files, search content, manage directories

npx -y @modelcontextprotocol/server-filesystem /path/to/allow

PostgreSQL Server

Query databases, inspect schemas, run migrations

npx -y @modelcontextprotocol/server-postgres

Memory Server

Persistent memory across conversations

npx -y @modelcontextprotocol/server-memory

Advanced Servers

Playwright Server

Browser automation for testing and scraping

npx -y @anthropic/mcp-server-playwright

Puppeteer Server

Chrome automation with screenshots

npx -y @anthropic/mcp-server-puppeteer

Context7 (Documentation)

Pull in library docs on demand

npx -y @context7/mcp-server

Running Multiple Servers

Most IDEs support running multiple MCP servers simultaneously. Here's a complete example config:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "ghp_xxx"
      }
    },
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/code"],
      "env": {}
    },
    "postgres-dev": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "DATABASE_URL": "postgresql://localhost/dev_db"
      }
    },
    "postgres-prod": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "DATABASE_URL": "postgresql://readonly:xxx@prod-server/prod_db"
      }
    },
    "memory": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"],
      "env": {}
    }
  }
}

Tip: Give servers descriptive names like "postgres-dev" and "postgres-prod" so you know which you're querying.

Troubleshooting

Server Not Connecting

  1. Check the command — Run it manually in terminal to see errors
  2. Verify paths — Absolute paths are more reliable than relative
  3. Check env vars — API tokens and connection strings must be valid
  4. Restart IDE — Most IDEs need full restart after config changes

Tools Not Appearing

  • Some IDEs only show tools when they're relevant to the current context
  • Try explicitly asking the AI to use a specific tool
  • Check if the IDE requires enabling specific permissions for MCP tools

Performance Issues

  • Each MCP server is a separate process — don't run more than you need
  • Use connection pooling for database servers
  • Consider caching for frequently-accessed resources

IDE-Specific Issues

Cursor: MCP is in beta. Some features may require Cursor Pro subscription.

Cline: Make sure you're using the latest version. MCP support has improved significantly in recent releases.

Continue: Focus is on context providers (resources) rather than tools. Some tool functionality may be limited.

Workflow Example

Here's how MCP transforms a typical development workflow:

Without MCP:

  1. Open database GUI, copy schema
  2. Paste into AI chat
  3. Ask for help with query
  4. Copy query, test it manually
  5. Go back to AI with error message

With MCP:

  1. "Help me write a query to find users who signed up last week but haven't made a purchase"
  2. AI checks schema via MCP, writes query, tests it, refines if needed

The AI has direct access to your database schema and can verify its work — no copy-paste needed.

Security Best Practices

  • Use read-only credentials for production databases
  • Limit filesystem access to specific directories
  • Use environment variables for secrets, never hardcode in config
  • Review tool permissions — some servers have write capabilities
  • Separate dev and prod — Use different servers for different environments

What's Next?

Now that you have MCP set up in your IDE:

About These Tutorials

Written by Kai Gritun. I've been building MCP servers since the protocol launched and have contributed to the MCP ecosystem. These guides come from real implementation experience.