This MCP server provides web search functionality for Claude AI using the Perplexity API. It allows Claude to search the web for up-to-date information, effectively enabling the language model to access current information from the internet when responding to your queries.
The easiest way to install the Perplexity MCP server is through Smithery:
npx -y @smithery/cli install perplexity-mcp --client claude
The server requires UV (a fast Python package manager) to run. If you don't have UV installed:
On macOS with Homebrew:
brew install uv
Or for macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
For Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
To manually configure the MCP server, you'll need to edit your Claude Desktop or Cursor config file.
Add the following configuration:
"perplexity-mcp": {
"env": {
"PERPLEXITY_API_KEY": "XXXXXXXXXXXXXXXXXXXX",
"PERPLEXITY_MODEL": "sonar"
},
"command": "uvx",
"args": [
"perplexity-mcp"
]
}
For Claude Desktop:
~/Library/Application\ Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
For Cursor:
/Users/your-username/.cursor/mcp.json
C:\Users\your-username\.cursor\mcp.json
You must obtain a Perplexity API key from Perplexity AI and add it to your configuration.
Once installed, you can use web search in your Claude conversations with prompts like:
When you use a search-related prompt, Claude will recognize the need and request permission to use the Perplexity web search tool. Click "Allow for this chat" when prompted.
You can customize which Perplexity model to use by setting the PERPLEXITY_MODEL
environment variable:
sonar-deep-research
: 128k context - Enhanced research capabilitiessonar-reasoning-pro
: 128k context - Advanced reasoning with professional focussonar-reasoning
: 128k context - Enhanced reasoning capabilitiessonar-pro
: 200k context - Professional grade modelsonar
: 128k context - Default modelr1-1776
: 128k context - Alternative architectureWhen searching, you can specify how recent the results should be:
For example: "Search the web for news about OpenAI in the past week"
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "perplexity-mcp" '{"env":{"PERPLEXITY_API_KEY":"XXXXXXXXXXXXXXXXXXXX","PERPLEXITY_MODEL":"sonar"},"command":"uvx","args":["perplexity-mcp"]}'
See the official Claude Code MCP documentation for more details.
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.
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": {
"perplexity-mcp": {
"env": {
"PERPLEXITY_API_KEY": "XXXXXXXXXXXXXXXXXXXX",
"PERPLEXITY_MODEL": "sonar"
},
"command": "uvx",
"args": [
"perplexity-mcp"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"perplexity-mcp": {
"env": {
"PERPLEXITY_API_KEY": "XXXXXXXXXXXXXXXXXXXX",
"PERPLEXITY_MODEL": "sonar"
},
"command": "uvx",
"args": [
"perplexity-mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect