Perplexity Advanced

by code-yeongyu

20 stars
2.6k downloads
Not rated
GitHub

About

Command-line interface for interacting with Perplexity and OpenRouter APIs, supporting both simple queries and complex file attachments with easy provider switching through a containerized Docker implementation.

Details

Author
code-yeongyu
Repository
code-yeongyu/perplexity-advanced-mcp
GitHub stars
20
Downloads
2,584
Categories
Productivity, Developer Tools, Design, Workplace, File Management, AI, Search, API, Infrastructure, Frontend

- Unified API Client: Supports both OpenRouter and Perplexity APIs with configurable models for handling simple and complex queries.
- Command-Line Interface (CLI): Manage API key configuration and run the MCP server using Typer.
- Advanced Query Processing: Incorporates file attachment processing, allowing you to include contextual data in your queries.
- Robust Retry Mechanism: Utilizes Tenacity for retry logic to ensure consistent and reliable API communications.
- Customizable Logging: Flexible logging configuration for detailed debugging and runtime monitoring.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Perplexity Advanced
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 -y
    • Argument 2 @highlight/mcp-server

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

For the best experience with AI assistants (e.g., Cursor, Claude for Desktop), I recommend adding the following configuration to your project instructions or AI rules:

<perplexity-advanced-mcp>
    <description>
        Perplexity is an LLM that can search the internet, gather information, and answer users' queries.

For example, let's suppose we want to find out the latest version of Python.
1. You would search on Google.
2. Then read the top two or three results directly to verify.

Perplexity does that work for you.

To answer a user's query, Perplexity searches, opens the top search results, finds information on those websites, and then provides the answer.

Perplexity can be used with two types of queries: simple and complex. Choosing the right query type to fulfill the user's request is most important.
</description>
<simple-query>
<description>
It's cheap and fast. However, it's not suitable for complex queries. On average, it's more than 10 times cheaper and 3 times faster than complex queries.
Use it for simple questions such as "What is the latest version of Python?"
</description>
<pricing>
$1/M input tokens
$1/M output tokens
</pricing>
</simple-query>

<complex-query>
<description>
It's slower and more expensive. Compared to simple queries, it's on average more than 10 times more expensive and 3 times slower.
Use it for more complex requests like "Analyze the attached code to examine the current status of a specific library and create a migration plan."
</description>
<pricing>
$1/M input tokens
$5/M output tokens
</pricing>
</complex-query>

<instruction>
When reviewing the user's request, if you find anything unexpected, uncertain, or questionable, and you think you can get answer from the internet, do not hesitate to use the "ask_perplexity" tool to consult Perplexity. However, if the internet is not required to satisfy users' request, it's meaningless to ask to perplexity.
Since Perplexity is also an LLM, prompt engineering techniques are paramount.
Remember the basics of prompt engineering, such as providing clear instructions, sufficient context, and examples
Include as much context and relevant files as possible to smoothly fulfill the user's request. When adding files as attachments, make sure they are absolute paths.
</instruction>
</perplexity-advanced-mcp>

This configuration helps AI assistants better understand when and how to use the Perplexity search functionality, optimizing for both cost and performance.

To install Perplexity Advanced MCP for Claude Desktop automatically via Smithery:

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

The easiest way to run the MCP server is using uvx:

uvx perplexity-advanced-mcp -o <openrouter_api_key> # or -p <perplexity_api_key>

You can also configure the API keys using environment variables:

```sh
export OPENROUTER_API_KEY="your_key_here"

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "perplexity advanced": {
            "env": {},
            "args": [
                "-y",
                "@highlight/mcp-server"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Macos

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Windows

{
    "env": [],
    "args": [
        "/c",
        "npx",
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "cmd"
}

Perplexity Advanced MCP

GitHub
PyPI
smithery badge

한국어

</div>

---

Overview

Perplexity Advanced MCP is an advanced integration package that leverages the OpenRouter and Perplexity APIs to provide enhanced query processing capabilities. With an intuitive command-line interface and a robust API client, this package facilitates seamless interactions with AI models for both simple and complex queries.

Comparison with perplexity-mcp

While perplexity-mcp provides basic web search functionality using Perplexity AI's API, Perplexity Advanced MCP offers several additional features:

- Multi-vendor Support: Supports both Perplexity and OpenRouter APIs, giving you flexibility in choosing your provider
- Query Type Optimization: Distinguishes between simple and complex queries, optimizing for cost and performance
- File Attachment Support: Allows including file contents as context in your queries, enabling more precise and contextual responses
- Enhanced Retry Logic: Implements robust retry mechanisms for improved reliability

Overall, this is the most suitable MCP for handling codebases when integrated with editors like Cline or Cursor.

Features

- Unified API Client: Supports both OpenRouter and Perplexity APIs with configurable models for handling simple and complex queries.
- Command-Line Interface (CLI): Manage API key configuration and run the MCP server using Typer.
- Advanced Query Processing: Incorporates file attachment processing, allowing you to include contextual data in your queries.
- Robust Retry Mechanism: Utilizes Tenacity for retry logic to ensure consistent and reliable API communications.
- Customizable Logging: Flexible logging configuration for detailed debugging and runtime monitoring.

Optimal AI Configuration

For the best experience with AI assistants (e.g., Cursor, Claude for Desktop), I recommend adding the following configuration to your project instructions or AI rules:

<perplexity-advanced-mcp>
    <description>
        Perplexity is an LLM that can search the internet, gather information, and answer users' queries.

For example, let's suppose we want to find out the latest version of Python.
1. You would search on Google.
2. Then read the top two or three results directly to verify.

Perplexity does that work for you.

To answer a user's query, Perplexity searches, opens the top search results, finds information on those websites, and then provides the answer.

Perplexity can be used with two types of queries: simple and complex. Choosing the right query type to fulfill the user's request is most important.
</description>
<simple-query>
<description>
It's cheap and fast. However, it's not suitable for complex queries. On average, it's more than 10 times cheaper and 3 times faster than complex queries.
Use it for simple questions such as "What is the latest version of Python?"
</description>
<pricing>
$1/M input tokens
$1/M output tokens
</pricing>
</simple-query>

<complex-query>
<description>
It's slower and more expensive. Compared to simple queries, it's on average more than 10 times more expensive and 3 times slower.
Use it for more complex requests like "Analyze the attached code to examine the current status of a specific library and create a migration plan."
</description>
<pricing>
$1/M input tokens
$5/M output tokens
</pricing>
</complex-query>

<instruction>
When reviewing the user's request, if you find anything unexpected, uncertain, or questionable, and you think you can get answer from the internet, do not hesitate to use the "ask_perplexity" tool to consult Perplexity. However, if the internet is not required to satisfy users' request, it's meaningless to ask to perplexity.
Since Perplexity is also an LLM, prompt engineering techniques are paramount.
Remember the basics of prompt engineering, such as providing clear instructions, sufficient context, and examples
Include as much context and relevant files as possible to smoothly fulfill the user's request. When adding files as attachments, make sure they are absolute paths.
</instruction>
</perplexity-advanced-mcp>

This configuration helps AI assistants better understand when and how to use the Perplexity search functionality, optimizing for both cost and performance.

Usage

Installing via Smithery

To install Perplexity Advanced MCP for Claude Desktop automatically via Smithery:

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

Quick Start with uvx

The easiest way to run the MCP server is using uvx:

uvx perplexity-advanced-mcp -o <openrouter_api_key> # or -p <perplexity_api_key>

You can also configure the API keys using environment variables:

```sh
export OPENROUTER_API_KEY="your_key_here"

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.