注:当前项目为 Serverless Devs 应用,由于应用中会存在需要初始化才可运行的变量(例如应用部署地区、函数名等等),所以不推荐直接 Clone 本仓库到本地进行部署或直接复制 s.yaml 使用,强烈推荐通过
s init ${模版名称}的方法或应用中心进行初始化,详情可参考部署 & 体验 。
Perplexity Ask MCP Server
使用该项目,您需要有开通以下服务并拥有对应权限:
| 服务/业务 | 权限 | 相关文档 |
|---|---|---|
| 函数计算 | AliyunFCFullAccess | 帮助文档 计费文档 |
- 🔥 通过 云原生应用开发平台 CAP ,
该应用。
An MCP server implementation that integrates the Sonar API to provide Claude with unparalleled real-time, web-wide research.
- perplexity_ask
- Engage in a conversation with the Sonar API for live web searches.
- 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:
Clone this repository:
git clone git@github.com:ppl-ai/modelcontextprotocol.gitNavigate to the perplexity-ask directory and install the necessary dependencies:
cd modelcontextprotocol/perplexity-ask && npm install- Sign up for a Sonar API account.
- Follow the account setup instructions and generate your API key from the developer dashboard.
- Set the API key in your environment as
PERPLEXITY_API_KEY.
-
Download Claude desktop here.
-
Add this to your
claude_desktop_config.json:
{
"mcpServers": {
"perplexity-ask": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PERPLEXITY_API_KEY",
"mcp/perplexity-ask"
],
"env": {
"PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}{
"mcpServers": {
"perplexity-ask": {
"command": "npx",
"args": [
"-y",
"server-perplexity-ask"
],
"env": {
"PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}You can access the file using:
vim ~/Library/Application\ Support/Claude/claude_desktop_config.jsonDocker build:
docker build -t mcp/perplexity-ask:latest -f Dockerfile .Let's make sure Claude for Desktop is picking up the two tools we've exposed in our perplexity-ask server. You can do this by looking for the hammer icon:
After clicking on the hammer icon, you should see the tools that come with the Filesystem MCP Server:
If you see both of these this means that the integration is active. Congratulations! This means Claude can now ask Perplexity. You can then simply use it as you would use the Perplexity web app.
Currently, the search parameters used are the default ones. You can modify any search parameter in the API call directly in the index.ts script. For this, please refer to the official API documentation.
The Claude documentation provides an excellent troubleshooting guide you can refer to. However, you can still reach out to us at api@perplexity.ai for any additional support or file a bug.
This MCP server is licensed 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.
部署完成拿到 URL 后,准备好支持 SSE 的 MCP Client,通过 SSETransport 进行连接。

