元搜索-MCP
用于使用各种搜索工具(如Tavily API)的MCP服务器。 计划支持各种搜索工具(例如wiki搜索、searxng等)。
服务介绍
metasearch MCP 服务器
一个用于元搜索的MCP服务器
组件
该服务器使用Tavily API根据指定的查询执行搜索。
- 搜索结果以文本格式返回。
- 搜索结果包括AI响应、URI和搜索结果标题。
工具
此服务器实现了以下工具:
- search: 根据指定查询执行搜索
- 必需参数: "query"
- 可选参数: "search_depth" (basic 或 advanced)
安装
- 下载仓库。
git clone https://github.com/YeonwooSung/metasearch-mcp.git
- 打开Claude Desktop配置文件。
On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
On Windows: `C:\Users\[username]\AppData\Roaming\Claude\claude_desktop_config.json`
- 按如下方式编辑配置文件:
"mcpServers": {
"tavily-search": {
"command": "uv",
"args": [
"--directory",
"C:\\your_path\\mcp-server-tavily",
"run",
"tavily-search"
],
"env": {
"TAVILY_API_KEY": "YOUR_TAVILY_API_KEY",
"PYTHONIOENCODING": "utf-8"
}
}
}
- 重启Claude Desktop。
使用
在Claude Desktop中,当你请求“请搜索某事物”时,你将收到搜索结果。
搜索示例:
Please search in detail for today's events in Kamakura
响应示例:
According to the search results, the following events start today, December 1st:
"Kamakura Promotion Photo Contest 2025"
Period: December 1, 2024 - January 31, 2025
A photo contest for those who love Kamakura
Applications start accepting from today
Also, as a related upcoming event:
On December 7th, an exhibition by 12 Kamakura artists will be held at the Seibu Press Inn Kamakura Ofuna Station East Exit Lounge.
日志存储位置
日志存储在以下位置:
对于Windows:
C:\Users\[username]\AppData\Roaming\Claude\logs\mcp-server-tavily-search
使用Cursor执行
- 创建一个shell脚本(例如
script.sh),如下所示:
#!/bin/bash
TARGET_DIR=/path/to/mcp-server-tavily
cd "${TARGET_DIR}"
export TAVILY_API_KEY="your-api-key"
export PYTHONIOENCODING=utf-8
uv --directory $PWD run tavily-search
- 按如下方式配置Cursor的MCP服务器设置:
Name: tavily-search
Type: command
Command: /path/to/your/script.sh
-
保存设置。
-
一旦设置保存后,你可以要求Cursor的Composer-Agent“搜索某事物”,它将返回搜索结果。
使用Docker Compose在本地环境中运行
目的
对于无法使用Claude Desktop的操作系统(非Windows/MacOS),
本节解释了如何使用Docker compose在本地环境中设置并运行MCP服务器和客户端。
步骤
- 安装Docker。
- 下载仓库。
git clone https://github.com/YeonwooSung/metasearch-mcp.git
- 运行Docker compose。
docker compose up -d
- 执行客户端。
docker exec mcp_server uv --directory /usr/src/app/mcp-server-tavily/src run client.py
- 执行结果
- 如下所示,在搜索可用工具后,将向Tavily发出查询,并返回响应。