Skip to main content

Perplexity MCP Server

Project description

Perplexity Reasoning MCP Server

A Model Context Protocol (MCP) server that provides reasoning with deepseek R1, web search and citations functionality using Perplexity AI's API. Works with the Anthropic Claude desktop and compatible MCP clients.

Forked from jsonallen/perplexity-mcp and improved in several ways:

  1. Deepseek R1, Sonar and Sonar Pro Models
  2. You can change the model in the MCP client configuration file
  3. Increased the max output tokens to 8K
  4. Recency filter adjusted to be included only when the user specifies
  5. Citation URLs included in the output

Installation

Prerequisites

  1. Python 3.11 or higher - Install from python.org or your system's package manager

    • Windows users: Make sure to check "Add Python to PATH" during installation
    • Linux/macOS users: Most systems come with Python, but you may need to install Python 3.11+
  2. UV package manager (requires Python to be installed first):

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

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

User Installation (PyPI)

For users who want to use the MCP server:

uv pip install perplexity-mcp-server

Developer Installation (Local)

For developers who want to modify the server:

# Clone the repository
git clone https://github.com/felores/perplexity-mcp-server.git
cd perplexity-mcp-server

# Create and activate virtual environment
uv venv .venv
.\.venv\Scripts\activate  # Windows
source .venv/bin/activate # Unix

# Install in development mode
uv pip install -e .

Configuration

Claude Desktop Setup

  1. Get your API key from Perplexity AI

  2. Edit Claude's config file:

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

For Users (PyPI Installation)

{
  "perplexity-reasoning": {
    "env": {
      "PERPLEXITY_API_KEY": "your-api-key-here",
      "PERPLEXITY_MODEL": "sonar-reasoning"
    },
    "command": "uv",
    "args": ["run", "perplexity-mcp-server"]
  }
}

For Developers (Local Installation)

{
  "perplexity-reasoning": {
    "env": {
      "PERPLEXITY_API_KEY": "your-api-key-here",
      "PERPLEXITY_MODEL": "sonar-reasoning",
      "PYTHONPATH": "path/to/your/project/src"
    },
    "command": "python",
    "args": ["path/to/your/project/src/perplexity_mcp/run.py"]
  }
}

Available Models

  • sonar: Standard model (127k context)
  • sonar-pro: Advanced model (200k context)
  • sonar-reasoning: Chain of Thought model (127k context)

If no model is specified, defaults to sonar.

Usage

  1. Open Claude desktop client
  2. Try a prompt like: "Search the web for recent news about AI"
  3. Click "Allow for this chat" when prompted

Development

For development instructions, see DEVELOPMENT.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

perplexity_mcp_server-0.2.2.tar.gz (138.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

perplexity_mcp_server-0.2.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file perplexity_mcp_server-0.2.2.tar.gz.

File metadata

  • Download URL: perplexity_mcp_server-0.2.2.tar.gz
  • Upload date:
  • Size: 138.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for perplexity_mcp_server-0.2.2.tar.gz
Algorithm Hash digest
SHA256 e72621e203b4e244edd863a193330ee4595c4e1f658f14f965de4057536e1e6e
MD5 90c76378a86085a8fcd85d397d6373b6
BLAKE2b-256 3f65f5c1fdd994da666daf61ff87119707ce37167b21b9f3bda1d1d7277b9afa

See more details on using hashes here.

File details

Details for the file perplexity_mcp_server-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for perplexity_mcp_server-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ac61c4964f532f7b4a0cec5525646d0e1d777e00762e77ea0d6467b9ec647797
MD5 1ee0133f72a2c5fa28fd23c306f2ad1b
BLAKE2b-256 a6cee19de34497470393c58936340694d63eb4c37c13f1e92fca4eea9353b885

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page