Perplexity Ask
一种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.

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.
- Each message must include:
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
- Register for a Sonar API account.
- Follow the account setup instructions to generate your API key from the developer dashboard.
- Set the API key as
PERPLEXITY_API_KEYin your environment variables.
Step Three: Configure Claude Desktop
-
Download Claude Desktop here.
-
Add the following to your
claude_desktop_config.jsonfile:
{
"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:

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

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.