Tavily MCP server

Integrates with the Tavily API to enable advanced search and content extraction operations, facilitating web research and up-to-date information access for AI applications.
Back to servers
Provider
kshern
Release date
Feb 24, 2025
Language
TypeScript
Package
Stats
1.0K downloads
5 stars

MCP Tavily is a server implementation of the Model Context Protocol that provides advanced search and content extraction capabilities through the Tavily API. It enables powerful search functionality with multiple specialized tools and content extraction features through a standardized interface.

Installation

Prerequisites

  • Node.js 16 or higher
  • npm or yarn
  • Tavily API key (obtain from Tavily)

Installing via Smithery

To install the Tavily API Server automatically via Smithery:

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

Manual Installation

Install the package:

npm install @mcptools/mcp-tavily

Or use it directly with npx:

npx @mcptools/mcp-tavily

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: Replace your-api-key with your actual Tavily API key. Alternatively, you can set it as an environment variable TAVILY_API_KEY before running the server.

Search Tools

Basic Search

// Tool name: search
{
  query: "artificial intelligence",
  options: {
    searchDepth: "advanced",
    topic: "news",
    maxResults: 10
  }
}

Context Search

// Tool name: searchContext
{
  query: "latest developments in AI",
  options: {
    topic: "news",
    timeRange: "week"
  }
}

Q&A Search

// Tool name: searchQNA
{
  query: "What is quantum computing?",
  options: {
    includeAnswer: true,
    maxResults: 5
  }
}

Extract Tool

Extract content from specified URLs:

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

Configuration Options

Search Options

All search tools accept 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 this format:

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

Search results include:

  • Title
  • Content
  • URL

Extracted content includes:

  • URL
  • Raw content
  • Failed URLs list (if any)

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later