Skip to main content
Glama
kshern

MCP Tavily

by kshern

MCP Tavily

中文文档

A Model Context Protocol (MCP) server implementation for Tavily API, providing advanced search and content extraction capabilities.

Features

  • Multiple Search Tools:

    • search: Basic search functionality with customizable options

    • searchContext: Context-aware search for better relevance

    • searchQNA: Question and answer focused search

  • Content Extraction: Extract content from URLs with configurable options

  • Rich Configuration Options: Extensive options for search depth, filtering, and content inclusion

Usage with MCP

Add the Tavily MCP server to your MCP configuration:

{
  "mcpServers": {
    "tavily": {
      "command": "npx",
      "args": ["-y", "@mcptools/mcp-tavily"],
      "env": {
        "TAVILY_API_KEY": "your-api-key"
      }
    }
  }
}

Note: Make sure to replace your-api-key with your actual Tavily API key. You can also set it as an environment variable TAVILY_API_KEY before running the server.

Related MCP server: Deep Research MCP Server

API Reference

Search Tools

The server provides three search tools that can be called through MCP:

// Tool name: search
{
  query: "artificial intelligence",
  options: {
    searchDepth: "advanced",
    topic: "news",
    maxResults: 10
  }
}
// Tool name: searchContext
{
  query: "latest developments in AI",
  options: {
    topic: "news",
    timeRange: "week"
  }
}
// Tool name: searchQNA
{
  query: "What is quantum computing?",
  options: {
    includeAnswer: true,
    maxResults: 5
  }
}

Extract Tool

// Tool name: extract
{
  urls: ["https://example.com/article1", "https://example.com/article2"],
  options: {
    extractDepth: "advanced",
    includeImages: true
  }
}

Search Options

All search tools share these options:

interface SearchOptions {
  searchDepth?: "basic" | "advanced";    // Search depth level
  topic?: "general" | "news" | "finance"; // Search topic category
  days?: number;                         // Number of days to search
  maxResults?: number;                   // Maximum number of results
  includeImages?: boolean;               // Include images in results
  includeImageDescriptions?: boolean;    // Include image descriptions
  includeAnswer?: boolean;               // Include answer in results
  includeRawContent?: boolean;           // Include raw content
  includeDomains?: string[];            // List of domains to include
  excludeDomains?: string[];            // List of domains to exclude
  maxTokens?: number;                    // Maximum number of tokens
  timeRange?: "year" | "month" | "week" | "day" | "y" | "m" | "w" | "d"; // Time range for search
}

Extract Options

interface ExtractOptions {
  extractDepth?: "basic" | "advanced";   // Extraction depth level
  includeImages?: boolean;               // Include images in results
}

Response Format

All tools return responses in the following format:

{
  content: Array<{
    type: "text",
    text: string
  }>
}

For search results, each item includes:

  • Title

  • Content

  • URL

For extracted content, each item includes:

  • URL

  • Raw content

  • Failed URLs list (if any)

Error Handling

All tools include proper error handling and will throw descriptive error messages if something goes wrong.

Installation

Installing via Smithery

To install Tavily API Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @kshern/mcp-tavily --client claude

Manual Installation

npm install @mcptools/mcp-tavily

Or use it directly with npx:

npx @mcptools/mcp-tavily

Prerequisites

  • Node.js 16 or higher

  • npm or yarn

  • Tavily API key (get one from Tavily)

Setup

  1. Clone the repository

  2. Install dependencies:

npm install
  1. Set your Tavily API key:

export TAVILY_API_KEY=your_api_key

Building

npm run build

Debugging with MCP Inspector

For development and debugging, we recommend using MCP Inspector, a powerful development tool for MCP servers.

The Inspector provides a user interface for:

  • Testing tool calls

  • Viewing server responses

  • Debugging tool execution

  • Monitoring server state

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository

  2. Create your feature branch (git checkout -b feature/AmazingFeature)

  3. Commit your changes (git commit -m 'Add some AmazingFeature')

  4. Push to the branch (git push origin feature/AmazingFeature)

  5. Open a Pull Request

License

This project is licensed under the MIT License.

Support

For any questions or issues:

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    C
    maintenance
    A Model Context Protocol server that performs comprehensive web research by combining Tavily Search and Crawl APIs to gather extensive information and provide structured JSON output tailored for LLMs to create detailed markdown documents.
    Last updated
    37
    27
    Apache 2.0
  • -
    license
    B
    quality
    -
    maintenance
    A Model Context Protocol compliant server that facilitates comprehensive web research by utilizing Tavily's Search and Crawl APIs to gather and structure data for high-quality markdown document creation.
    Last updated
    1
    37
    12
  • F
    license
    C
    quality
    D
    maintenance
    A Model Context Protocol server that enables web search capabilities using the Tavily API, allowing AI models to retrieve current information from the internet through natural language commands.
    Last updated
    3

View all related MCP servers

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • A Model Context Protocol server for Wix AI tools

  • AI-agent web search, answer-ready content. Beats Tavily: 60.7% of quality duels, 20.2% fewer tokens.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kshern/mcp-tavily'

If you have feedback or need assistance with the MCP directory API, please join our Discord server