使用说明
困惑搜索MCP服务器
困惑搜索MCP服务器的Go实现,允许大型语言模型(LLM)通过 模型上下文协议(MCP).
特性
- 困惑研究:执行网络搜索并返回结果,包括引用
- 参数:
query(字符串,必填):搜索查询search_recency_filter(字符串,可选):按时间筛选结果(month,week,day,hour)max_tokens(整数,可选):要返回的最大令牌数temperature(数字,可选,默认值:0.2):控制响应的随机性top_p(数字,可选,默认值:0.9):Nucleus采样阈值search_domain_filter(数组,可选):限制搜索结果的域列表return_images(布尔值,可选):在结果中包含图像链接return_related_questions(布尔值,可选):包括相关问题top_k(number,可选,默认值:0):用于前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
先决条件
- 达到1.23或更高
- 困惑API键
安装
- 克隆存储库:
git clone https://github.com/chenxilol/perplexity-mcp-go.git
cd perplexity-mcp-go
- 构建应用程序:
go build -o perplexity-search-mcp
本地运行
- 设置您的困惑API密钥:
export PERPLEXITY_API_KEY="your-api-key-here"
- 运行服务器:
./perplexity-search-mcp
与克劳德融合
-
复制提供的
claude_desktop_config.json到您的Claude配置目录:- 窗户:
%USERPROFILE%\AppData\Roaming\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.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支持
- 构建Docker镜像:
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使用困惑搜索工具执行实时网络搜索。
带参数的搜索示例:
{
"query": "latest AI research developments",
"search_recency_filter": "week",
"temperature": 0.5,
"return_related_questions": true,
"web_search_options": {
"search_context_size": "high"
}
}
故障排除
如果您遇到问题:
- 验证API密钥设置是否正确
- 检查网络连接
- 检查stderr日志中的错误消息
许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。