Tavily Search MCP server

Integrates the Tavily search API to provide customizable web searches with options for depth, result count, time range, and AI-generated answers, enabling up-to-date information retrieval for research, content creation, and data aggregation tasks.
Back to servers
Provider
Eric Julianto
Release date
Mar 05, 2025
Language
Python

The MCP server acts as a standardized communication layer between language models and tools, allowing seamless interaction between them. This implementation provides a simple, flexible way to connect LLMs with various tools following the Model Context Protocol specification.

Installation

You can install the MCP server using pip:

pip install mcp-server

To install directly from the source repository:

git clone https://github.com/username/mcp-server.git
cd mcp-server
pip install -e .

Basic Usage

Starting the Server

To start the MCP server with default settings:

mcp-server

The server will start on the default port (usually 8000). You can specify a custom port:

mcp-server --port 9000

Configuration

Create a configuration file config.yaml to define your tools:

tools:
  - name: calculator
    description: "Performs basic arithmetic operations"
    path: "tools.calculator.Calculator"
  
  - name: web_search
    description: "Searches the web for information"
    path: "tools.web.WebSearch"
    config:
      api_key: ${WEB_SEARCH_API_KEY}

Then start the server with your config:

mcp-server --config config.yaml

Connecting Models to Tools

API Endpoints

The MCP server exposes several endpoints:

  • GET /tools - Lists all available tools
  • POST /run/{tool_name} - Executes a specific tool

Example: Running a Tool

To run a calculator tool:

curl -X POST http://localhost:8000/run/calculator \
  -H "Content-Type: application/json" \
  -d '{"expression": "2 + 2"}'

Response:

{
  "result": 4
}

Environment Variables

Configure the server using environment variables:

  • MCP_PORT - Server port (default: 8000)
  • MCP_HOST - Host to bind (default: 0.0.0.0)
  • MCP_LOG_LEVEL - Logging level (default: info)
  • MCP_CONFIG_PATH - Path to configuration file

You can set these in a .env file or directly in your environment:

MCP_PORT=9000 MCP_LOG_LEVEL=debug mcp-server

Docker Deployment

Run the server using Docker:

docker pull mcpserver/mcp-server:latest
docker run -p 8000:8000 mcpserver/mcp-server:latest

With custom configuration:

docker run -p 8000:8000 \
  -v $(pwd)/config.yaml:/app/config.yaml \
  -e MCP_CONFIG_PATH=/app/config.yaml \
  mcpserver/mcp-server:latest

How to install this MCP server

Note: This MCP server does not have specific installation instructions available. The examples below show how you would set up the playbooks.com cursor-rules-mcp server. Please visit the GitHub repository for Tavily Search and ask your AI agent for help adapting these instructions.

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "cursor-rules-mcp" '{
    "command": "npx",
    "args": ["-y", "cursor-rules-mcp"]
}'

See the official Claude Code MCP documentation for more details.

For 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 > Tools & Integrations and click "New 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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to the mcpServers section:

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

3. Restart Claude Desktop for the changes to take effect

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