home / mcp / perplexity mcp server

Perplexity MCP Server

Provides web search via Perplexity AI API for MCP clients like Claude Desktop and Cursor.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ayoubzeroual-perplexity-mcp": {
      "command": "uvx",
      "args": [
        "perplexity-mcp"
      ],
      "env": {
        "PERPLEXITY_MODEL": "sonar",
        "PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY"
      }
    }
  }
}

You can run a dedicated MCP server that provides web search capabilities through Perplexity AI and use it directly from Claude Desktop or Cursor. This server streamlines web queries by taking a prompt, performing a Perplexity search, and returning results for your conversations.

How to use

You use the perplexity-mcp server by connecting it to your MCP client, such as Claude Desktop or Cursor. Once connected, you can prompt it to search the web and fetch recent information. For example, you can ask it to look up what’s new at a specific company or topic and filter results by recency. The server exposes a single search tool named perplexity_search_web that accepts a query and an optional recency period to refine results. Use the tool within your MCP client by invoking a search prompt like: “Search the web for …” and specify how recent you want the results.

In practice, you craft a natural-language prompt that describes what you want to know, and the MCP client passes that to perplexity-mcp which returns a list of relevant results from Perplexity’s API. You can adjust the recency to last 24 hours, 7 days, 30 days (default), or 365 days to tailor scope.

How to install

Prerequisites you need before installing include a working Node or Python-based tooling environment and an MCP-capable client. You will also need a Perplexity API key to access the search API.

Install Perplexity MCP for Claude Desktop automatically via Smithery.

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

Install the Fast Python package manager UV if it is not already installed. Use the appropriate method for your platform.

# macOS using Homebrew
brew install uv

# macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

If you need to install UV manually, follow the platform-specific commands above to ensure you can run MCP servers locally.

Configure the required environment variable for Perplexity API access in your Claude Desktop configuration file. You will provide your API key there.

Additional configuration and verification

Set the following environment variables in your Claude Desktop config (or equivalent) to enable the perplexity-mcp server to start and to select a Perplexity model.

Required environment variable: PERPLEXITY_API_KEY your Perplexity API key.

Optional environment variable: PERPLEXITY_MODEL choose the Perplexity model you want, defaults to sonar if not specified.

Example values you might place in your config:

{
  "perplexity-mcp": {
    "env": {
      "PERPLEXITY_API_KEY": "YOUR_API_KEY",
      "PERPLEXITY_MODEL": "sonar"
    },
    "command": "uvx",
    "args": [
      "perplexity-mcp"
    ]
  }
}

Explicit MCP configuration (Cursor/Claude Desktop)

To add the server as a local MCP background service, include the following stdio configuration in the Cursor or Claude Desktop MCP settings.

{
  "perplexity_mcp": {
    "env": {
      "PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY",
      "PERPLEXITY_MODEL": "sonar"
    },
    "command": "uvx",
    "args": [
      "perplexity-mcp"
    ]
  }
}

Security and credentials

Treat your Perplexity API key as sensitive. Do not commit it to source control and store it in a secure environment variable store for your MCP client.

Troubleshooting

If you do not see results or the tool prompt fails to activate, verify that the UV runtime is installed correctly and that the PERPLEXITY_API_KEY is set in your client’s environment. Also confirm that the PERPLEXITY_MODEL value matches one of the available Perplexity models you intend to use.

Available tools

perplexity_search_web

Search the web using Perplexity AI. Accepts a required string argument query and an optional recency filter to constrain results by time window (day, week, month, year). Returns Perplexity search results.