这是一个使用 Perplexity AI 的 API 提供智能代码分析和调试功能的 Model Context Protocol (MCP) 服务器。它与 Claude 桌面客户端无缝集成。
<a href="https://glama.ai/mcp/servers/oxchzx8c75"><img width="380" height="200" src="https://gips2.baidu.com/it/u=2147014135,1844169179&fm=3081&app=3081&f=PNG?w=760&h=400" alt="Perplexity Server MCP 服务器" /></a>
可以提出如下问题:
包括你的代码片段以进行有针对性的分析:
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)
服务器将提供:
# 使用 npm
npm install -g perplexity-mcp
# 或者直接使用仓库
npm install -g git+https://github.com/yourusername/perplexity-mcp.git
git clone https://github.com/yourusername/perplexity-server.git
cd perplexity-server
npm install
npm run build
npm install -g .
在你的 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"
}
}
}
}
perplexity-server/
├── src/
│ └── index.ts # 主服务器实现
├── package.json # 项目配置
└── tsconfig.json # TypeScript 配置
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 文件。