Tavily Search MCP
MCP server that provides web search and web page content extraction tools using Tavily's API, enabling agents to retrieve current information from the web.
README
Tavily Search MCP
Tavily Search MCP 是一个基于 Streamable HTTP 的 MCP 服务,用于把 Tavily 的联网搜索和网页内容提取能力封装成 MCP 工具。
功能
web_search:根据查询关键字进行联网搜索。web_fetch:根据网页 URL 提取可读文本内容。
环境要求
- Python 3.11+
- Tavily API Key
- 支持
streamable_http的 MCP 客户端
安装
先创建并启用你自己的 Python 虚拟环境,然后安装依赖和当前项目:
python -m pip install -r requirements.txt
python -m pip install -e .
复制环境变量模板:
cp .env.example .env
在 .env 中填写配置:
TAVILY_API_KEY=tvly-your-api-key
MCP_SERVER_HOST=127.0.0.1
MCP_SERVER_PORT=21029
MCP_SERVER_PATH=/mcp
MCP_ALLOWED_HOSTS=127.0.0.1,127.0.0.1:21029,localhost,localhost:21029
MCP_ALLOWED_ORIGINS=*
如果部署到服务器,请将 MCP_SERVER_HOST 设置为 0.0.0.0,并把你的公网域名或访问主机名加入 MCP_ALLOWED_HOSTS。
启动服务
python -m tavily_search_mcp.server
默认本地 MCP 地址:
http://127.0.0.1:21029/mcp
健康检查:
curl http://127.0.0.1:21029/health
测试客户端
列出 MCP 工具:
python -m tavily_search_mcp.client --url http://127.0.0.1:21029/mcp list-tools
调用联网搜索:
python -m tavily_search_mcp.client --url http://127.0.0.1:21029/mcp web-search "Tavily Python SDK" --max-results 2
调用网页内容提取:
python -m tavily_search_mcp.client --url http://127.0.0.1:21029/mcp web-fetch "https://docs.tavily.com/"
MCP 客户端配置
本地服务示例:
{
"mcpServers": {
"tavily-search": {
"type": "streamable_http",
"url": "http://127.0.0.1:21029/mcp",
"headers": {}
}
}
}
远程服务示例:
{
"mcpServers": {
"tavily-search": {
"type": "streamable_http",
"url": "https://your-domain.example/mcp",
"headers": {}
}
}
}
部署到服务器
可以使用仓库中的部署脚本,通过你自己的 SSH key 上传并启动服务:
.\scripts\deploy_remote.ps1 -HostName "your-server.example" -User "ubuntu" -IdentityFile "<path-to-private-key>"
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.