Perplexity MCP Server
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)服务器将提供:
错误根本原因分析
带有代码示例的分步解决方案
防止类似问题的最佳实践
替代实施方法
安装
先决条件
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:从源安装
克隆存储库:
git clone https://github.com/yourusername/perplexity-server.git
cd perplexity-server安装依赖项:
npm install全局构建和安装:
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 检查器进行调试
贡献
分叉存储库
创建你的功能分支(
git checkout -b feature/amazing-feature)提交您的更改(
git commit -m 'Add some amazing feature')推送到分支(
git push origin feature/amazing-feature)打开拉取请求
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
致谢
感谢Perplexity AI提供强大的 API
使用模型上下文协议构建
Available Tools
1 toolsearchB
Search Perplexity for coding help
Inputs: query (required), code, language.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
Only one tool exists, so there is no risk of confusion between tools.
With a single tool named 'search', the naming is consistent and follows a verb_noun pattern.
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.
The tool covers the primary search function, but lacks additional features like filtering or retrieving different result types, leaving minor gaps.
Maintenance
Related MCP Connectors
AI code governance and code review for Claude Code, Copilot and Cursor. Checks rules and security.
Errors, logs and AI-call costs for apps on Node.js, Next.js, Cloudflare Workers or the browser. Ask your AI what’s broken, why, and how to fix it, right inside Cursor or Claude.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Related MCP Servers
- AlicenseBqualityDmaintenanceA 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.45MIT
- FlicenseAqualityDmaintenanceIntegrates 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.32-
- AlicenseCqualityDmaintenanceEnables AI-powered automated testing, security scanning, code review, and maintenance tasks directly within Claude Code or desktop.1252 PyPI4MIT
- AlicenseAqualityDmaintenanceEnables 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.787 npm4MIT