tavily 爬蟲測試版
概覽
Tavily-MCP 是什麼?
Tavily-MCP 是由 Tavily AI 開發的開源項目,旨在提供一個全面的解決方案來管理和優化旅行行程。這個庫提供了工具和功能,使用戶能夠無縫地創建、修改和分享旅行計劃。該項目旨在滿足個人旅行者和旅行社的需求,成為任何希望提升旅行體驗的人的多功能選擇。
Tavily-MCP 的特點
- 用戶友好的界面:Tavily-MCP 擁有直觀的界面,簡化了行程管理的過程,使用戶能夠輕鬆導航各種功能。
- 可自定義的行程:用戶可以根據自己的喜好創建個性化的旅行行程,包括目的地、活動和住宿。
- 協作工具:該平台支持協作功能,使用戶能夠與朋友、家人或同事分享他們的行程以獲取反饋和建議。
- 與旅行服務的整合:Tavily-MCP 與各種旅行服務整合,為用戶提供有關航班、酒店和當地景點的實時信息。
- 開源:作為一個開源項目,Tavily-MCP 鼓勵來自世界各地的開發者貢獻,促進社區驅動的持續改進。
如何使用 Tavily-MCP
- 安裝:要開始使用 Tavily-MCP,請從 GitHub 克隆該庫並按照文檔中提供的安裝說明進行操作。
- 創建帳戶:註冊一個帳戶以訪問所有功能並保存您的行程。
- 建立您的行程:使用直觀的界面將目的地、活動和住宿添加到您的行程中。您可以根據自己的旅行風格自定義每個條目。
- 分享您的計劃:一旦您的行程完成,通過平台的協作工具與他人分享,或將其導出為各種格式。
- 保持更新:隨時更新您的行程,獲取旅行服務的實時信息,確保您擁有最新的詳細信息。
常見問題
Q1: Tavily-MCP 是免費使用的嗎?
A1: 是的,Tavily-MCP 是一個開源項目,這意味著它是免費使用和修改的。
Q2: 我可以為 Tavily-MCP 做貢獻嗎?
A2: 當然可以!歡迎貢獻。您可以分叉該庫,進行更改,並在 GitHub 上提交拉取請求。
Q3: Tavily-MCP 使用了哪些技術?
A3: Tavily-MCP 使用現代網頁技術構建,包括 HTML、CSS、JavaScript 和各種框架,以增強功能和用戶體驗。
Q4: 我該如何報告問題或錯誤?
A4: 如果您遇到任何問題,請在 Tavily-MCP GitHub 庫的問題部分報告。開發團隊會積極監控並解決報告的問題。
Q5: Tavily-MCP 有移動版本嗎?
A5: 目前,Tavily-MCP 已針對網頁使用進行優化。然而,開發團隊正在考慮在未來的更新中增加移動兼容性。
詳細
The Model Context Protocol (MCP) is an open standard that enables AI systems to interact seamlessly with various data sources and tools, facilitating secure, two-way connections.
Developed by Anthropic, the Model Context Protocol (MCP) enables AI assistants like Claude to seamlessly integrate with Tavily's advanced search and data extraction capabilities. This integration provides AI models with real-time access to web information, complete with sophisticated filtering options and domain-specific search features.
The Tavily MCP server provides:
- search, extract, map, crawl tools
- Real-time web search capabilities through the tavily-search tool
- Intelligent data extraction from web pages via the tavily-extract tool
- Powerful web mapping tool that creates a structured map of website
- Web crawler that systematically explores websites
📚 Helpful Resources
- Tutorial on combining Tavily MCP with Neo4j MCP server
- Tutorial on integrating Tavily MCP with Cline in VS Code
Prerequisites 🔧
Before you begin, ensure you have:
- Tavily API key
- If you don't have a Tavily API key, you can sign up for a free account here
- Claude Desktop or Cursor
- Node.js (v20 or higher)
- You can verify your Node.js installation by running:
node --version
- You can verify your Node.js installation by running:
- Git installed (only needed if using Git installation method)
- On macOS:
brew install git
- On Linux:
- Debian/Ubuntu:
sudo apt install git
- RedHat/CentOS:
sudo yum install git
- Debian/Ubuntu:
- On Windows: Download Git for Windows
- On macOS:
Tavily MCP server installation ⚡
Running with NPX
npx -y tavily-mcp@latest
Installing via Smithery
To install Tavily MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @tavily-ai/tavily-mcp --client claude
Although you can launch a server on its own, it's not particularly helpful in isolation. Instead, you should integrate it into an MCP client. Below is an example of how to configure the Claude Desktop app to work with the tavily-mcp server.
Configuring MCP Clients ⚙️
This repository will explain how to configure VS Code, Cursor and Claude Desktop to work with the tavily-mcp server.
Configuring VS Code 💻
For one-click installation, click one of the install buttons below:
Manual Installation
First check if there are install buttons at the top of this section that match your needs. If you prefer manual installation, follow these steps:
Add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P
(or Cmd + Shift + P
on macOS) and typing Preferences: Open User Settings (JSON)
.
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "tavily_api_key",
"description": "Tavily API Key",
"password": true
}
],
"servers": {
"tavily": {
"command": "npx",
"args": ["-y", "tavily-mcp@latest"],
"env": {
"TAVILY_API_KEY": "${input:tavily_api_key}"
}
}
}
}
}
Optionally, you can add it to a file called .vscode/mcp.json
in your workspace:
{
"inputs": [
{
"type": "promptString",
"id": "tavily_api_key",
"description": "Tavily API Key",
"password": true
}
],
"servers": {
"tavily": {
"command": "npx",
"args": ["-y", "tavily-mcp@latest"],
"env": {
"TAVILY_API_KEY": "${input:tavily_api_key}"
}
}
}
}
Configuring Cline 🤖
The easiest way to set up the Tavily MCP server in Cline is through the marketplace with a single click:
- Open Cline in VS Code
- Click on the Cline icon in the sidebar
- Navigate to the "MCP Servers" tab ( 4 squares )
- Search "Tavily" and click "install"
- When prompted, enter your Tavily API key
Alternatively, you can manually set up the Tavily MCP server in Cline:
-
Open the Cline MCP settings file:
For macOS:
# Using Visual Studio Code code ~/Library/Application\ Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json # Or using TextEdit open -e ~/Library/Application\ Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
For Windows:
code %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
-
Add the Tavily server configuration to the file:
Replace
your-api-key-here
with your actual Tavily API key.{ "mcpServers": { "tavily-mcp": { "command": "npx", "args": ["-y", "tavily-mcp@latest"], "env": { "TAVILY_API_KEY": "your-api-key-here" }, "disabled": false, "autoApprove": [] } } }
-
Save the file and restart Cline if it's already running.
-
When using Cline, you'll now have access to the Tavily MCP tools. You can ask Cline to use the tavily-search and tavily-extract tools directly in your conversations.
Configuring Cursor 🖥️
Note: Requires Cursor version 0.45.6 or higher
To set up the Tavily MCP server in Cursor:
- Open Cursor Settings
- Navigate to Features > MCP Servers
- Click on the "+ Add New MCP Server" button
- Fill out the following information:
- Name: Enter a nickname for the server (e.g., "tavily-mcp")
- Type: Select "command" as the type
- Command: Enter the command to run the server:
env TAVILY_API_KEY=your-api-key npx -y tavily-mcp@latest
Important: Replace
your-api-key
with your Tavily API key. You can get one at app.tavily.com/home
After adding the server, it should appear in the list of MCP servers. You may need to manually press the refresh button in the top right corner of the MCP server to populate the tool list.
The Composer Agent will automatically use the Tavily MCP tools when relevant to your queries. It is better to explicitly request to use the tools by describing what you want to do (e.g., "User tavily-search to search the web for the latest news on AI"). On mac press command + L to open the chat, select the composer option at the top of the screen, beside the submit button select agent and submit the query when ready.
Configuring the Claude Desktop app 🖥️
For macOS:
### Create the config file if it doesn't exist
touch "$HOME/Library/Application Support/Claude/claude_desktop_config.json"
### Opens the config file in TextEdit
open -e "$HOME/Library/Application Support/Claude/claude_desktop_config.json"
### Alternative method using Visual Studio Code (requires VS Code to be installed)
code "$HOME/Library/Application Support/Claude/claude_desktop_config.json"
For Windows:
code %APPDATA%\Claude\claude_desktop_config.json
Add the Tavily server configuration:
Replace your-api-key-here
with your actual Tavily API key.
{
"mcpServers": {
"tavily-mcp": {
"command": "npx",
"args": ["-y", "tavily-mcp@latest"],
"env": {
"TAVILY_API_KEY": "your-api-key-here"
}
}
}
}
2. Git Installation
- Clone the repository:
git clone https://github.com/tavily-ai/tavily-mcp.git
cd tavily-mcp
- Install dependencies:
npm install
- Build the project:
npm run build
Configuring the Claude Desktop app ⚙️
Follow the configuration steps outlined in the Configuring the Claude Desktop app section above, using the below JSON configuration.
Replace your-api-key-here
with your actual Tavily API key and /path/to/tavily-mcp
with the actual path where you cloned the repository on your system.
{
"mcpServers": {
"tavily": {
"command": "npx",
"args": ["/path/to/tavily-mcp/build/index.js"],
"env": {
"TAVILY_API_KEY": "your-api-key-here"
}
}
}
}
Usage in Claude Desktop App 🎯
Once the installation is complete, and the Claude desktop app is configured, you must completely close and re-open the Claude desktop app to see the tavily-mcp server. You should see a hammer icon in the bottom left of the app, indicating available MCP tools, you can click on the hammer icon to see more detial on the tavily-search and tavily-extract tools.
Now claude will have complete access to the tavily-mcp server, including the tavily-search and tavily-extract tools. If you insert the below examples into the Claude desktop app, you should see the tavily-mcp server tools in action.
Tavily Search Examples
- General Web Search:
Can you search for recent developments in quantum computing?
- News Search:
Search for news articles about AI startups from the last 7 days.
- Domain-Specific Search:
Search for climate change research on nature.com and sciencedirect.com
Tavily Extract Examples
- Extract Article Content:
Extract the main content from this article: https://example.com/article
✨ Combine Search and Extract ✨
You can also combine the tavily-search and tavily-extract tools to perform more complex tasks.
Search for news articles about AI startups from the last 7 days and extract the main content from each article to generate a detailed report.
Troubleshooting 🛠️
Common Issues
- Server Not Found
- Verify the npm installation by running
npm --verison
- Check Claude Desktop configuration syntax by running
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
- Ensure Node.js is properly installed by running
node --version
- Verify the npm installation by running
- NPX related issues
- If you encounter errors related to
npx
, you may need to use the full path to the npx executable instead. - You can find this path by running
which npx
in your terminal, then replace the"command": "npx"
line with"command": "/full/path/to/npx"
in your configuration.
- API Key Issues
- Confirm your Tavily API key is valid
- Check the API key is correctly set in the config
- Verify no spaces or quotes around the API key
Acknowledgments ✨
- Model Context Protocol for the MCP specification
- Anthropic for Claude Desktop
伺服器配置
{
"mcpServers": {
"tavily-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--tavily-ai--tavily-mcp--tavily-mcp",
"node ./build/index.js"
],
"env": {
"TAVILY_API_KEY": "tavily-api-key"
}
}
}
}