Perplexity Ask MCP Server
Integrates Perplexity's Sonar API so the perplexity_ask tool can run live web searches and return real-time research answers from conversation messages.
Uses Perplexity's Sonar API/models, such as sonar-pro, sonar-deep-research, and sonar-reasoning-pro, to provide live web search and research responses.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Perplexity Ask MCP Server what are the latest AI regulation updates this week?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Perplexity Ask MCP Server
An MCP server implementation that integrates the Sonar API to provide Claude with unparalleled real-time, web-wide research.
Please refer to the official DeepWiki page for assistance with implementation.
High-level System Architecture
Credits: DeepWiki powered by Devin


Tools
perplexity_ask
Engage in a conversation with the Sonar API for live web searches.
Inputs:
messages(array): An array of conversation messages.Each message must include:
role(string): The role of the message (e.g.,system,user,assistant).content(string): The content of the message.
Related MCP server: Perplexity Web-Search MCP
Configuration
Step 1:
Clone this repository:
git clone git@github.com:ppl-ai/modelcontextprotocol.gitNavigate to the perplexity-ask directory and install the necessary dependencies:
cd modelcontextprotocol/perplexity-ask && npm installStep 2: Get a Sonar API Key
Sign up for a Sonar API account.
Follow the account setup instructions and generate your API key from the developer dashboard.
Set the API key in your environment as
PERPLEXITY_API_KEY.
Environment Variables
The following environment variables can be configured:
PERPLEXITY_API_KEY(required): Your Perplexity API keyPERPLEXITY_API_URL(optional): Custom API endpoint URL (defaults tohttps://api.perplexity.ai/chat/completions)PERPLEXITY_MODEL(optional): Default model for general use (defaults tosonar-pro)PERPLEXITY_ASK_MODEL(optional): Model for the perplexity_ask tool (defaults tosonar-pro)PERPLEXITY_RESEARCH_MODEL(optional): Model for the perplexity_research tool (defaults tosonar-deep-research)PERPLEXITY_REASON_MODEL(optional): Model for the perplexity_reason tool (defaults tosonar-reasoning-pro)
Using with OpenRouter or Other Third-Party Providers
To use Perplexity models via OpenRouter or other compatible providers:
Set
PERPLEXITY_API_URLto your provider's endpoint (e.g.,https://openrouter.ai/api/v1/chat/completions)Use your provider's API key as
PERPLEXITY_API_KEYConfigure model names according to your provider's naming convention
Step 3: Configure Claude Desktop
Download Claude desktop here.
Add this to your
claude_desktop_config.json:
{
"mcpServers": {
"perplexity-ask": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PERPLEXITY_API_KEY",
"mcp/perplexity-ask"
],
"env": {
"PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE",
"PERPLEXITY_API_URL": "https://api.perplexity.ai/chat/completions",
"PERPLEXITY_ASK_MODEL": "sonar-pro",
"PERPLEXITY_RESEARCH_MODEL": "sonar-deep-research",
"PERPLEXITY_REASON_MODEL": "sonar-reasoning-pro"
}
}
}
}NPX
{
"mcpServers": {
"perplexity-ask": {
"command": "npx",
"args": [
"-y",
"server-perplexity-ask"
],
"env": {
"PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE",
"PERPLEXITY_API_URL": "https://api.perplexity.ai/chat/completions",
"PERPLEXITY_ASK_MODEL": "sonar-pro",
"PERPLEXITY_RESEARCH_MODEL": "sonar-deep-research",
"PERPLEXITY_REASON_MODEL": "sonar-reasoning-pro"
}
}
}
}You can access the file using:
vim ~/Library/Application\ Support/Claude/claude_desktop_config.jsonStep 4: Build the Docker Image
Docker build:
docker build -t mcp/perplexity-ask:latest -f Dockerfile .Step 5: Testing
Let's make sure Claude for Desktop is picking up the two tools we've exposed in our perplexity-ask server. You can do this by looking for the hammer icon:

After clicking on the hammer icon, you should see the tools that come with the Filesystem MCP Server:

If you see both of these this means that the integration is active. Congratulations! This means Claude can now ask Perplexity. You can then simply use it as you would use the Perplexity web app.
Step 6: Advanced parameters
Currently, the search parameters used are the default ones. You can modify any search parameter in the API call directly in the index.ts script. For this, please refer to the official API documentation.
Troubleshooting
The Claude documentation provides an excellent troubleshooting guide you can refer to. However, you can still reach out to us at api@perplexity.ai for any additional support or file a bug.
Cursor integration
You can also use our MCP with Cursor (or any other app that supports this). To use Sonar with Cursor, you can follow the following steps.
Step 1: Navigate to your Cursor settings:

Step 2: Navigate to the MCP directory
And click on Add new global MCP server

Step 3: Insert the MCP Server Configuration from above
This is the same configuration you would use for any other application that supports MCP.
You should then see the application being part of your available tools like this:

License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Available Tools
3 toolsperplexity_askC
Engages in a conversation using the Sonar API. Accepts an array of messages (each with a role and content) and returns a ask completion response from the Perplexity model.
Inputs: messages (required).
perplexity_reasonB
Performs reasoning tasks using the Perplexity API. Accepts an array of messages (each with a role and content) and returns a well-reasoned response using the sonar-reasoning-pro model.
Inputs: messages (required).
perplexity_researchC
Performs deep research using the Perplexity API. Accepts an array of messages (each with a role and content) and returns a comprehensive research response with citations.
Inputs: messages (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
All three tools accept identical message arrays and return completions, so the boundary between perplexity_reason and perplexity_ask depends entirely on subtle model differences (sonar-reasoning-pro vs Sonar). The descriptions hint at reasoning vs conversational use, but an agent could easily misselect. perplexity_research is clearly distinct due to its deep-research/citation behavior.
All tools follow a strict perplexity_<action> snake_case pattern with no deviations. The shared prefix and single verb per tool make the naming predictable and readable.
Three tools is a reasonable, well-scoped surface for a Perplexity API wrapper, mirroring the main model families (ask, reasoning, research). A single parameterized tool could have covered ask/reason, but the current count is not excessive.
The tools cover Perplexity's core capabilities: standard Q&A, reasoning, and deep research with citations. Minor gaps exist, such as no explicit model-selection or search-only mode, but the main workflows are covered.
Related MCP Connectors
Enable AI assistants to perform web searches using Perplexity's Sonar Pro.
Provides AI assistants with access to Seltz's powerful Web Search capabilities.
Agent-native search engine with live web research optimized for AI agents.
Web search, scraping, Google Trends and data lookups. Paid per call in USDC on Base via x402.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceIntegrates the Sonar API to provide Claude with real-time web-wide research capabilities. Enables conversational web searches through Perplexity's AI-powered search engine for up-to-date information retrieval.MIT
- FlicenseBqualityDmaintenanceEnables AI assistants to perform real-time web and academic searches using Perplexity's Sonar API.2-
- AlicenseAqualityDmaintenanceEnables web search and deep research using Perplexity Sonar models through MCP clients like Cursor or Claude Desktop.2MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to perform live web searches with ranked results and extracted page passages, plus clean markdown extraction of any URL.MIT