home / mcp / perplexity mcp server

Perplexity MCP Server

Provides intelligent model selection, conversation management, and project-aware storage for Perplexity models via MCP.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "cfdude-mcp-perplexity-pro": {
      "command": "npx",
      "args": [
        "mcp-perplexity-pro",
        "--transport=stdio"
      ],
      "env": {
        "PROJECT_ROOT": "/workspace/project",
        "STORAGE_PATH": ".perplexity",
        "DEFAULT_MODEL": "sonar-reasoning-pro",
        "PERPLEXITY_API_KEY": "your-api-key-here"
      }
    }
  }
}

You will deploy and operate a MCP server that intelligently selects Perplexity models, manages conversations, stores data project-wide, and supports both local and transport-based execution. This guide shows you how to use the server with MCP clients, install it, and configure security, storage, and runtime options so you can build interactive, scalable AI-assisted workflows.

How to use

Use the MCP server from your preferred MCP client to ask questions, conduct research, chat, and run long-running tasks. The server will pick the best model for each query, maintain full conversation history, and save chats and reports within your project directory for easy organization and persistence. You can operate the server via local stdio transport (npx) or through Docker, choosing transport that matches your workflow and environment.

How to install

Prerequisites: install Node.js 20+ and obtain a Perplexity API key.

# Install the MCP server globally
npm install -g mcp-perplexity-pro

Additional setup steps

Set your Perplexity API key in the environment where you run the MCP server. You can also configure default model, project root, and storage path to tailor storage and behavior to your environment.

{
  "PERPLEXITY_API_KEY": "your-api-key-here",
  "DEFAULT_MODEL": "sonar-reasoning-pro",
  "PROJECT_ROOT": "/path/to/your/project",
  "STORAGE_PATH": ".perplexity"
}

Running options and commands

Choose a transport method that suits your setup. The following options are documented configurations you can use directly in your MCP client.

{
  "mcpServers": {
    "perplexity": {
      "command": "npx",
      "args": ["mcp-perplexity-pro", "--transport=stdio"],
      "env": {
        "PERPLEXITY_API_KEY": "your-api-key-here"
      }
    }
  }
}

Docker deployment options

You can run the MCP server in Docker with stdio transport or via Docker Compose. Ensure your API key is set in the environment before starting.

# Set your API key
export PERPLEXITY_API_KEY="your-api-key-here"

# Start the stdio service with Docker Compose
docker-compose --profile stdio up -d mcp-perplexity-pro-stdio

Networking and ports

Legacy HTTP transport is available for certain clients, but the recommended approach is to use stdio transport with explicit control over the MCP server process. When using HTTP-based workflows, ensure ports are correctly exposed and the API key is provided in the environment.

Notes on storage and persistence

All conversations and research reports are stored under your project directory in a structured layout. This enables session persistence across restarts and easy backup.

Available tools

askPerplexity

Query the Perplexity models with intelligent selection based on the type of question or prompt.

researchPerplexity

Perform comprehensive research and generate a structured report, with an option to save the report to the project directory.

chatPerplexity

Start or continue conversations with full context, including title support for new conversations.

listChatsPerplexity

List all conversations stored in the current project.

readChatPerplexity

Retrieve the full conversation history for a given chat.

asyncPerplexity

Create long-running research jobs for complex queries and handle asynchronous results.

checkAsyncPerplexity

Check the status of an asynchronous job and optionally save the completed report.

storageStatsPerplexity

Get storage statistics and usage information for the project data.

modelInfoPerplexity

Get information about available models and their capabilities.