Perplexity AI 查询增强服务器
一个利用Perplexity AI的API来实现网络搜索功能的服务器,旨在与Claude桌面客户端集成以增强搜索查询功能。
可用工具 (1 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
perplexity_search_web 2 个参数 需填 1 项
Search the web using Perplexity AI with recency filtering
必填参数:query
服务介绍
perplexity-mcp MCP 服务器
这是一个使用 Perplexity AI 的 API 提供网络搜索功能的 Model Context Protocol (MCP) 服务器。它与 Anthropic 的 Claude 桌面客户端兼容。
示例
允许你使用诸如“搜索过去一周内 Anthropic 的最新动态”这样的提示。
Glama 分数
组件
提示
该服务器提供一个提示:
- perplexity_search_web:使用 Perplexity AI 进行网络搜索
- 需要 "query" 参数作为搜索查询
- 可选 "recency" 参数来按时间范围过滤结果:
- 'day':最近 24 小时
- 'week':最近 7 天
- 'month':最近 30 天(默认)
- 'year':最近 365 天
- 使用 Perplexity 的 API 执行网络搜索
工具
该服务器实现了一个工具:
- perplexity_search_web:使用 Perplexity AI 进行网络搜索
- 接受 "query" 作为必需的字符串参数
- 可选 "recency" 参数来过滤结果(day/week/month/year)
- 返回来自 Perplexity API 的搜索结果
安装
通过 Smithery 安装
要通过 Smithery 自动为 Claude Desktop 安装 Perplexity MCP:
npx -y @smithery/cli install perplexity-mcp --client claude
需要 UV(快速的 Python 包和项目管理器)
如果未安装 uv。
# Using Homebrew on macOS
brew install uv
或
# On macOS and Linux.
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows.
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
环境变量
在你的 claude_desktop_config.json 中需要以下环境变量。你可以从 Perplexity 获取 API 密钥。
PERPLEXITY_API_KEY:你的 Perplexity AI API 密钥
可选环境变量:
-
PERPLEXITY_MODEL:使用的 Perplexity 模型(如果未指定,默认为 "sonar")可用模型:
sonar-deep-research:128k 上下文 - 增强的研究能力sonar-reasoning-pro:128k 上下文 - 专业的高级推理sonar-reasoning:128k 上下文 - 增强的推理能力sonar-pro:200k 上下文 - 专业级模型sonar:128k 上下文 - 默认模型r1-1776:128k 上下文 - 替代架构
最新的模型列表见 [这里][https://docs.perplexity.ai/guides/model-cards]
Cursor & Claude Desktop 安装
通过编辑 Cursor/Claude 配置文件将此工具添加为 MCP 服务器。
"perplexity-mcp": {
"env": {
"PERPLEXITY_API_KEY": "XXXXXXXXXXXXXXXXXXXX",
"PERPLEXITY_MODEL": "sonar"
},
"command": "uvx",
"args": [
"perplexity-mcp"
]
}
Cursor
- 在 MacOS 上:
/Users/your-username/.cursor/mcp.json - 在 Windows 上:
C:\Users\your-username\.cursor\mcp.json
如果一切正常,你现在应该能够从 Cursor 调用该工具。
Claude Desktop
- 在 MacOS 上:
~/Library/Application\ Support/Claude/claude_desktop_config.json - 在 Windows 上:
%APPDATA%/Claude/claude_desktop_config.json
要验证服务器是否正常工作,请打开 Claude 客户端并使用类似“搜索过去一周关于 OpenAI 的新闻”的提示。你应该会看到一个弹出框来确认工具的使用。点击“允许此次聊天”。