The Perplexity MCP Server is an intelligent research assistant that leverages Perplexity's AI models to provide search capabilities for all tasks. It automatically detects query complexity to route requests to the most appropriate model, ensuring optimal results. This server also encourages specificity in agent interactions.
This tool is ideal for simple queries and basic information lookup, providing concise, direct answers.
const result = await use_mcp_tool({
server_name: "perplexity",
tool_name: "search",
arguments: {
query: "What is the capital of France?",
force_model: false // Optional: force using this model even if query seems complex
}
});
Perfect for complex, multi-step tasks that require detailed analysis, explanations, comparisons, and problem-solving.
const result = await use_mcp_tool({
server_name: "perplexity",
tool_name: "reason",
arguments: {
query: "Compare and contrast REST and GraphQL APIs, explaining their pros and cons",
force_model: false // Optional: force using this model even if query seems simple
}
});
Conducts comprehensive research and generates detailed reports for in-depth analysis of complex topics.
const result = await use_mcp_tool({
server_name: "perplexity",
tool_name: "deep_research",
arguments: {
query: "The impact of quantum computing on cryptography",
focus_areas: [
"Post-quantum cryptographic algorithms",
"Timeline for quantum threats",
"Practical mitigation strategies"
],
force_model: false // Optional: force using this model even if query seems simple
}
});
Add the following to your MCP settings file:
{
"mcpServers": {
"perplexity": {
"command": "npx",
"args": [
"-y",
"perplexity-mcp"
],
"env": {
"PERPLEXITY_API_KEY": "your_api_key"
}
}
}
}
If you've cloned the repository, configure your MCP settings file as follows:
{
"mcpServers": {
"perplexity": {
"command": "node",
"args": ["/path/to/perplexity-server/build/index.js"],
"env": {
"PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE"
},
"disabled": false,
"autoApprove": []
}
}
}
If your MCP Client can't parse the Perplexity API Key from the environment, you have these alternatives:
Pass the API key directly as a command-line argument:
{
"mcpServers": {
"perplexity": {
"command": "node",
"args": [
"/path/to/perplexity-server/build/index.js",
"--api-key",
"your_api_key_here"
],
"disabled": false,
"autoApprove": []
}
}
}
Specify a project directory containing a .env file with your API key:
{
"mcpServers": {
"perplexity": {
"command": "node",
"args": [
"/path/to/perplexity-server/build/index.js",
"--cwd",
"/path/to/your/project"
],
"disabled": false,
"autoApprove": []
}
}
}
Note on Priority: The server checks for API keys in this order: command-line argument > environment variable > .env file with --cwd (path needed).
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "perplexity" '{"command":"npx","args":["-y","perplexity-mcp"],"env":{"PERPLEXITY_API_KEY":"your_api_key"}}'
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": {
"command": "npx",
"args": [
"-y",
"perplexity-mcp"
],
"env": {
"PERPLEXITY_API_KEY": "your_api_key"
}
}
}
}
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.json2. Add this to your configuration file:
{
"mcpServers": {
"perplexity": {
"command": "npx",
"args": [
"-y",
"perplexity-mcp"
],
"env": {
"PERPLEXITY_API_KEY": "your_api_key"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect