首页
学习
活动
专区
圈层
工具
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
首页
学习
活动
专区
圈层
工具
MCP广场
MCP广场 >详情页
perplexity-mcp2025-05-300分享
github
一个利用Perplexity AI的API来实现网络搜索功能的服务器,旨在与Claude桌面客户端集成以增强搜索查询功能。
By jsonallen
2025-05-300
github
详情内容

perplexity-mcp MCP 服务器

smithery 徽章

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

示例

允许你使用类似这样的提示:“搜索网页,找出过去一周 Anthropic 的新动态。”

Glama 评分

Perplexity Server MCP 服务器

组件

提示

服务器提供一个提示:

  • 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 桌面安装 Perplexity MCP:

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 桌面安装

通过编辑 Cursor/Claude 配置文件将此工具添加为 MCP 服务器。

  "perplexity-mcp": {
    "env": {
      "PERPLEXITY_API_KEY": "XXXXXXXXXXXXXXXXXXXX",
      "PERPLEXITY_MODEL": "sonar"
    },
    "command": "uvx",
    "args": [
      "perplexity-mcp"
    ]
  }

Cursor

  • 在 MacOS 上:/Users/你的用户名/.cursor/mcp.json
  • 在 Windows 上:C:\Users\你的用户名\.cursor\mcp.json

如果一切正常,你现在应该能够从 Cursor 调用该工具。
mcp_screenshot

Claude 桌面

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

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

mcp_screenshot
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档