Skip to main content
Glama

Perplexity MCP 服务器

模型上下文协议 (MCP) 服务器,使用 Perplexity AI 的 API 提供智能代码分析和调试功能。可与 Claude 桌面客户端无缝协作。

特征

  • 智能错误分析:通过根本原因分析对编码错误进行详细细分

  • 模式检测:自动识别常见错误模式并提供有针对性的解决方案

  • 全面的解决方案:通过多种实施方案逐步修复

  • 最佳实践:包括编码标准和错误预防技巧

  • Python 支持:专门处理 Python 类型错误和常见编码问题

Related MCP server: Perplexity MCP Server

示例用法

提出以下问题:

  • “修复我的 Python 代码中的这个 TypeError”

  • “是什么导致了这个错误信息?”

  • “我该如何修复这个代码?”

包含您的代码片段以进行有针对性的分析:

def calculate_total(items):
    total = 0
    for item in items:
        total = total + item['price']  # TypeError: string + int

data = [
    {'name': 'Book', 'price': '10'},
    {'name': 'Pen', 'price': '2'}
]

result = calculate_total(data)

服务器将提供:

  1. 错误根本原因分析

  2. 带有代码示例的分步解决方案

  3. 防止类似问题的最佳实践

  4. 替代实施方法

安装

先决条件

  • Node.js 18 或更高版本

  • Perplexity AI API 密钥

选项 1:从 npm 安装(推荐)

# Using npm
npm install -g perplexity-mcp

# Or using the repository directly
npm install -g git+https://github.com/yourusername/perplexity-mcp.git

选项 2:从源安装

  1. 克隆存储库:

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

npm install
  1. 全局构建和安装:

npm run build
npm install -g .

配置 Claude 桌面

添加到您的 Claude 桌面配置文件:

MacOS : ~/Library/Application Support/Claude/claude_desktop_config.json Windows : %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "perplexity": {
      "command": "perplexity-mcp",
      "args": [],
      "env": {
        "PERPLEXITY_API_KEY": "your-api-key-here"
      }
    }
  }
}

或者如果从源安装:

{
  "mcpServers": {
    "perplexity": {
      "command": "node",
      "args": ["/absolute/path/to/perplexity-server/build/index.js"],
      "env": {
        "PERPLEXITY_API_KEY": "your-api-key-here"
      }
    }
  }
}

安全

  • API 密钥安全地存储在 Claude 的桌面配置文件中

  • 该密钥作为环境变量传递给服务器

  • 存储库中不存储任何敏感数据

  • 服务器需要 Claude 的环境提供 API 密钥

发展

项目结构

perplexity-server/
├── src/
│   └── index.ts      # Main server implementation
├── package.json      # Project configuration
└── tsconfig.json    # TypeScript configuration

可用脚本

  • npm run build :构建项目

  • npm run watch :监视更改并自动重建

  • npm run prepare :准备发布的包

  • npm run inspector :运行 MCP 检查器进行调试

贡献

  1. 分叉存储库

  2. 创建你的功能分支( git checkout -b feature/amazing-feature )

  3. 提交您的更改( git commit -m 'Add some amazing feature' )

  4. 推送到分支( git push origin feature/amazing-feature )

  5. 打开拉取请求

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

致谢

Available Tools

1 tool

Tool Schema Changelog

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

  1. 1 tool updatev0.1.0
    • First observedsearch

TDQS

B3.4/5.0

Scored across 1 tool

Disambiguation5/5

Only one tool exists, so there is no risk of confusion between tools.

Naming Consistency5/5

With a single tool named 'search', the naming is consistent and follows a verb_noun pattern.

Tool Count3/5

A single tool is borderline for a server named 'Perplexity MCP Server', as it may imply broader capabilities, but it is reasonable for a focused search helper.

Completeness3/5

The tool covers the primary search function, but lacks additional features like filtering or retrieving different result types, leaving minor gaps.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    A powerful research assistant that integrates with Cline and Claude Desktop to leverage Perplexity AI for intelligent search, documentation retrieval, API discovery, and code modernization assistance while coding.
    4
    5
    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
    -
  • A
    license
    A
    quality
    C
    maintenance
    Enables real-time code analysis for JavaScript, TypeScript, and Python through Claude Desktop and other MCP clients, detecting bugs, code smells, and security vulnerabilities with automated quick fixes.
    7
    192 npm
    4
    MIT