Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Tavily Search MCP server #534

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

apappascs
Copy link

@apappascs apappascs commented Jan 16, 2025

Description

This commit introduces a new MCP server that integrates the Tavily Search API.

The Tavily Search server allows LLMs to perform web searches optimized for quality and relevance. It includes features such as:

  • Configurable search depth and topic.
  • Time range filtering for news searches.
  • Options to include images, image descriptions, and short answers.
  • Domain inclusion and exclusion.

The server has been tested with a Spring AI MCP client and is ready for integration with MCP-compatible clients.

Server Details

  • Server: tavily-search
  • Changes to: New server implementation

Motivation and Context

This change is needed to enhance the capabilities of LLMs by providing them with access to a powerful and optimized search engine. The Tavily Search API is specifically designed for AI applications, offering features that improve the quality and relevance of search results for language models. This server allows LLMs to retrieve information from the web more effectively, leading to better-informed and more accurate responses.

How Has This Been Tested?

This server has been tested with a Spring AI example application that utilizes the ChatClient to interact with the MCP server. The following scenarios were tested:

  • Basic search queries on the "general" topic.
  • News searches with time range filtering.
  • Searches with and without image inclusion.
  • Searches with and without short answers.
  • Domain inclusion and exclusion.

Also tested with MCP Inspector
Screenshot 2025-01-17 at 10 43 07 AM
Screenshot 2025-01-17 at 10 43 32 AM

The tests verified that the server correctly handles requests, communicates with the Tavily API, and returns results in the expected format.

Breaking Changes

No, this is a new server implementation and does not introduce any breaking changes. Users will not need to update existing MCP client configurations unless they want to use the new tavily-search server.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

The tavily-search server is implemented in TypeScript and uses the @modelcontextprotocol/sdk for communication. It requires a Tavily API key, which should be provided as an environment variable (TAVILY_API_KEY). The server supports both npx and Docker deployments, as documented in the README. The implementation includes error handling for common issues like API errors and invalid input arguments.

This commit introduces a new MCP server that integrates the Tavily Search API.

The Tavily Search server allows LLMs to perform web searches optimized for
quality and relevance. It includes features such as:

- Configurable search depth and topic.
- Time range filtering for news searches.
- Options to include images, image descriptions, and short answers.
- Domain inclusion and exclusion.

The server has been tested with a Spring AI MCP client and is
ready for integration with MCP-compatible clients.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant