The `tavily-mcp` package provides an advanced Model-Context-Protocol (MCP) server for real-time web search, data extraction, website mapping, and crawling, primarily designed for integration with AI agents like Anthropic's Claude. It ships as a server application (currently at version 0.2.18) rather than a traditional client-side JavaScript library, meaning developers typically interact with it via HTTP requests or dedicated client-side tooling (e.g., `claude mcp add`) rather than direct JavaScript function imports for basic usage. The server offers `tavily-search`, `tavily-extract`, `tavily-map`, and `tavily-crawl` tools. It can be run locally or accessed as a remote service, differentiating itself by providing structured web interaction capabilities for AI models.
npm install tavily-mcpVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to programmatically start the Tavily MCP server locally and then make a basic search request to it, showcasing the server's core functionality.
Always use a single, correct method for API key authentication. For programmatic access, using an Authorization header or environment variable for the API key is recommended.
Ensure the `DEFAULT_PARAMETERS` header value is a `stringified` JSON object, e.g., `JSON.stringify({"include_images":true})`.Upgrade to the latest `tavily-mcp` version and consult the current README or documentation for updated client integration instructions.
Check for available ports or explicitly configure a different port for the `McpServer` instance if the default `DEFAULT_MCP_SERVER_PORT` (8080) is occupied.
Ensure `TAVILY_API_KEY` is set in your environment variables, passed correctly in the URL (`?tavilyApiKey=...`), or included in the `Authorization: Bearer <key>` header when interacting with the server.
Verify that `McpServer.start()` was called successfully and the server is actively listening on the configured port (default 8080) before making requests. Check logs for startup errors.
Ensure the `DEFAULT_PARAMETERS` header value is a properly stringified JSON object, for example, `{"search_depth":"basic"}` should be sent as the string `"{\"search_depth\":\"basic\"}"`.No dependency data recorded yet.