Skip to content

Instantly share code, notes, and snippets.

@mpalpha
Last active October 17, 2025 15:08
Show Gist options
  • Save mpalpha/f5eafe24f328581359c34c8faf9f6767 to your computer and use it in GitHub Desktop.
Save mpalpha/f5eafe24f328581359c34c8faf9f6767 to your computer and use it in GitHub Desktop.
Claude CLI Prompt to Migrate MCP Servers from Cursor to Claude Code VSCode Extension

Migrating MCP Servers from Cursor to Claude Code

This guide helps you migrate MCP (Model Context Protocol) server configuration from Cursor to the Claude Code VSCode extension running in Cursor.

Table of Contents


Quick Start: Copy-Paste Prompt

For fastest setup: Copy everything between the arrows below and paste it into a new Claude Code chat window.

⬇️ COPY FROM HERE ⬇️

I need you to migrate my MCP servers from Cursor's configuration to work with the Claude Code VSCode extension. Here's what I need you to do:

Context: I'm using the Claude Code VSCode extension inside Cursor. Cursor has MCP servers configured in ~/.cursor/mcp.json, but the Claude Code extension doesn't automatically read that file for stdio-based servers. I need to migrate them using the Claude CLI.

Step 1: Find the Claude CLI

  • Use bash to dynamically locate the Claude CLI binary in my Cursor extensions directory
  • Path pattern: ~/.cursor/extensions/anthropic.claude-code-*/resources/native-binary/claude
  • Store it in a variable for reuse

Step 2: Read my existing Cursor MCP configuration

  • Check if I have ~/.cursor/mcp.json (this is Cursor's MCP config file)
  • Read it and show me all the MCP servers I currently have configured
  • For each server, note:
    • Server name and command
    • Whether it's HTTP-based (can skip these - they already work) or stdio-based (needs migration)
    • Environment variables that need to be preserved
    • Any custom arguments or flags
    • Whether it uses local paths (e.g., ~/my-server/build/index.js)

Step 3: Show me the migration plan

  • List all stdio-based servers that need to be migrated
  • HTTP servers (if any) don't need migration - tell me they'll continue working
  • For each stdio server, show me the exact CLI command you'll use to add it
  • Ask me to confirm before proceeding

Step 4: Handle credentials For servers that need credentials (check the Cursor config for env vars):

  • If the Cursor config has hardcoded tokens/keys, warn me about security risks
  • Ask me if I want to provide fresh credentials or reuse the existing ones
  • Never hardcode credentials - always use --env KEY=VALUE in the CLI command
  • Tell me what each credential is for

Step 5: Execute the migration For each stdio-based server from my Cursor config:

  • Use the Claude CLI to add it:
    $CLAUDE_CLI mcp add --transport stdio <name> [--env KEY=VALUE ...] -- <command> [args...]
  • Preserve the exact command, arguments, and environment variables from Cursor's config
  • For locally installed servers, preserve the full path exactly as it appears in Cursor
  • Show me each command as you run it

Step 6: Verify the migration

  • Run $CLAUDE_CLI mcp list to check all servers connected successfully
  • Show me the results with connection status (✓ Connected or ✗ Failed)
  • If any servers failed to connect, help me troubleshoot them
  • Tell me to reload Cursor: Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux) → type "Developer: Reload Window" → Enter

Step 7: Post-migration setup

  • If Memory Bank was migrated, remind me to initialize it after reload with: mcp__memory-bank__initialize_memory_bank
  • Tell me the migration is complete and the servers are ready to use

Important guidelines:

  • Preserve the exact configuration from Cursor's mcp.json file
  • Don't change package managers (if Cursor uses yarn dlx, keep using yarn dlx)
  • For locally installed servers, confirm the path exists before adding
  • Never hardcode credentials - always use --env flags
  • Skip HTTP servers - they don't need migration

Now, start by finding the Claude CLI binary and reading my Cursor MCP configuration file.

⬆️ COPY TO HERE ⬆️

What Happens After Pasting

  1. Claude finds the CLI - Automatically locates the Claude CLI binary in your Cursor extensions
  2. Claude reads Cursor config - Reads ~/.cursor/mcp.json and shows you all configured MCP servers
  3. Migration plan - Claude presents which servers need migration (stdio) vs which work already (HTTP)
  4. Credentials handling - Claude asks for any missing credentials (tokens, API keys)
  5. Migration execution - Claude runs CLI commands to add each stdio server
  6. Verification - Claude checks that all servers connected successfully
  7. You reload Cursor - Reload the window to activate the migrated servers
  8. Done! - Your Cursor MCP servers now work with Claude Code extension

Manual Migration Instructions

If you prefer to migrate servers manually or need detailed reference documentation, follow these instructions.

Understanding the Migration

Why migration is needed:

  • Cursor stores MCP server configuration in ~/.cursor/mcp.json
  • The Claude Code VSCode extension doesn't automatically read this file for stdio-based servers
  • Stdio servers must be added via the Claude CLI to work with Claude Code extension
  • HTTP-based servers (like Figma) continue working without migration

What gets migrated:

  • Server commands and arguments
  • Environment variables
  • Credentials (you'll need to provide these during migration)
  • Locally installed server paths

Migration Steps

1. Locate the Claude CLI Binary

The Claude binary is located in your Cursor extensions directory. The exact path depends on the version installed.

Find it dynamically:

find ~/.cursor/extensions -name "claude" -path "*/native-binary/claude" 2>/dev/null | head -n1

Example path:

~/.cursor/extensions/anthropic.claude-code-2.0.20-darwin-arm64/resources/native-binary/claude

Note: The version number (e.g., 2.0.20) and architecture (e.g., darwin-arm64) will vary based on your system and installed version.

2. Check Your Existing Cursor MCP Configuration

Before migrating, check what servers you have configured in Cursor:

# View your Cursor MCP configuration
cat ~/.cursor/mcp.json

Identify which servers are:

  • stdio-based (have "command" field) - these need migration
  • HTTP-based (have "url" field) - these work automatically, skip them

3. Migrate MCP Servers Using the CLI

Use the following command pattern to migrate stdio-based MCP servers from Cursor:

/path/to/claude mcp add --transport stdio <server-name> [--env KEY=VALUE] -- <command> [args...]

For locally installed MCP servers: If you have MCP servers installed locally (e.g., cloned from GitHub), use the path to the executable:

/path/to/claude mcp add --transport stdio <server-name> -- node /path/to/local-mcp-server/build/index.js

Note: Preserve the exact path from your Cursor configuration.

4. Set Up Your Environment

For convenience, set the Claude CLI path as a variable:

# Find and set the Claude CLI path
CLAUDE_CLI=$(find ~/.cursor/extensions -name "claude" -path "*/native-binary/claude" 2>/dev/null | head -n1)

# Verify it exists
echo $CLAUDE_CLI

5. Migration Examples

Below are examples of migrating common MCP servers from Cursor to Claude Code.

Example: Migrate GitHub MCP Server

From Cursor config:

{
  "Github": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-github"],
    "env": {
      "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxx..."
    }
  }
}

Migration command:

$CLAUDE_CLI mcp add \
  --transport stdio github \
  --env GITHUB_PERSONAL_ACCESS_TOKEN=YOUR_GITHUB_TOKEN \
  -- npx -y @modelcontextprotocol/server-github

Note: Replace YOUR_GITHUB_TOKEN with your actual token (get it from your Cursor config or generate a new one).

Example: Migrate Memory Bank MCP Server

From Cursor config:

{
  "aakarsh-sasi-memory-bank": {
    "command": "yarn",
    "args": ["dlx", "@aakarsh-sasi/memory-bank-mcp"],
    "env": {
      "MEMORY_BANK_ROOT": "/path/to/workspace/.cursor"
    }
  }
}

Migration command:

$CLAUDE_CLI mcp add \
  --transport stdio memory-bank \
  --env MEMORY_BANK_ROOT="$(pwd)/.cursor" \
  -- yarn dlx @aakarsh-sasi/memory-bank-mcp

Note: Adjust MEMORY_BANK_ROOT to match your workspace path.

Example: Migrate Atlassian MCP Server

From Cursor config:

{
  "mcp-atlassian": {
    "command": "npx",
    "args": ["-y", "@smithery/cli@latest", "run", "mcp-atlassian", "--key", "YOUR_KEY", "--profile", "YOUR_PROFILE"]
  }
}

Migration command:

$CLAUDE_CLI mcp add \
  --transport stdio mcp-atlassian \
  -- npx -y @smithery/cli@latest run mcp-atlassian \
  --key YOUR_ATLASSIAN_KEY \
  --profile YOUR_PROFILE

Note: Replace with your actual Atlassian credentials from your Cursor config.

6. Other Common Server Migrations

Here are migration commands for other popular MCP servers:

# Context7 - Library documentation
$CLAUDE_CLI mcp add \
  --transport stdio context7 \
  -- yarn dlx -q @upstash/context7-mcp@latest

# Toolbox - MCP server search and discovery
$CLAUDE_CLI mcp add \
  --transport stdio toolbox \
  -- yarn dlx @smithery/cli@latest run @smithery/toolbox \
  --key YOUR_SMITHERY_KEY \
  --profile YOUR_PROFILE

# Shrimp Task Manager - Advanced task planning
$CLAUDE_CLI mcp add \
  --transport stdio shrimp-task-manager \
  --env DATA_DIR="$HOME/mcp-shrimp-task-manager/data" \
  --env TEMPLATES_USE=en \
  --env ENABLE_GUI=false \
  -- yarn dlx mcp-shrimp-task-manager

# Clear Thought - Structured thinking tools
$CLAUDE_CLI mcp add \
  --transport stdio clear-thought \
  -- yarn dlx @waldzellai/clear-thought

# Example: Locally installed MCP server
$CLAUDE_CLI mcp add \
  --transport stdio my-local-server \
  -- node $HOME/my-mcp-servers/custom-server/build/index.js

Migration Notes:

  • Preserve the exact command and package manager from your Cursor config
  • Copy environment variables and credentials from Cursor's mcp.json
  • For locally installed servers, preserve the full path exactly as it appears in Cursor
  • Check your Cursor config for the correct DATA_DIR paths for servers like Shrimp Task Manager

7. Verify Migration Status

After migrating your servers, check that they all connected successfully:

$CLAUDE_CLI mcp list

Expected output showing all your migrated servers:

Checking MCP server health...

mcp-atlassian: ... - ✓ Connected
github: ... - ✓ Connected
memory-bank: ... - ✓ Connected
context7: ... - ✓ Connected
toolbox: ... - ✓ Connected
shrimp-task-manager: ... - ✓ Connected
clear-thought: ... - ✓ Connected

If any server shows ✗ Failed to connect, see the Troubleshooting section.

8. Reload Cursor

After successfully migrating your MCP servers:

  1. Press Cmd+Shift+P (or Ctrl+Shift+P on Windows/Linux)
  2. Type "Developer: Reload Window"
  3. Press Enter

9. Post-Migration Setup

After reload, your migrated MCP servers are ready to use!

If you migrated Memory Bank: Initialize it with the same path you used in the migration:

Ask Claude to run: mcp__memory-bank__initialize_memory_bank with path: <your-workspace-path>/.cursor

Note: Use the same MEMORY_BANK_ROOT path you configured during migration.

Useful CLI Commands

List all configured servers

claude mcp list

Get details about a specific server

claude mcp get <server-name>

Remove a server

claude mcp remove <server-name>

Reset project-scoped server approvals

claude mcp reset-project-choices

Configuration File Location

MCP servers are saved to: ~/.claude.json

This is a user-level configuration file that persists across projects.

Troubleshooting

Server shows as "Failed to connect"

  • Check that the command/package exists and is accessible
  • Verify environment variables are set correctly
  • Try running the command manually to see error messages

No MCP tools available after reload

  • Verify servers show as "Connected" in claude mcp list
  • Reload Cursor window again
  • Check the Output panel (View → Output → Claude Code) for errors

Cursor's mcp.json file not being read by Claude Code

This is expected behavior and why migration is necessary. The Claude Code extension doesn't automatically read Cursor's ~/.cursor/mcp.json file for stdio servers. You must migrate them using the CLI as described in this guide.

How do I know which servers need migration?

  • stdio servers (have "command" field in Cursor config) - need migration
  • HTTP servers (have "url" field in Cursor config) - work automatically, no migration needed

Can I keep using Cursor's native MCP servers alongside Claude Code?

Yes! Cursor's native MCP integration and Claude Code's MCP servers operate independently. You can use both simultaneously.

Security Note

Never commit sensitive tokens to version control!

  • Store tokens in environment variables
  • Use .gitignore to exclude configuration files with secrets
  • Regenerate tokens immediately if accidentally exposed

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment