
Perplexity Ask MCP Server
A Model Context Protocol Server connector for Perplexity API, to enable web search without leaving the MCP ecosystem.
what is Perplexity Ask MCP Server?
Perplexity Ask MCP Server is a Model Context Protocol (MCP) server that connects to the Perplexity API, enabling users to perform web searches without leaving the MCP ecosystem.
how to use Perplexity Ask MCP Server?
To use the server, clone the repository, install dependencies, obtain a Sonar API key, configure the server settings, and build the Docker image. After setup, you can interact with the server through the Claude desktop application.
key features of Perplexity Ask MCP Server?
- Real-time web search capabilities through the Sonar API.
- Integration with Claude for seamless user experience.
- Customizable search parameters for advanced users.
use cases of Perplexity Ask MCP Server?
- Conducting live web searches while using the Claude desktop application.
- Integrating web search functionality into other applications via the MCP server.
- Enhancing research capabilities with real-time data retrieval.
FAQ from Perplexity Ask MCP Server?
- How do I get started with the server?
Follow the setup instructions in the repository to clone, configure, and run the server.
- Is there a cost associated with using the Sonar API?
Please check the Sonar API documentation for pricing details.
- Can I modify the search parameters?
Yes, you can customize the search parameters in the API call as per your requirements.
Perplexity Ask MCP Server
An MCP server implementation that integrates the Sonar API to provide Claude with unparalleled real-time, web-wide research.
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.
- Each message must include:
Configuration
Step 1:
Clone this repository:
git clone git@github.com:ppl-ai/modelcontextprotocol.git
Navigate to the perplexity-ask
directory and install the necessary dependencies:
cd modelcontextprotocol/perplexity-ask && npm install
Step 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
.
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"
}
}
}
}
NPX
{
"mcpServers": {
"perplexity-ask": {
"command": "npx",
"args": [
"-y",
"server-perplexity-ask"
],
"env": {
"PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
You can access the file using:
vim ~/Library/Application\ Support/Claude/claude_desktop_config.json
Step 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.
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.