返回市场
困惑度-mcp

困惑度-mcp

作者:jsonallen269 星标更新:2025-03-28

项目介绍

perplexity-mcp MCP服务器

smithery徽章

这是一个使用Perplexity AIAPI提供网络搜索功能的模型上下文协议(MCP)服务器。与Anthropic的Claude桌面客户端兼容。

示例

你可以使用如下的提示词:"搜索网络以找出过去一周Anthropic的新动态。"

Glama评分

<a href="https://glama.ai/mcp/servers/ebg0za4hn9"><img width="380" height="200" src="https://gips3.baidu.com/it/u=1819230641,3409255662&fm=3081&app=3081&f=PNG?w=760&h=400" alt="Perplexity Server MCP服务器" /></a>

组件

提示词

该服务器提供一个提示词:

  • 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)
    • 返回来自Perplex-ity API的搜索结果

安装

通过Smithery安装

要通过Smithery自动安装Perplexity MCP给Claude Desktop:

npx -y @smithery/cli install perplexity-mcp --client claude

需要UV(快速Python包和项目管理器)

如果未安装uv。

# 在macOS上使用Homebrew
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_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上下文 - 替代架构

最新的模型列表可在这里找到。

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调用这个工具。 <img width="800" alt="mcp_screenshot" src="https://github.com/user-attachments/assets/4b59774f-646c-41b3-9886-5cfd4c4ca051" width=600>

Claude Desktop

  • 在MacOS上:~/Library/Application\ Support/Claude/claude_desktop_config.json
  • 在Windows上:%APPDATA%/Claude/claude_desktop_config.json

为了验证服务器是否工作,请打开Claude客户端并使用类似“搜索网络以找出过去一周关于openai的新闻”的提示词。你应该会看到一个确认工具使用的弹出框。点击“允许在此聊天中使用”。

<img width="600" alt="mcp_screenshot" src="https://gips2.baidu.com/it/u=3025825973,707418313&fm=3081&app=3081&f=PNG?w=3656&h=4070" />