mcpField
P
perplexity-mcp MCP server

perplexity-mcp MCP server

本地服务
github.com/jsonallen搜索与检索31083 周前更新

关于 perplexity-mcp MCP server

perplexity-mcp 是一个 MCP 服务,通过 Perplexity AI 的 API 为客户端提供网页搜索能力。适合希望在 Claude Desktop 或 Cursor 中直接进行联网搜索的用户。

主要功能

  1. 01提供 perplexity_search_web 工具
  2. 02支持按 day、week、month、year 过滤时效
  3. 03可通过 PERPLEXITY_MODEL 选择模型
  4. 04通过 uvx 命令启动

适用场景

  1. 01查询某公司过去一周的最新动态
  2. 02在 Cursor 中检索近期新闻
  3. 03在 Claude Desktop 中执行带时间范围的网页搜索

MCP 相关

该项目是 MCP 服务,向 MCP 客户端暴露名为 perplexity_search_web 的工具,并同时提供同名提示词。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"perplexity": {
"command": "npx",
"args": [
"-y",
"@smithery/cli"
]
}
}
}
启动命令npx -y @smithery/cli

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@smithery/cli

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

perplexity-mcp MCP 服务

smithery badge

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

示例

你可以使用类似“搜索网页,了解过去一周 Anthropic 有哪些新动态”这样的提示词。

Glama 评分

Perplexity Server MCP server

组件

提示词

该服务提供一个提示词:

  • 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 中调用此工具。 mcp_screenshot

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

验证服务是否正常运行:打开 Claude 客户端,并使用类似“搜索网页,查找过去一周有关 openai 的新闻”的提示词。你应该会看到一个警告框,确认是否使用该工具。点击“Allow for this chat”。

mcp_screenshot

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。