TemperStack
Intermediate8 min readUpdated Mar 18, 2026

How to set up MCP servers on Cursor

Quick Answer

Setting up MCP servers on Cursor involves configuring the MCP settings in your Cursor preferences and connecting to your desired server endpoints. This enables enhanced AI capabilities and custom integrations within your development environment.

Prerequisites

  1. Cursor IDE installed
  2. Basic knowledge of JSON configuration
  3. Node.js or Python installed
  4. Understanding of server concepts
1

Open Cursor Settings

Launch Cursor and navigate to File > Preferences > Settings or use the keyboard shortcut Ctrl+, (Windows/Linux) or Cmd+, (Mac). In the settings search bar, type MCP to filter MCP-related options.
Tip
You can also access settings by clicking the gear icon in the bottom-left corner of Cursor.
2

Configure MCP Server Settings

Locate the MCP Server Configuration section. Click on Edit in settings.json to open the JSON configuration file. Add your MCP server configuration using this structure:
{
  "mcp.servers": {
    "your-server-name": {
      "command": "node",
      "args": ["path/to/your/server.js"],
      "env": {}
    }
  }
}
Tip
Replace 'your-server-name' with a descriptive name for your MCP server instance.
3

Install Required MCP Dependencies

Open Cursor's integrated terminal by pressing Ctrl+` or going to View > Terminal. Install the MCP SDK and any required packages:
npm install @modelcontextprotocol/sdk

For Python-based servers, use:
pip install mcp
Tip
Make sure you're in the correct project directory before installing dependencies.
4

Create or Configure Your MCP Server

Create a new file for your MCP server (e.g., mcp-server.js) or configure an existing one. Ensure your server implements the MCP protocol correctly with proper request handlers and response formatting. Update the file path in your settings.json to point to this server file.
Tip
Use the official MCP documentation and examples as a reference for server implementation.
5

Set Environment Variables

In your MCP server configuration, add any necessary environment variables under the env object:
"env": {
  "API_KEY": "your-api-key",
  "SERVER_PORT": "3000",
  "DEBUG": "true"
}

These variables will be available to your MCP server process.
Tip
Keep sensitive information like API keys in environment variables rather than hardcoding them.
6

Enable and Start MCP Server

Save your settings.json file and restart Cursor to apply the changes. Go to View > Command Palette (Ctrl+Shift+P) and search for MCP: Start Server. Select your configured server from the list to start it.
Tip
Check the Output panel for any startup logs or error messages from your MCP server.
7

Test MCP Server Connection

Verify your MCP server is working by opening the Output panel (View > Output) and selecting MCP from the dropdown. You should see connection logs and server status. Test functionality by using MCP-enabled features in Cursor's AI assistant or relevant extensions.
Tip
Use the developer console (Ctrl+Shift+I) to monitor network requests and debug connection issues.
8

Configure Server Permissions

In Cursor settings, navigate to MCP > Permissions and configure what your MCP server can access. Enable permissions for file system access, network requests, or other resources your server needs. Click Apply to save permission changes.
Tip
Only grant the minimum permissions necessary for your MCP server to function securely.

Troubleshooting

MCP server fails to start
Check the Output panel for error messages. Verify that the server file path in settings.json is correct and the file exists. Ensure all dependencies are properly installed.
Connection timeout errors
Increase the connection timeout in MCP settings. Check if your server is listening on the correct port and that no firewall is blocking the connection. Verify environment variables are set correctly.
Permission denied errors
Review and update MCP server permissions in Cursor Settings > MCP > Permissions. Ensure your server has the necessary file system or network access permissions enabled.
Server configuration not loading
Validate your settings.json syntax using a JSON validator. Restart Cursor completely after making configuration changes. Check that the MCP server name doesn't contain special characters or spaces.

Related Guides

More Cursor Tutorials

Other Tool Tutorials

Ready to get started with Cursor?

Put this tutorial into practice. Visit Cursor and follow the steps above.

Visit Cursor