Labsco
palolxx logo

OpenRouter MCP Client for Cursor

โ˜… 2

from palolxx

An MCP client for Cursor that uses OpenRouter.ai to access multiple AI models. Requires an OpenRouter API key.

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

OpenRouter MCP Client for Cursor

A Model Context Protocol (MCP) client for Cursor that utilizes OpenRouter.ai to access multiple AI models.

Features

  • Connect to OpenRouter.ai via MCP
  • Access multiple AI models from various providers (Google, DeepSeek, Meta, etc.)
  • Use MCP transport mechanism to communicate with Cursor
  • Cache model information to reduce API calls
  • Support for both free and paid models
  • Multi-model completion utility to combine results from multiple models

Available Models

This client provides access to all models available on OpenRouter, including:

  • Google Gemini 2.5 Pro
  • DeepSeek Chat v3
  • Meta Llama 3.1
  • DeepSeek R1
  • Qwen Coder
  • Mistral Small 3.1
  • And many more!

Cursor Integration

To use this client with Cursor, you need to update Cursor's MCP configuration file:

  1. Find Cursor's configuration directory:

    • Windows: %USERPROFILE%\.cursor\
    • macOS: ~/.cursor/
    • Linux: ~/.cursor/
  2. Edit or create the mcp.json file in that directory. Add a configuration like this:

{
  "mcpServers": {
    "custom-openrouter-client": {
      "command": "node",
      "args": [
        "FULL_PATH_TO/openrouter-mcp-client/dist/index.js"
      ],
      "env": {
        "OPENROUTER_API_KEY": "your_api_key_here",
        "OPENROUTER_DEFAULT_MODEL": "google/gemini-2.5-pro-exp-03-25:free"
      }
    }
  }
}

Replace FULL_PATH_TO with the actual path to your client installation.

  1. Restart Cursor

  2. Select the client by:

    • Opening Cursor
    • Press Ctrl+Shift+L (Windows/Linux) or Cmd+Shift+L (macOS) to open the model selector
    • Choose "custom-openrouter-client" from the list

Direct Testing (without MCP)

Uncomment the test functions in src/index.ts to test direct API interaction:

// Uncomment to test the direct API
testDirectApi().catch(console.error);
testMultiModelCompletion().catch(console.error);

Then run:

npm start

Development

# Watch mode for development
npm run dev