Perplexity AI MCP server

Connects Claude Desktop to Perplexity AI's language models through a lightweight proxy, offering web search capabilities with llama-3.1-sonar-small-128k-online and multi-turn conversations with mixtral-8x7b-instruct.
Back to servers
Provider
Family-IT-Guy
Release date
Mar 20, 2025
Language
TypeScript
Stats
2 stars

The Perplexity MCP Server integrates Perplexity AI as a tool provider for Claude Desktop using the Model Context Protocol (MCP). This allows Claude users to access Perplexity's AI models for both single questions and multi-turn conversations directly from the desktop application.

Installation

Prerequisites

Option 1: Clone and Run Locally

  1. Clone the repository:

    git clone https://github.com/Family-IT-Guy/perplexity-mcp.git
    cd perplexity-mcp
    
  2. Install dependencies:

    npm install
    
  3. Create a .env file with your API key:

    PERPLEXITY_API_KEY=your_api_key_here
    
  4. Test the server:

    node server.js
    

Option 2: Install Globally

  1. Clone and navigate to the repository as above

  2. Install globally:

    npm install -g .
    
  3. Now you can run the server from anywhere:

    perplexity-mcp
    

Configuration

Add the appropriate configuration to your claude_desktop_config.json file:

Standard Configuration

{
  "mcpServers": {
    "perplexity": {
      "command": "node",
      "args": [
        "/absolute/path/to/perplexity-mcp/server.js"
      ],
      "env": {
        "PERPLEXITY_API_KEY": "your_perplexity_api_key"
      }
    }
  }
}

Global Installation Configuration

{
  "mcpServers": {
    "perplexity": {
      "command": "npx",
      "args": [
        "perplexity-mcp"
      ],
      "env": {
        "PERPLEXITY_API_KEY": "your_perplexity_api_key"
      }
    }
  }
}

NVM Users Configuration

If you're using Node Version Manager (NVM), you need absolute paths:

{
  "mcpServers": {
    "perplexity": {
      "command": "/Users/username/.nvm/versions/node/v16.x.x/bin/node",
      "args": [
        "/Users/username/path/to/perplexity-mcp/server.js"
      ],
      "env": {
        "PERPLEXITY_API_KEY": "your_perplexity_api_key"
      }
    }
  }
}

Using Perplexity Tools

After configuration, Claude Desktop will have access to these Perplexity tools:

Single Questions

Use the perplexity_ask tool to send a single question to Perplexity:

  • Parameters:
    • query (required): The question to ask
    • model (optional): Model name (default: llama-3.1-sonar-small-128k-online)

Multi-turn Conversations

Use the perplexity_chat tool for multi-turn conversations:

  • Parameters:
    • messages (required): Array of conversation messages
    • model (optional): Model name (default: mixtral-8x7b-instruct)

Troubleshooting

If you encounter issues with the Perplexity MCP Server:

  • Check logs: cat ~/.claude/logs/perplexity.log
  • Ensure your Perplexity API key is valid and properly set
  • Verify your claude_desktop_config.json format is correct
  • Enable verbose logging by adding "DEBUG": "1" to the env section of your configuration

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later