Perplexity Ask

@ppl-ai/modelcontextprotocol
Hosted
9 Stars 8.5k 次浏览 ppl-ai 更新于 2026-08-23

一种MCP服务器实现,它集成了Sonar API,为克劳德提供了无与伦比的实时、全网研究能力。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "perplexity-ask": {
      "args": [
        "-y",
        "server-perplexity-ask"
      ],
      "command": "npx",
      "env": {
        "PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

该服务需要配置环境变量:PERPLEXITY_API_KEY

服务介绍

Perplexity Ask MCP Server

An MCP server implementation that integrates with the Sonar API, providing unparalleled real-time web research capabilities for Claude.

Demo

Tools

  • perplexity_ask
    • Performs real-time web searches by conversing with the Sonar API.
    • Inputs:
      • messages (array): An array of conversation messages.
        • Each message must include:
          • role (string): The role of the message (e.g., system, user, assistant).
          • content (string): The content of the message.

Configuration

Step One:

Clone this repository:


git clone git@github.com:ppl-ai/modelcontextprotocol.git

Navigate to the perplexity-ask directory and install the necessary dependencies:


cd modelcontextprotocol/perplexity-ask && npm install

Step Two: Obtain a Sonar API Key

  1. Register for a Sonar API account.
  2. Follow the account setup instructions to generate your API key from the developer dashboard.
  3. Set the API key as PERPLEXITY_API_KEY in your environment variables.

Step Three: Configure Claude Desktop

  1. Download Claude Desktop here.

  2. Add the following to your claude_desktop_config.json file:


{

  "mcpServers": {

    "perplexity-ask": {

      "command": "docker",

      "args": [

        "run",

        "-i",

        "--rm",

        "-e",

        "PERPLEXITY_API_KEY",

        "mcp/perplexity-ask"

      ],

      "env": {

        "PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE"

      }

    }

  }

}

NPX


{

  "mcpServers": {

    "perplexity-ask": {

      "command": "npx",

      "args": [

        "-y",

        "server-perplexity-ask"

      ],

      "env": {

        "PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE"

      }

    }

  }

}

You can access the file using the following command:


vim ~/Library/Application\ Support/Claude/claude_desktop_config.json

Step Four: Build Docker Image

Docker build command:


docker build -t mcp/perplexity-ask:latest -f Dockerfile .

Step Five: Testing

Let's make sure that Claude Desktop has recognized the two tools we exposed in the perplexity-ask server. You can confirm this by looking for the hammer icon:

Claude Visual Tool Indicator

After clicking on the hammer icon, you should see the tools provided by the Filesystem MCP server:

Available Integrations

If you see these two tools, it means the integration is active. Congratulations! This means Claude can now use Perplexity. You can then use it just like the Perplexity web application.

Step Six: Advanced Parameters

The search parameters currently in use are the defaults. You can modify any of the search parameters directly in the API call within the index.ts script. For this, refer to the official API documentation.

Troubleshooting

The Claude documentation provides an excellent troubleshooting guide that you can refer to. However, if you need additional support or to report a bug, you can still reach out to us at api@perplexity.ai.

License

This MCP server is released under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

相关 MCP 服务