Back to MCP directory
verified_userVerifieddnsLocal runtime

perplexity-mcp

一个基于Perplexity AI API的MCP服务器,为Claude桌面客户端提供网页搜索功能。

article

README

🚀 perplexity - mcp MCP 服务器

这是一个基于 Model Context Protocol (MCP) 的服务器,借助 Perplexity AI API 实现网络搜索功能。能与 Anthropic 的桌面客户端 Claude 完美配合,为用户提供便捷的网络搜索体验。

smithery 徽章

🚀 快速开始

你可以使用类似这样的提示来开启搜索:“搜索互联网,找出 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 可自动安装 Perplexity MCP for Claude Desktop,只需执行以下命令:

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

环境变量配置

claude_config.json 文件中添加以下配置内容:

{
  "servers": {
    "perplexity_search_web": {
      "class": "PerplexityMCPrompt",
      "config": {
        "query_param": "query"
      }
    }
  }
}

💻 使用示例

在 Cursor 中配置

  1. 打开 ~/.config/Cursor/config.json 文件。
  2. 添加以下配置内容:
{
  "mcp_version": "0.5",
  "api_keys": {
    "perplexity_api_key": "your_perplexity_api_key"
  },
  "servers": {
    "perplexity_search_web": {
      "class": "PerplexityMCPrompt",
      "config": {
        "query_param": "query"
      }
    }
  }
}

在 Claude Desktop 中配置

  1. 打开 claude_config.json 文件。
  2. 添加以下配置内容:
{
  "mcp_version": "0.5",
  "servers": {
    "perplexity_search_web": {
      "class": "PerplexityMCPrompt",
      "config": {
        "query_param": "query"
      }
    }
  }
}

要验证服务器是否正常工作,可打开 Claude 客户端,使用类似“搜索互联网,查找过去一周关于 OpenAI 的新闻”的提示。此时会弹出一个窗口确认工具的使用,点击“允许此对话”即可。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client