serach_it

quantumxiaol/serach_it

3.1

If you are the rightful owner of serach_it and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

Search It is a model context protocol server that integrates search and crawling tools to provide efficient data retrieval and processing capabilities.

Tools
6
Resources
0
Prompts
0

Search It

集成了一些简单的搜索和爬虫工具。

在MCP Server中提供相关工具的MCP Tools。

Environment

在MacOS和Linux上进行过测试,由于crawl4ai的playwright在windows似乎有异步的问题,在Windows上无法使用。

venv

uv venv
source venv/bin/activate
uv sync

playwright install

.env

对于搜索工具,需要PROXY访问wiki和google,需要google的api key来访问google。

请在 Google Cloud 凭证控制台中创建GOOGLE_API_KEY,并使用可编程搜索引擎创建GOOGLE_CSE_ID。

对于browser-use,需要使用LLM的配置,可以使用OpenAI或者Qwen。

对于tavily搜索,需要使用Tavily的api key。

HF_TOKEN暂未使用,后续使用HF创建本地LLM可能要用到。

PROXY

使用HTTP/HTTPS代理,可以使用V2ray或Clash。

代理只用于加速访问一些访问缓慢的网站,如GitHub、Arxiv等。

Search tools

  • arxiv by api
  • baidu by crawl from html
  • bing by crawl from html
  • google by api
  • tavily by api
  • wikipedia by api

Crawler tools

  • crawl4ai

Usage

python searchandcrawl_mcp.py --host 0.0.0.0 --port 11451 --http

这会在本地启动一个MCP Server,并监听端口 11451。

python ./tests/test_mcp_client.py -u "http://127.0.0.1:11451/sse" \
-q "can you tell me this website is about?url https://github.com/microsoft/markitdown"

这会测试MCP ,调用爬虫爬取markitdown的github项目,返回markdown格式的页面

测试

运行 bash scripts/run_mcp_tests.sh可以测试为MCP Serevr预制的一些任务,验证MCP Server是否正常可用。

运行 python ./tests/test_search.py -t google -q "Minecraft"可以测试搜索工具的结果。

运行 python ./tests/test_raw_response.py -t google -q "Minecraft"可以测试搜索工具返回的原始结果。

部署

运行 bash scripts/run-deploy-conf.sh,在deploy下生成supervisor配置文件

这个服务的配置参数在params.sh中,输出的log文件在log目录下

结构

search_it/
|- deploy
|- log
|- scripts/
|  |- run-deploy-conf.sh            # 配置supervisor
|  |- run-mcp-tests.sh              # 测试MCP Tools脚本
|- search_it/
|  |- crawler_tools                 # 爬虫工具
|  |  |- craw4ai_api.py
|  |- search_tools                  # 搜索工具
|  |  |- arxiv_search_api.py
|  |  |- baidusearch.py
|  |  |- bingsearch.py
|  |  |- browser_use_api.py
|  |  |- browsersearch_api.py
|  |  |- ddg_search_api.py
|  |  |- google_search_api.py
|  |  |- tavity_search_api.py
|  |  |- tools.py                   # 为搜索工具运行一些基准测试
|  |  |- wikipedia_search_api.py    
|- tests/                           # 测试文件
|- .env                             # 配置文件
|- LICENSE                          # MIT License
|- params.sh                        # 服务参数配置
|- pyproject.toml
|- readme.md
|- requirements.txt                 # 环境
|- run_mcp_tests.sh
|- run-deploy-conf.sh
|- searchandcrawl_mcp.py            # 程序主入口
|- template.conf
|- uv.lock                          # 环境