Web_Search_MCP
Web_Search_MCP is a Model Context Protocol server that integrates a web search tool using the Tavily API for real-time search capabilities.
The Web_Search_MCP project is designed to integrate a web search tool using the Tavily API with the Model Context Protocol (MCP) for seamless interaction with AI systems. It utilizes the FastMCP class to automatically generate tool definitions, making it easy to create and maintain MCP tools. The project also leverages Langchain's TavilySearchResults tool for efficient API interaction and uses Dotenv for secure management of environment variables. The core functionality is provided by the search_web tool, which accepts a search query and retrieves detailed web search results, including content, URLs, relevancy scores, and more. The results are returned in a structured JSON format, with robust error handling and asynchronous processing to handle multiple requests simultaneously.
Features
- {'name': 'Web Search', 'description': 'Accepts a search query and retrieves relevant web search results using the Tavily API.'}
- {'name': 'Detailed Results', 'description': 'Provides comprehensive information from search results, including content, URL, relevancy score, and more.'}
- {'name': 'Formatted Output', 'description': 'Returns search results in a well-structured JSON format with status indicators and timestamps.'}
- {'name': 'Error Handling', 'description': 'Handles errors gracefully during the search process and returns informative error messages.'}
- {'name': 'Asynchronous Processing', 'description': 'Supports asynchronous processing to handle multiple requests simultaneously.'}
MCP Tools
- search_web: A tool that accepts a search query and returns web search results in JSON format.
Usage with Different Platforms
claude_desktop
{
"mcpServers": {
"Mcp_Demo": {
"command": "uv",
"args": [
"--directory",
"path/Web_Search_MCP",
"run",
"main.py"
]
}
}
}
Frequently Asked Questions
What is the Tavily API?
The Tavily API is a powerful search API that provides real-time, comprehensive web search results, including answers, raw content, and relevant metadata.
How do I manage environment variables securely?
The project uses the Dotenv library to load environment variables from a .env file, securely managing sensitive information like API keys.
What is the role of FastMCP in this project?
FastMCP uses Python type hints and docstrings to automatically generate tool definitions, simplifying the creation and maintenance of MCP tools.
Related MCP Servers
View all browser_automation servers →Fetch
by modelcontextprotocol
A Model Context Protocol server that provides web content fetching capabilities, enabling LLMs to retrieve and process content from web pages.
markdownify-mcp
by zcaceres
Markdownify is a Model Context Protocol (MCP) server that converts various file types and web content to Markdown format.
mcp-playwright
by executeautomation
A Model Context Protocol server that provides browser automation capabilities using Playwright.
playwright-mcp
by microsoft
Playwright MCP is a Model Context Protocol server that provides browser automation capabilities using Playwright, enabling LLMs to interact with web pages through structured accessibility snapshots.
cursor-talk-to-figma-mcp
by sonnylazuardi
This project implements a Model Context Protocol (MCP) integration between Cursor AI and Figma, allowing Cursor to communicate with Figma for reading designs and modifying them programmatically.
firecrawl-mcp-server
by mendableai
Firecrawl MCP Server is a Model Context Protocol server implementation that integrates with Firecrawl for web scraping capabilities.
ai-agent-marketplace-index-mcp
by AI-Agent-Hub
MCP Server for AI Agent Marketplace Index from DeepNLP, allowing AI assistants to search available AI agents by keywords or categories.