perplexity-mcp MCP server
这是一个使用Perplexity AI的API提供网页搜索功能的模型上下文协议(MCP)服务器。
简介
这是一个 Model Context Protocol (MCP) 服务器,通过 Perplexity AI 的 API 为 Claude 桌面客户端提供网络搜索功能。
功能
- 网页搜索: 使用提示如"搜索网络以了解过去一周 Anthropic 的最新动态"
- 时间过滤: 支持按日/周/月/年过滤结果
安装步骤
1. 通过 Smithery 快速安装(推荐)
npx -y @smithery/cli install perplexity-mcp --client claude
2. 手动安装
安装 UV(如果尚未安装)
macOS:
brew install uv
其他系统:
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
配置 Claude Desktop
编辑配置文件:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%/Claude/claude_desktop_config.json
添加以下配置:
"perplexity-mcp": {
"env": {
"PERPLEXITY_API_KEY": "你的API密钥",
"PERPLEXITY_MODEL": "sonar"
},
"command": "uvx",
"args": [
"perplexity-mcp"
]
}
环境变量
- 必需:
PERPLEXITY_API_KEY
- 从 Perplexity 获取 - 可选:
PERPLEXITY_MODEL
- 默认为 "sonar",可选模型包括:sonar-deep-research
- 增强研究能力sonar-reasoning-pro
- 专业级推理sonar-pro
- 200k 上下文专业模型- 更多模型见文档
验证安装
在 Claude 中输入提示如"搜索过去一周关于 OpenAI 的新闻",然后允许工具使用权限。
组件
- perplexity_search_web 工具:
- 参数:
query
(必需)、recency
(可选,值为 day/week/month/year) - 返回 Perplexity API 的搜索结果
- 参数: