这是一个用 Go 实现的 Perplexity Search MCP 服务器,允许大型语言模型(LLMs)通过 Model Context Protocol (MCP) 访问 Perplexity 搜索 API。
query (字符串,必需):搜索查询search_recency_filter (字符串,可选):按时间过滤结果 (month, week, day, hour)max_tokens (整数,可选):返回的最大标记数量temperature (数字,可选,默认值:0.2):控制响应中的随机性top_p (数字,可选,默认值:0.9):核心采样阈值search_domain_filter (数组,可选):限制搜索结果的域名列表return_images (布尔值,可选):在结果中包含图像链接return_related_questions (布尔值,可选):在结果中包含相关问题top_k (数字,可选,默认值:0):用于 top-k 过滤的标记数量stream (布尔值,可选):增量流式传输响应presence_penalty (数字,可选,默认值:0):调整新主题的可能性frequency_penalty (数字,可选,默认值:1):减少重复web_search_options (对象,可选):网络搜索配置选项要通过 Smithery 自动安装 Perplexity Search Golang for Claude Desktop:
npx -y @smithery/cli install @chenxilol/perplexity-mcp-go --client claude
git clone https://github.com/chenxilol/perplexity-mcp-go.git
cd perplexity-mcp-go
go build -o perplexity-search-mcp
export PERPLEXITY_API_KEY="your-api-key-here"
./perplexity-search-mcp
将提供的 claude_desktop_config.json 复制到你的 Claude 配置目录中:
%USERPROFILE%\AppData\Roaming\Claude\claude_desktop_config.json~/Library/Application Support/Claude/claude_desktop_config.json~/.config/Claude/claude_desktop_config.json编辑配置文件以包含你的 API 密钥:
{
"mcpServers": {
"perplexity-search": {
"command": "/path/to/perplexity-search-mcp",
"env": {
"PERPLEXITY_API_KEY": "your-api-key-here"
}
}
}
}
docker build -t perplexity-search-mcp:latest .
docker run -i --rm -e PERPLEXITY_API_KEY=your-api-key-here perplexity-search-mcp:latest
配置完成后,Claude 可以通过 MCP 使用 perplexity_search 工具执行实时网络搜索。
带有参数的示例搜索:
{
"query": "最新的人工智能研究进展",
"search_recency_filter": "week",
"temperature": 0.5,
"return_related_questions": true,
"web_search_options": {
"search_context_size": "high"
}
}
如果遇到问题:
本项目采用 MIT 许可证 - 详情见 LICENSE 文件。