一个简单的网络搜索服务器,支持自由搜索并将URL内容转换为Markdown格式。中文
克隆仓库:
git clone https://github.com/Howe829/websearch-mcp-server.git
cd websearch-mcp-server
使用 uv 安装依赖(推荐):
uv venv && uv sync
如果您更喜欢使用 pip:
pip install -r requirements.txt
根据 .env.example 文件创建 .env 文件:
cp .env.example .env
修改 .env 文件以满足您的设置需求:
BING_SEARCH_BASE_URL="https://www.bing.com"
LANGUAGE="en"
CC="us"
IMPERSONATE="edge"
HOST=127.0.0.1
PORT=8002
SERVER_MODE=streamable-http
使用 uv 运行服务器:
uv run python server.py
或者使用 python 运行服务器:
source .venv/bin/activate
python server.py
欢迎贡献!
此项目使用 pytest 进行单元测试
uv pip install pytest
uv pip install pytest-asyncio
uv run pytest
使用 ruff 进行代码风格格式化
uv pip install ruff
ruff format .
使用 mcp inspector 调试此服务器
uv run fastmcp dev server.py