MCP server URL
- Claude & Claude Code
- ChatGPT & Codex
- Cursor
- VS Code
- Other clients
Claude Code
What you get
The Tavily MCP server gives your agent these tools:Client setup details
Connect to Claude Code
Claude Code natively supports remote MCP servers with OAuth authentication. Add Tavily to your Claude Code configuration by running:.claude/settings.json:
mcp-remote:
Connect to Claude Desktop
Click Add to Claude at the top of this page, or open the Tavily connector in Claude’s directory, click Connect, and sign in to Tavily. See the Claude guide for organization-wide access and the Tavily plugin.Connect to Cursor
For the recommended Tavily plugin, standalone setup options, and examples, see the Cursor guide. The Add to Cursor button above installs the server with OAuth. To use an API key instead, add this to yourmcp.json and replace <your-api-key> with your Tavily API key:
OpenAI Responses API
Allow OpenAI models to use the remote Tavily MCP server to perform tasks.- Export your
OPENAI_API_KEY. - Replace
<your-api-key>with your Tavily API key.
Clients that don’t support remote MCPs
mcp-remote is a lightweight bridge that lets MCP clients that can only talk to local (stdio) servers securely connect to remote MCP servers over HTTP + SSE with OAuth-based auth, so you can host and update your server in the cloud while existing clients keep working. It serves as an experimental stop-gap until popular MCP clients natively support remote, authorized servers.OAuth Authentication
The Tavily Remote MCP server supports secure OAuth authentication, allowing you to connect and authorize seamlessly with compatible clients.Using MCP Inspector
Using MCP Inspector
Open the MCP Inspector and click “Open Auth Settings”. Select the OAuth flow and complete these steps:
- Metadata discovery
- Client registration
- Preparing authorization
- Request authorization and obtain the authorization code
- Token request
- Authentication complete
Using Other MCP Clients
Using Other MCP Clients
You can configure your MCP client to use OAuth without including your Tavily API key in the URL. For example, in Cursor’s If you need to clear stored OAuth credentials and reauthenticate, run:
mcp.json:API Key Selection for OAuthWhen using OAuth authentication, you can control which API key is used by naming a key
mcp_auth_default in your Tavily dashboard:- Personal account: If you have a key named
mcp_auth_defaultin your personal account, it will be used for all OAuth-authenticated requests. - Team account: If your team has a key named
mcp_auth_default, it will be used for all OAuth-authenticated requests. - Both set: If both your personal account and your team have a key named
mcp_auth_default, the personal key takes priority. - Neither set: If no
mcp_auth_defaultkey exists, thedefaultkey in your personal account will be used. If nodefaultkey is set, the first available key will be used.
?tavilyApiKey=...) or by setting it in the Authorization header.Default Parameters
When using the remote MCP, you can specify default parameters for all requests by including aDEFAULT_PARAMETERS header containing a JSON object with your desired defaults. Example:
Session & User Attribution
The remote MCP server automatically attaches identifiers to every Tavily API call so requests can be attributed back to a session. It generatesX-Session-Id on its own, while X-Human-Id is forwarded only when supplied by the client.
X-Session-Id— generated per MCP session (themcp-session-idreturned during the MCPinitializehandshake). All tool calls within the same MCP session share the same value.X-Human-Id— if your client provides anX-Human-Idheader (orhumanIdquery parameter on the MCP URL), it is forwarded through to the Tavily API, helping Tavily better understand multi-step interactions and improve response quality. For security, Tavily hashes human IDs before processing or storing them.
Local Installation
You can also run the Tavily MCP server on your own machine instead of using the remote server.Prerequisites
Required Tools
Required Tools
- Tavily API key
- If you don’t have a Tavily API key, you can sign up for a free account here
- An MCP client, such as Claude Desktop or Cursor
- Node.js (v20 or higher)
- You can verify your Node.js installation by running:
- You can verify your Node.js installation by running:
Git Installation (Optional)
Git Installation (Optional)
Only needed if using Git installation method:
- On macOS:
brew install git - On Linux:
- Debian/Ubuntu:
sudo apt install git - RedHat/CentOS:
sudo yum install git
- Debian/Ubuntu:
- On Windows: Download Git for Windows
Although you can launch a server on its own, it’s not particularly helpful in
isolation. Instead, you should integrate it into an MCP client.
Configuring MCP Clients
- Cursor
- Claude Desktop
Follow the local MCP setup in the Cursor guide to configure the server in
mcp.json, add your Tavily API key, and enable its tools in Customize.Default parameters for local servers
For local MCP setups, you can set default parameter values using theDEFAULT_PARAMETERS environment variable. This allows you to configure default search behavior without specifying these parameters in every request.
Session attribution for local servers
The local MCP server automatically attaches identifiers to every Tavily API call so requests can be attributed back to a session:X-Session-Id— auto-generated once per MCP process and reused for every tool call.X-Human-Id— if you set theHUMAN_IDenvironment variable, that value is forwarded through to the Tavily API on every request, helping Tavily better understand multi-step interactions and improve response quality. For security, Tavily hashes human IDs before processing or storing them.
Usage Examples
Tavily Search Examples
Tavily Search Examples
- General Web Search:
- News Search:
- Domain-Specific Search:
Tavily Extract Examples
Tavily Extract Examples
Extract Article Content:
Combined Usage
Combined Usage
Troubleshooting
Server Not Found
Server Not Found
If you encounter server connection issues, run these commands to verify your environment:Make sure to also check your configuration syntax for any errors.
NPX Issues
NPX Issues
If experiencing problems with npx, locate your executable:
API Key Issues
API Key Issues
When troubleshooting API key problems, verify that your key is:
- Properly formatted with the
tvly-prefix - Valid and active in your Tavily dashboard
- Correctly configured in your environment variables
Resources
GitHub
tavily-ai/tavily-mcpnpm
tavily-mcpTutorial: Tavily MCP with Neo4j
Build a knowledge graph assistant by combining the Tavily and Neo4j MCP servers with Claude.
Model Context Protocol
Read the MCP specification.
Claude & Claude Code
ChatGPT & Codex
Cursor
VS Code