Adding MCP to Cursor

What is MCP in Cursor?

The Model Context Protocol (MCP) in Cursor AI allows you to connect external tools and data sources to enhance your coding experience. MCP servers enable Cursor to access databases, third-party APIs, and other external services, providing richer context for AI-assisted development.

With MCP in Cursor, you can:

  • Connect to external databases and APIs

  • Access real-time data during coding sessions

  • Integrate custom tools and services

  • Extend Cursor's contextual understanding

  • Automate complex development workflows

Prerequisites

Before setting up MCP with Cursor, ensure you have:

  • Cursor AI installed

  • Node.js and npm installed on your system

  • Your NLX API key and application URL

  • Basic familiarity with JSON configuration

Setup Instructions

Step 1: Install Cursor AI

If you haven't already, download and install Cursor from cursor.com/download.

Step 2: Access MCP Settings

  1. Open Cursor AI

  2. Navigate to Settings (Cmd/Ctrl + ,)

  3. Look for MCP Servers or Tools section

  4. Enable MCP server functionality

Step 3: Configure MCP Servers

Cursor uses a similar configuration approach to Claude Desktop. Access your MCP configuration file and add the NLX server:

{
  "mcpServers": {
    "nlx-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@nlxai/mcp-nodejs-server"
      ],
      "env": {
        "NLX_API_KEY": "your-actual-api-key",
        "NLX_APP_URL": "your-application-url"
      }
    }
  }
}

Step 4: Configure Environment Variables

Replace the placeholder values with your actual NLX credentials:

  • NLX_API_KEY: Your NLX API key from your NLX dashboard

  • NLX_APP_URL: Your NLX application URL

Example configuration:

{
  "mcpServers": {
    "nlx-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@nlxai/mcp-nodejs-server"
      ],
      "env": {
        "NLX_API_KEY": "nlx_api_1234567890abcdef",
        "NLX_APP_URL": "https://your-app.nlx.ai"
      }
    }
  }
}

Step 5: Enable and Manage MCP Servers

  1. In Cursor's MCP settings, toggle available MCP servers

  2. Enable the NLX MCP server you just configured

  3. Configure auto-run settings as needed

  4. Restart Cursor to apply changes

Using MCP in Cursor

Accessing MCP Tools

Once configured, MCP servers provide additional tools and context to Cursor's AI:

  1. In Chat: MCP tools become available during AI conversations

  2. In Code: Context from external sources can inform code suggestions

  3. In Commands: Custom MCP tools can be invoked through Cursor's command palette

Advanced Configuration

Multiple MCP Servers

Configure multiple MCP servers for different use cases:

{
  "mcpServers": {
    "nlx-mcp-server": {
      "command": "npx",
      "args": ["-y", "@nlxai/mcp-nodejs-server"],
      "env": {
        "NLX_API_KEY": "your-nlx-api-key",
        "NLX_APP_URL": "your-nlx-app-url"
      }
    },
    "database-mcp-server": {
      "command": "npx",
      "args": ["-y", "@your-org/database-mcp"],
      "env": {
        "DATABASE_URL": "your-database-url"
      }
    }
  }
}

Auto-run Configuration

Configure which servers should auto-start:

{
  "mcpServers": {
    "nlx-mcp-server": {
      "command": "npx",
      "args": ["-y", "@nlxai/mcp-nodejs-server"],
      "env": {
        "NLX_API_KEY": "your-api-key",
        "NLX_APP_URL": "your-app-url"
      },
      "autorun": true
    }
  }
}

Development Mode

For local development, you can point to local MCP servers:

{
  "mcpServers": {
    "nlx-mcp-local": {
      "command": "node",
      "args": ["./local-mcp-server.js"],
      "env": {
        "NLX_API_KEY": "your-api-key",
        "NLX_APP_URL": "http://localhost:3000",
        "NODE_ENV": "development"
      }
    }
  }
}

Troubleshooting

Common Issues

MCP server not appearing in tools:

  • Verify the server is properly enabled in settings

  • Check that Node.js can execute the npx command

  • Restart Cursor after configuration changes

Connection errors:

  • Verify your NLX API credentials are correct

  • Check network connectivity to your NLX application

  • Review Cursor's debug logs for error details

Performance issues:

  • Consider disabling auto-run for resource-intensive servers

  • Monitor system resources when multiple MCP servers are active

  • Use selective server enabling based on current projects

Debug Mode

Enable verbose logging for troubleshooting:

{
  "mcpServers": {
    "nlx-mcp-server": {
      "command": "npx",
      "args": ["-y", "@nlxai/mcp-nodejs-server"],
      "env": {
        "NLX_API_KEY": "your-api-key",
        "NLX_APP_URL": "your-app-url",
        "DEBUG": "mcp:*",
        "LOG_LEVEL": "verbose"
      }
    }
  }
}

Cursor-Specific Debugging

  1. Check MCP Status: Look for MCP server status indicators in Cursor's UI

  2. Review Logs: Access Cursor's developer console for MCP-related logs

  3. Test Connectivity: Try manual npm installation to verify server availability

Integration with Development Workflow

Code Intelligence

With NLX MCP server, Cursor can provide:

  • Contextual suggestions based on your NLX application data

  • API integration guidance for NLX services

  • Real-time application insights during development

Project Setup

For NLX projects, consider adding MCP configuration to your project:

// .cursor/mcp-config.json
{
  "mcpServers": {
    "nlx-project-server": {
      "command": "npx",
      "args": ["-y", "@nlxai/mcp-nodejs-server"],
      "env": {
        "NLX_API_KEY": "${NLX_API_KEY}",
        "NLX_APP_URL": "${NLX_APP_URL}"
      }
    }
  }
}

Next Steps

After setting up MCP with Cursor:

  1. Explore the MCP Directory for additional useful servers

  2. Test integration with your NLX applications

  3. Customize workflows using MCP tools in your development process

  4. Consider building custom MCP servers for project-specific needs

Support Resources

Last updated