Perplexity Search MCP server

Integrates with Perplexity AI search API to enable real-time web searches with customizable parameters for recency filtering, domain-specific queries, and citation support.
Back to servers
Setup instructions
Provider
chenxilol
Release date
Mar 29, 2025
Language
Go
Stats
4 stars

This MCP server enables large language models (LLMs) like Claude to access the Perplexity search API through the Model Context Protocol, allowing real-time web searches with results and citations directly within conversations.

Features

  • perplexity_search: Perform web searches and return results, including citations
    • Parameters:
      • query (string, required): The search query
      • search_recency_filter (string, optional): Filter results by time (month, week, day, hour)
      • max_tokens (integer, optional): Maximum number of tokens to return
      • temperature (number, optional, default: 0.2): Controls randomness in response
      • top_p (number, optional, default: 0.9): Nucleus sampling threshold
      • search_domain_filter (array, optional): List of domains to limit search results
      • return_images (boolean, optional): Include image links in results
      • return_related_questions (boolean, optional): Include related questions
      • top_k (number, optional, default: 0): Number of tokens for top-k filtering
      • stream (boolean, optional): Stream response incrementally
      • presence_penalty (number, optional, default: 0): Adjust likelihood of new topics
      • frequency_penalty (number, optional, default: 1): Reduce repetition
      • web_search_options (object, optional): Configuration options for web search

Installation

Installing via Smithery

The easiest way to install Perplexity Search MCP for Claude Desktop is via Smithery:

npx -y @smithery/cli install @chenxilol/perplexity-mcp-go --client claude

Manual Installation

Prerequisites

  • Go 1.23 or higher
  • Perplexity API key

Building from Source

  1. Clone the repository:
git clone https://github.com/chenxilol/perplexity-mcp-go.git
cd perplexity-mcp-go
  1. Build the application:
go build -o perplexity-search-mcp

Running Locally

  1. Set your Perplexity API key:
export PERPLEXITY_API_KEY="your-api-key-here"
  1. Run the server:
./perplexity-search-mcp

Using Docker

  1. Build the Docker image:
docker build -t perplexity-search-mcp:latest .
  1. Run the container:
docker run -i --rm -e PERPLEXITY_API_KEY=your-api-key-here perplexity-search-mcp:latest

Configuration

Integrating with Claude Desktop

  1. Copy the Claude configuration file to your Claude configuration directory:

    • Windows: %USERPROFILE%\AppData\Roaming\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. Edit the configuration file to include your API key:

{
  "mcpServers": {
    "perplexity-search": {
      "command": "/path/to/perplexity-search-mcp",
      "env": {
        "PERPLEXITY_API_KEY": "your-api-key-here"
      }
    }
  }
}

Usage Examples

Once configured, Claude can use the perplexity_search tool via MCP. Here's an example of search parameters:

{
  "query": "latest AI research developments",
  "search_recency_filter": "week",
  "temperature": 0.5,
  "return_related_questions": true,
  "web_search_options": {
    "search_context_size": "high"
  }
}

Troubleshooting

If you encounter issues:

  • Verify your API key is correctly set in the environment variable or configuration file
  • Check network connectivity to ensure the server can reach the Perplexity API
  • Examine stderr logs for specific error messages

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "perplexity-search" '{"command":"/path/to/perplexity-search-mcp","env":{"PERPLEXITY_API_KEY":"your-api-key-here"}}'

See the official Claude Code MCP documentation for more details.

For 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 > Tools & Integrations and click "New MCP Server".

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

{
    "mcpServers": {
        "perplexity-search": {
            "command": "/path/to/perplexity-search-mcp",
            "env": {
                "PERPLEXITY_API_KEY": "your-api-key-here"
            }
        }
    }
}

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "perplexity-search": {
            "command": "/path/to/perplexity-search-mcp",
            "env": {
                "PERPLEXITY_API_KEY": "your-api-key-here"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

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