Perplexity Research Assistant MCP server

Integrates with Perplexity Sonar Pro API to provide real-time research assistance for developers, enabling efficient documentation retrieval, API discovery, and code analysis
Back to servers
Provider
DaInfernalCoder
Release date
Jan 27, 2025
Language
TypeScript
Stats
184 stars

The Perplexity MCP Server is an intelligent research assistant powered by Perplexity's specialized AI models. It automatically detects query complexity to route requests to the most appropriate model for optimal results, and provides search capabilities for all tasks.

Installation

Prerequisites

Configuration

Add the server to your MCP settings file with one of these methods:

Option 1: Using NPX (Recommended for macOS)

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

Option 2: Using Local Installation

{
  "mcpServers": {
    "perplexity": {
      "command": "node",
      "args": ["/path/to/perplexity-server/build/index.js"],
      "env": {
        "PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Available Tools

Search (Sonar Pro)

Best for straightforward questions that need concise, direct answers.

const result = await use_mcp_tool({
  server_name: "perplexity",
  tool_name: "search",
  arguments: {
    query: "What is the capital of France?",
    force_model: false // Optional: force using this model even if query seems complex
  }
});

Reason (Sonar Reasoning Pro)

Perfect for explanations, comparisons, and problem-solving that require detailed analysis.

const result = await use_mcp_tool({
  server_name: "perplexity",
  tool_name: "reason",
  arguments: {
    query: "Compare and contrast REST and GraphQL APIs, explaining their pros and cons",
    force_model: false // Optional: force using this model even if query seems simple
  }
});

Deep Research (Sonar Deep Research)

Ideal for in-depth analysis of complex topics and comprehensive research reports.

const result = await use_mcp_tool({
  server_name: "perplexity",
  tool_name: "deep_research",
  arguments: {
    query: "The impact of quantum computing on cryptography",
    focus_areas: [
      "Post-quantum cryptographic algorithms",
      "Timeline for quantum threats",
      "Practical mitigation strategies"
    ],
    force_model: false // Optional: force using this model even if query seems simple
  }
});

Note: The Deep Research tool may timeout with some tools like Cline due to implementation differences, but works well with other tools like Cursor.

Intelligent Model Selection

The server automatically analyzes query complexity to route requests to the most appropriate model:

  • Simple Queries → Sonar Pro

    • Basic information lookup
    • Straightforward questions
    • Quick facts
  • Complex Queries → Sonar Reasoning Pro

    • How/why questions
    • Comparisons
    • Step-by-step explanations
    • Problem-solving tasks
  • Research Queries → Sonar Deep Research

    • In-depth analysis
    • Comprehensive research
    • Detailed investigations
    • Multi-faceted topics

You can override the automatic selection using force_model: true in any tool's arguments.

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