Perplexity MCP
Perplexity API Platform MCP Server provides AI assistants with real-time web search, reasoning, and research capabilities. It powers advanced tools like perplexity_search, perplexity_ask, perplexity_research, and perplexity_reason for accurate, current, and deep analysis.
How to Install and Use Perplexity MCP
Perplexity MCP is the official server for the Perplexity API Platform. It lets you use AI assistants that can search the web in real time, reason, and do research using Perplexity’s Sonar models. Here’s a simple guide on how to set it up and start using it.
Step 1: Get Your API Key
Before you install Perplexity MCP, you need an API key from Perplexity.
First, go to the Perplexity API Portal and sign up or sign in. Then, copy your unique API key. You will use this key later to make the server work.
Step 2: Install Perplexity MCP Server
Now you are ready to install the server that runs Perplexity MCP. You can install it easily using a command-line tool called npx.
Open your terminal or command prompt, and type the following command. Replace "your_key_here" with the API key you got in step 1.
claude mcp add perplexity --env PERPLEXITY_API_KEY="your_key_here" -- npx -y @perplexity-ai/mcp-server
This command sets up Perplexity MCP with your API key so it can connect to Perplexity’s services.
Step 3: Configure Perplexity MCP for Your Client
Different text editors or coding environments use configuration files to run MCP servers. Here’s how you should set it up for some popular clients.
For example, if you use Cursor, add this to the ~/.cursor/mcp.json file:
{
"mcpServers": {
"perplexity": {
"command": "npx",
"args": ["-y", "@perplexity-ai/mcp-server"],
"env": {
"PERPLEXITY_API_KEY": "your_key_here"
}
}
}
}
Replace "your_key_here" with your API key. Other clients like Claude Desktop or Windsurf use similar configuration formats but different file locations.
Step 4: Run Perplexity MCP as an HTTP Server (Optional)
If you want to run Perplexity MCP on a cloud server or share it over a network, you can start it as an HTTP server.
First, make sure your API key is set as an environment variable:
export PERPLEXITY_API_KEY="your_key_here"
Then, run these commands:
npm install
npm run build
npm run start:http
By default, the HTTP server runs on port 8080. You can connect clients to this URL:
http://localhost:8080/mcp
If you prefer, you can also run Perplexity MCP in a Docker container:
docker build -t perplexity-mcp-server .
docker run -p 8080:8080 -e PERPLEXITY_API_KEY=your_key_here perplexity-mcp-server
Step 5: Use Available Tools with Perplexity MCP
Perplexity MCP offers several powerful tools for different tasks:
- perplexity_search — For direct web searches with ranked results.
- perplexity_ask — A conversational AI with real-time web search.
- perplexity_research — For deep research and detailed reports.
- perplexity_reason — For advanced reasoning and complex problem solving.
When you make requests, your MCP client will automatically use these tools.
Troubleshooting Tips
If something is not working, try these common fixes:
- Make sure the
PERPLEXITY_API_KEYis set correctly. - Check your internet connection.
- If you are behind a proxy, set the
PERPLEXITY_PROXYenvironment variable. - For long research tasks, increase timeout by setting
PERPLEXITY_TIMEOUT_MS. - If you get errors on startup with some clients, try using
npx -yqinstead ofnpx -yto avoid installation messages interfering.
For more help, visit the Perplexity community or check the GitHub issues.
This quick guide gets Perplexity MCP running so you can start building AI assistant features with real-time web search and reasoning. Just follow the steps carefully, and you will have it working in no time!