Perplexity Insight MCP 服务器
MCP 服务器实现与 Perplexity AI API 交互,通过标准化模型上下文协议提供高级问答功能。
特征
- 与 Perplexity AI API 无缝集成
- 支持不同的困惑度模型(sonar-reasoning、sonar-pro、sonar-deep-research)
- 可定制的系统提示和用户查询
- 正确的错误处理和响应格式
- 速率限制保护
- 轻松与 Windsurf IDE 集成
要求
- Node.js 18+
- Perplexity API 密钥
安装
环境变量
使用以下变量创建.env
文件:
用法
运行服务器:
API 工具
该服务器公开以下工具:
perplexity_ask
- 向 Perplexity AI 直接提问perplexity_search
- 使用 Perplexity AI 执行搜索查询
改变模型
两种工具都支持以下困惑度模型:
sonar-reasoning
(默认) - Perplexity 的推理模型,最适合一般问题sonar-pro
- 增强型模型,具有针对专业用例的改进功能sonar-deep-research
- 专门用于深入研究和复杂查询
要在使用工具时指定模型,请在请求中包含model
参数:
您还可以自定义系统提示和最大令牌数:
工具响应格式
服务器遵循 MCP 工具响应规范:
风帆冲浪整合
在 Windsurf 中设置
- 构建服务器:
- 打开 Windsurf 并导航至“设置”
- 找到“AI 设置”或“模型上下文协议”部分
- 添加新的 MCP 服务器,其详细信息如下:
- 名称:困惑洞察
- 类型:本地流程
- 命令:Node.js 可执行文件的路径
- 参数:已编译
index.js
文件的路径 - 工作目录:项目目录的路径
- 环境变量:确保包含
PERPLEXITY_API_KEY=your_api_key_here
- 启用服务器并重新启动 Windsurf(如有必要)
示例配置
以下是mcp_config.json
文件的示例配置:
将/path/to/perplexity-insight-MCP
替换为安装目录的实际路径,并使用实际的 Perplexity API 密钥。
在 Windsurf 中使用 Perplexity
- 使用 AI 助手面板提出问题,这些问题将被引导至 Perplexity
- 对于网络搜索,请在查询中包含“搜索”等特定术语
- 要更改模型,请在查询中包含模型名称,如“更改模型”部分所示
- Windsurf 将根据您的查询自动使用适当的 Perplexity 工具
发展
对于本地开发:
故障排除
如果您遇到 MCP 服务器问题:
- 检查您的 API 密钥是否有效并在
.env
文件中正确设置 - 验证响应格式是否符合 MCP 规范
- 在服务器日志中查找任何错误消息
- 确保 Windsurf 已正确配置以使用 MCP 服务器
执照
麻省理工学院
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
与 Perplexity AI API 接口,通过标准化模型上下文协议提供高级问答功能,支持多种 Perplexity 模型。
Related MCP Servers
- AsecurityFlicenseAqualityThis server provides access to the Perplexity AI API, enabling interaction through chatting, searching, and documentation retrieval within MCP-based systems.Last updated -52JavaScript
- AsecurityFlicenseAqualityProvides a standardized way to integrate Perplexity AI's features like chat, search, and documentation access into MCP-based systems.Last updated -5JavaScript
- AsecurityFlicenseAqualityA Node.js implementation that enables Claude to interact with Perplexity AI's language models through Anthropic's Model Context Protocol, providing tools for advanced chat completions and quick queries.Last updated -26TypeScript
- -securityAlicense-qualityProvides access to Perplexity AI models through two tools: ask\_perplexity for expert programming assistance and chat\_perplexity for maintaining ongoing conversations with context preservation.Last updated -PythonMIT License