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:- Cursor IDE installed (latest version recommended)
- Portkey account with workspace access
- MCP server registered in Portkey’s MCP Hub
Quick Setup
Step 1: Get Your MCP Server URL
- Log in to Portkey Dashboard
- Navigate to MCP Hub → Your Servers
- Copy your server URL:
Step 2: Configure MCP for Your Project (Recommended)
We recommend configuring MCP servers at the project level for better organization and team collaboration.- Navigate to your project root directory
- Create the configuration directory and file:
- Create
mcp.json
in the.cursor
directory
Step 3: Add Your Server Configuration
Add this configuration to.cursor/mcp.json
:
- 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
Project-Level Configuration (Recommended)
Location:.cursor/mcp.json
in your project root
Global Configuration (Alternative)
For tools you want available across all projects, you can use global configuration: Location:~/.cursor/mcp.json
in your home directory
Using Both Configurations
Cursor loads both global and project configurations. Project settings take precedence when there are conflicts.Authentication
Portkey handles all authentication flows automatically:-
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
- Subsequent Connections: Authentication tokens are refreshed automatically
- Team Access: Workspace members share the same authentication scope based on your Portkey settings
Troubleshooting
MCP Servers Not Loading
- Verify
.cursor/mcp.json
exists in your project root - Check JSON syntax is valid
- 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:- 📧 Email: support@portkey.ai
- 💬 Discord: Join our community
- 📚 Documentation: docs.portkey.ai