Skip to main content
Glama
Perplexity Tool for Claude Desktop

Perplexity Tool for Claude Desktop

Claude 桌面版的困惑工具

一个自定义的 MCP 工具,将 Perplexity AI 的 API 与 Claude Desktop 集成,允许 Claude 执行基于网络的研究并提供带有引文的答案。

先决条件安装

  1. 安装 Git:

    • 对于Mac:

      • 首先通过在终端中粘贴以下内容来安装Homebrew :GXP1

      • 然后安装Git:GXP2

    • 对于 Windows:

  2. 安装 Node.js:

    • 对于Mac:

      brew install node
    • 对于 Windows:

  3. 通过运行以下命令验证安装:

git --version
node --version

Related MCP server: Perplexity MCP Server

工具安装

  1. 克隆存储库

git clone https://github.com/letsbuildagent/perplexity-tool
cd perplexity-tool
  1. 安装依赖项

npm install
  1. 设置您的 API 密钥

您有两个选择:

选项 1(快速设置):

  • 打开server.js

  • 找到这一行:

const PERPLEXITY_API_KEY = "YOUR-API-KEY-HERE";
  • 用您的 Perplexity API 密钥替换

选项 2(最佳实践):

  • 创建 .env 文件:

    # On Mac/Linux:
    touch .env
    open .env
    
    # On Windows:
    notepad .env

    或者简单地在文本编辑器中创建一个名为.env的新文件

  • 将您的 API 密钥添加到 .env 文件:

    PERPLEXITY_API_KEY=your-api-key-here
  • 安装 dotenv:

    npm install dotenv
  • 更新server.js:

    import 'dotenv/config'
    const PERPLEXITY_API_KEY = process.env.PERPLEXITY_API_KEY;
  1. 配置 Claude 桌面

  • 打开~/Library/Application Support/Claude/claude_desktop_config.json

  • 添加此配置:

{
  "mcpServers": {
    "perplexity-tool": {
      "command": "node",
      "args": [
        "/full/path/to/perplexity-tool/server.js"
      ]
    }
  }
}

将/full/path/to替换为您克隆存储库的实际路径。

  1. 重启Claude桌面

用法

安装完成后,您可以通过 Claude 使用以下命令使用该工具:

  • “向 Perplexity 询问人工智能的最新发展”

  • “使用 Perplexity 研究量子计算的历史”

  • “在 Perplexity 上搜索有关气候变化的信息,重点关注上个月”

高级选项

您可以指定其他参数:

  • temperature :控制响应随机性(0-2)

  • max_tokens :限制响应长度

  • search_domain_filter :将搜索限制在特定域

  • search_recency_filter :按时间段(日/周/月/年)过滤

故障排除

  1. 未找到 Git:

    • 确保你已正确安装 Git

    • 尝试重启你的终端

    • 在 Mac 上,确保 Homebrew 位于你的 PATH 中

  2. Node.js 错误:

    • 使用node --version验证 Node.js 安装

    • 尝试重新安装 Node.js

  3. API 密钥问题:

    • 确保您已正确复制 API 密钥

    • 检查 .env 文件中没有多余的空格

    • 如果使用选项 2,请验证是否已安装 dotenv

  4. 工具未出现在 Claude 中:

    • 检查claude_desktop_config.json中的路径

    • 确保路径指向你的 server.js 文件

    • 重启Claude桌面

    • 检查控制台是否有任何错误消息

执照

麻省理工学院

安全说明

如果您打算分享您的代码或将其公开:

  • 不要将您的 API 密钥提交给 Git

  • 使用 .env 方法(选项 2)

  • 将 .env 添加到你的 .gitignore 文件

Available Tools

1 tool
ask_perplexityC

Ask a question to Perplexity AI

Inputs: question (required), temperature, max_tokens, search_domain_filter, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'ask_perplexity' has a clearly distinct purpose that cannot be confused with any other tool in this server.

    Naming Consistency5/5

    The single tool name follows a clear verb_noun pattern ('ask_perplexity'), and with only one tool, there is perfect consistency. No other naming conventions exist to create inconsistency.

    Tool Count2/5

    A single tool is generally too few for most server purposes, as it provides minimal functionality and limits agent capabilities. For a Perplexity AI integration, one tool might suffice for basic queries, but it feels thin and lacks operations like follow-up questions or context management.

    Completeness2/5

    The tool surface is severely incomplete for interacting with Perplexity AI. While 'ask_perplexity' covers basic queries, there are significant gaps such as no support for conversation history, context setting, or handling different query types, which will likely cause agent failures in complex tasks.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that enables Claude to perform web searches using Perplexity's API with intelligent model selection based on query intent and support for domain and recency filtering.
      6
      4
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Integrates Perplexity AI's search-enhanced language models with Claude Desktop, providing three tools with different complexity levels for quick fact-checking, technical analysis, and deep research.
      3
      2
      -