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
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The error or coding question to analyze | |
| code | No | Code snippet to analyze (optional) | |
| language | No | Programming language of the code snippet (optional) | auto |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries full responsibility. It merely states the tool's purpose without disclosing behavioral traits like external dependencies, rate limits, or result format.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that efficiently conveys the tool's purpose with no unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite a simple schema, the description fails to explain output format or side effects. For a search tool, this is incomplete; agents need to know what the results look like.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The tool description adds no additional meaning beyond the schema, which is minimally adequate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Search Perplexity for coding help' clearly states the verb (search), resource (Perplexity), and domain (coding help). With no sibling tools, differentiation is not required.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives, nor any exclusions or context. The description only implies it is for coding help but does not elaborate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.0- First observed
search
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
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.
The bug mediator for AI-built apps: plain-English diagnosis + a ready fix, in your editor.
Connect Claude to Fathom meeting recordings, transcripts, and summaries
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-
- AlicenseCqualityCmaintenanceEnables AI-powered automated testing, security scanning, code review, and maintenance tasks directly within Claude Code or desktop.124MIT
- AlicenseAqualityCmaintenanceEnables 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.7192 npm4MIT