Skip to content

MCP Setup

Model Context Protocol (MCP) servers transform Cursor from a code editor into a comprehensive development platform. In this 10-minute guide, you’ll set up essential MCP servers that integrate documentation, browser automation, version control, and more.

Documentation Access

Real-time access to latest library docs preventing outdated code suggestions

Browser Automation

Test web apps, take screenshots, and automate browser tasks

Database Operations

Query databases, inspect schemas, and manage data directly

External Services

Connect to APIs, project management tools, and third-party services

  1. Verify Node.js 18+:

    Terminal window
    node --version # Should show v18.0.0 or higher
  2. Check npm:

    Terminal window
    npm --version # Should be 8.0.0 or higher
  3. Create MCP Config Directory:

    Terminal window
    mkdir -p ~/.cursor
    touch ~/.cursor/mcp.json

Why Context7?

Access up-to-date documentation for 4,000+ libraries. No more outdated Stack Overflow code!

Add Context7 to Cursor

Click the link above to automatically install Context7

# Get latest Next.js docs
"How do I use the new App Router in Next.js? Use context7"
# Learn library APIs
"Show me how to use React Query for data fetching with context7"
# Framework comparisons
"Compare Vue 3 Composition API with React Hooks using context7"

Why Puppeteer?

Automate browser testing, take screenshots, scrape data, and test user flows.

{
"mcpServers": {
"puppeteer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
}
}
}
  1. Screenshot Testing:

    "Navigate to localhost:3000 and take a screenshot of the homepage"
  2. E2E Testing:

    "Test the login flow: go to /login, enter test@example.com
    and password123, click submit, verify redirect to /dashboard"
  3. Visual Regression:

    "Take screenshots of all main pages and compare with
    the screenshots in /tests/visual-baseline"

Why Filesystem?

Perform advanced file operations beyond the workspace, bulk file management, and system integration.

{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem"]
}
}
}

Allow broader access for development:

{
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem"],
"env": {
"ALLOWED_PATHS": "/Users/dev/projects,/tmp"
}
}
}

Why GitHub MCP?

Manage issues, PRs, and repository operations without leaving Cursor.

First install GitHub CLI:

Terminal window
# macOS
brew install gh
# Windows
winget install GitHub.cli
# Linux
sudo apt install gh

Then authenticate:

Terminal window
gh auth login
# Create issue
"Create a GitHub issue titled 'Add dark mode' with labels: enhancement, ui"
# PR management
"List all open PRs and summarize their status"
# Code review
"Review the latest PR and comment on any potential issues"

Why Database MCP?

Query data, inspect schemas, and manage database operations directly from Cursor.

  1. Install Server:

    {
    "mcpServers": {
    "postgres": {
    "command": "npx",
    "args": [
    "-y",
    "@modelcontextprotocol/server-postgres",
    "postgresql://user:pass@localhost:5432/dbname"
    ]
    }
    }
    }
  2. Secure Credentials:

    {
    "postgres": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-postgres"],
    "env": {
    "DATABASE_URL": "postgresql://user:pass@localhost:5432/dbname"
    }
    }
    }
{
"mysql": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mysql",
"mysql://user:pass@localhost:3306/dbname"
]
}
}

Linear Integration

Sync tasks, create issues, and update project status without context switching.

{
"mcpServers": {
"linear": {
"url": "https://mcp.linear.app/sse"
}
}
}

For legacy npm package (deprecated):

{
"mcpServers": {
"linear": {
"command": "npx",
"args": ["-y", "linear-mcp-server"],
"env": {
"LINEAR_API_KEY": "your-api-key"
}
}
}
}
{
"mcpServers": {
"jira": {
"command": "npx",
"args": ["-y", "@mcp-devtools/jira"],
"env": {
"JIRA_URL": "https://company.atlassian.net",
"JIRA_EMAIL": "you@company.com",
"JIRA_API_TOKEN": "your-token"
}
}
}
}

Alternatively, use @aot-tech/jira-mcp-server.

Figma Integration

Convert designs to code, extract design tokens, and maintain design consistency.

{
"mcpServers": {
"figma": {
"command": "npx",
"args": ["-y", "figma-mcp-server"],
"env": {
"FIGMA_ACCESS_TOKEN": "your-token"
}
}
}
}

Alternatively, use figma-developer-mcp for enhanced features.

Usage:

"Get the color palette from our design system in Figma"
"Convert the LoginScreen frame to React components"

Here’s a comprehensive ~/.cursor/mcp.json with all essential servers:

{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
},
"puppeteer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem"]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"DATABASE_URL": "${DATABASE_URL}"
}
},
"linear": {
"url": "https://mcp.linear.app/sse"
}
}
}
  1. Open Cursor Settings: Cmd/Ctrl + Shift + J

  2. Navigate to: Tools & Integrations → Model Context Protocol

  3. Verify Status:

    • Green dot = Running
    • Red dot = Error (check logs)
    • Gray = Not started
  4. Test Each Server:

    # Test Context7
    "What's new in React 19? Use context7"
    # Test Puppeteer
    "Navigate to google.com and take a screenshot"
    # Test GitHub
    "List my recent GitHub issues"

Server won’t start:

  • Check Node.js version
  • Verify JSON syntax
  • Check file permissions

Authentication errors:

  • Verify API tokens
  • Check environment variables
  • Confirm network access

Performance issues:

  • Limit active servers
  • Increase Node memory
  • Check system resources

Use Environment Variables

Never hardcode credentials in mcp.json

"env": {
"API_KEY": "${API_KEY}"
}

Restrict Permissions

Limit filesystem access and use read-only where possible

Audit Servers

Review MCP server code before installation

Rotate Credentials

Regularly update API keys and tokens

Terminal window
# Create shortcuts for common MCP operations
# Note: Use Cursor's UI to check MCP server status and reload
# View > Output > Select "MCP" from dropdown

Create .cursor/mcp.json in project root:

{
"mcpServers": {
"project-db": {
"command": "docker",
"args": ["exec", "project-db", "psql"]
}
}
}

Use environment detection:

{
"mcpServers": {
"dev-db": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"DATABASE_URL": "${DEV_DATABASE_URL}"
},
"condition": "${NODE_ENV} === 'development'"
}
}
}
  1. Explore More Servers: Browse the MCP Directory
  2. Build Custom Servers: Create MCP servers for your specific needs
  3. Share Configurations: Check .cursor/mcp.json into Git for team use

Continue to First Feature

Now let’s build your first AI-assisted feature using everything we’ve configured.

First Feature →

Time: 15 minutes