Perplexity MCP Server

by sengokudaikon
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Provides tools for interacting with Perplexity AI, enabling expert programming assistance through direct questions and maintaining ongoing conversations with persistent chat history.

  • Supports Perplexity's Sonar model variants (sonar-pro, sonar-reasoning-pro) for different AI capabilities, configurable through environment variables.

  • Uses SQLite for persistent storage of chat history data, allowing conversations with Perplexity AI to be continued across sessions.

Perplexity MCP Server

MCP Server for the Perplexity API.

Components

Tools

  • ask_perplexity: Request expert programming assistance through Perplexity. Focuses on coding solutions, error debugging, and technical explanations. Returns responses with source citations and alternative suggestions.
  • chat_perplexity: Maintains ongoing conversations with Perplexity AI. Creates new chats or continues existing ones with full history context. Returns chat ID for future continuation.

Key Features

  • Model Configuration via Environment Variable: Allows you to specify the Perplexity model using the PERPLEXITY_MODEL environment variable for flexible model selection.You can also specify PERPLEXITY_MODEL_ASK and PERPLEXITY_MODEL_CHAT to use different models for the ask_perplexity and chat_perplexity tools, respectively.These will override PERPLEXITY_MODEL. You can check which models are available on the Perplexity documentation.
  • Persistent Chat History: The chat_perplexity tool maintains ongoing conversations with Perplexity AI. Creates new chats or continues existing ones with full history context. Returns chat ID for future continuation.
  • Streaming Responses with Progress Reporting: Uses progress reporting to prevent timeouts on slow responses.

Quickstart

Installation

Prerequisites

Open PowerShell as Administrator and run:

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

Windows Installation Notes:

  • Ensure Python 3.10+ is installed and added to PATH

Run the following command in your terminal:

curl -LsSf https://astral.sh/uv/install.sh | sh

Unix Installation Notes:

  • The script will install uvx to ~/.cargo/bin by default
  • You may need to restart your terminal session after installation

Configure your MCP Client

To use this MCP server, you need to configure your MCP client to connect to it. The configuration method will vary depending on your specific client.

Below is an example configuration in JSON format:

"mcpServers": { "mcp-perplexity": { "command": "uvx", "args": [ "mcp-perplexity" ], "env": { "PERPLEXITY_API_KEY": "your-perplexity-api-key", "PERPLEXITY_MODEL": "sonar-pro", "PERPLEXITY_MODEL_ASK": "sonar-pro", "PERPLEXITY_MODEL_CHAT": "sonar-reasoning-pro", "DB_PATH": "path/to/custom.db" } } }

Important notes:

  • Replace "your-perplexity-api-key" with your actual Perplexity API key
  • Environment variables configuration:
    • PERPLEXITY_MODEL: Default model for both tools
    • PERPLEXITY_MODEL_ASK: Overrides default model for ask_perplexity tool
    • PERPLEXITY_MODEL_CHAT: Overrides default model for chat_perplexity tool
    • DB_PATH: Custom path for SQLite chat history database (default: chats.db)
  • Consult the Perplexity model docs for available models
  • Use the mcp-starter script to easily add this MCP server to Cursor IDE.
-
security - not tested
A
license - permissive license
-
quality - not tested

Provides access to Perplexity AI models through two tools: ask_perplexity for expert programming assistance and chat_perplexity for maintaining ongoing conversations with context preservation.

  1. Components
    1. Tools
  2. Key Features
    1. Quickstart
      1. Installation