MCP ExplorerExplorer

Tavily Mcp Sse

@NoeSamailleon 12 days ago
1 MIT
FreeCommunity
AI Systems
#agentic-ai#ai-agents#mcp#mcp-server#sse#tavily#tavily-search
Basic remote SSE MCP server for Tavily Search.

Overview

What is Tavily Mcp Sse

Tavily-mcp-sse is a basic remote SSE MCP server designed for interacting with the Tavily API. It is built using FastAPI and includes API key authentication for secure access.

Use cases

Use cases for tavily-mcp-sse include building search functionalities in web applications, integrating real-time data retrieval in analytics platforms, and enhancing user experience with dynamic search results.

How to use

To use tavily-mcp-sse, install the required dependencies with ‘pip install -r requirements.txt’. Start the server using ‘uvicorn server:app --host 0.0.0.0 --port 8000 --reload’. Ensure to set the necessary API keys as environment variables before running the server.

Key features

Key features of tavily-mcp-sse include FastAPI-based architecture, API key authentication, and the ability to perform searches using the Tavily API with customizable parameters.

Where to use

Tavily-mcp-sse can be used in various fields such as web development, data analysis, and applications requiring real-time search capabilities through the Tavily API.

Content

Tavily MCP Server

Basic FastAPI-based server application that provides endpoints for interacting with the Tavily API. The server includes API key authentication and uses the fastapi-mcp library to create a remote SSE MCP server out of it.

Installation

To install the project’s dependencies, run the following command:

pip install -r requirements.txt

Usage

To run the server, use the following command:

uvicorn server:app --host 0.0.0.0 --port 8000 --reload

The server will be available at http://127.0.0.1:8000.

API Key

The server requires two API keys:

  • API_KEY: The API key for accessing the server’s endpoints.
  • TAVILY_API_KEY: The API key for accessing the Tavily API.

Set these API keys as environment variables before running the server.

Endpoints

/tavily-search

Perform a search using the Tavily API.

  • Method: POST
  • Request Body: TavilySearchRequest
    • query (str): The search query.
    • search_depth (Literal[“basic”, “advanced”], optional): The depth of the search. Defaults to “basic”.
    • topic (Literal[“general”, “news”], optional): The topic of the search. Defaults to “general”.
    • days (int, optional): The number of days to search. Defaults to 3.
    • time_range (Literal[“day”, “week”, “month”, “year”, “d”, “w”, “m”, “y”], optional): The time range of the search. Defaults to “day”.
    • max_results (int, optional): The maximum number of results to return. Defaults to 10.
    • include_images (bool, optional): Whether to include images in the results. Defaults to False.
    • include_image_descriptions (bool, optional): Whether to include image descriptions in the results. Defaults to False.
    • include_raw_content (bool, optional): Whether to include raw content in the results. Defaults to False.
    • include_domains (list[str], optional): A list of domains to include in the search. Defaults to an empty list.
    • exclude_domains (list[str], optional): A list of domains to exclude from the search. Defaults to an empty list.
  • Response: TavilyResponse

/tavily-extract

Extract content from URLs using the Tavily API.

  • Method: POST
  • Request Body: TavilyExtractRequest
    • urls (list[str]): A list of URLs to extract content from.
    • extract_depth (Literal[“basic”, “advanced”], optional): The depth of the extraction. Defaults to “basic”.
    • include_images (bool, optional): Whether to include images in the extraction. Defaults to False.
  • Response: TavilyResponse

Tools

No tools

Comments