Skip to main content

Overview

Cursor is an AI-powered IDE that supports MCP (Model Context Protocol) for enhanced code intelligence and tool integration. Through Portkeyโ€™s MCP Gateway, you can seamlessly connect any MCP server to Cursor without managing infrastructure or authentication.

Key Benefits

  • Secure Authentication: Portkey handles OAuth flows and token management
  • Unified Authentication: Single OAuth token to manage all your MCP servers
  • Team Collaboration: Share MCP server configurations, manage access permissions, and ensure everyone on your team has the tools they needโ€”configured correctly, every time
  • Complete Observability: See every request, track latency, monitor errors, and understand usage patterns

Prerequisites

Before you begin, ensure you have:
  1. Cursor IDE installed (latest version recommended)
  2. Portkey account with workspace access
  3. MCP server registered in Portkeyโ€™s MCP Hub

Quick Setup

Step 1: Get Your MCP Server URL

  1. Log in to Portkey Dashboard
  2. Navigate to MCP Hub โ†’ Your Servers
  3. Copy your server URL:
    https://mcp.portkey.ai/:workspace-id/:server-id/mcp
    
We recommend configuring MCP servers at the project level for better organization and team collaboration.
  1. Navigate to your project root directory
  2. Create the configuration directory and file:
    mkdir -p .cursor
    cd .cursor
    
  3. Create mcp.json in the .cursor directory

Step 3: Add Your Server Configuration

Add this configuration to .cursor/mcp.json:
{
  "mcpServers": {
    "your-server-name": {
      "url": "https://mcp.portkey.ai/:workspace-id/:server-id/mcp"
    }
  }
}
This project-level configuration ensures:
  • Team members automatically get the correct MCP setup when cloning the repository
  • Project-specific tools are only available where needed
  • Configuration travels with your codebase

Configuration Examples

Location: .cursor/mcp.json in your project root
{
  "mcpServers": {
    "linear": {
      "url": "https://mcp.portkey.ai/ws-abc123/linear-def456/mcp"
    },
    "github": {
      "url": "https://mcp.portkey.ai/ws-abc123/github-ghi789/mcp"
    }
  }
}

Global Configuration (Alternative)

For tools you want available across all projects, you can use global configuration: Location: ~/.cursor/mcp.json in your home directory
{
  "mcpServers": {
    "general-tools": {
      "url": "https://mcp.portkey.ai/ws-abc123/tools-xyz789/mcp"
    }
  }
}

Using Both Configurations

Cursor loads both global and project configurations. Project settings take precedence when there are conflicts.
# Project structure
your-project/
โ”œโ”€โ”€ .cursor/
โ”‚   โ””โ”€โ”€ mcp.json       # Project-specific MCP servers
โ”œโ”€โ”€ src/
โ””โ”€โ”€ README.md

# Home directory
~/
โ””โ”€โ”€ .cursor/
    โ””โ”€โ”€ mcp.json       # Global MCP servers

Authentication

Portkey handles all authentication flows automatically:
  1. First Connection: When Cursor first connects to an authenticated MCP server, Portkey will:
    • Open your browser for OAuth authorization (if required)
    • Store credentials securely
    • Maintain session state
  2. Subsequent Connections: Authentication tokens are refreshed automatically
  3. Team Access: Workspace members share the same authentication scope based on your Portkey settings

Troubleshooting

MCP Servers Not Loading

  1. Verify .cursor/mcp.json exists in your project root
  2. Check JSON syntax is valid
  3. Restart Cursor after configuration changes

View MCP Settings

  • Quick Access: Cmd/Ctrl + Shift + P โ†’ View: Open MCP settings
  • This shows all loaded MCP configurations from both project and global sources

Support

Need help? Weโ€™re here for you:
Last modified on April 8, 2026