Engage in a conversation with the Sonar API for live web searches
Perplexity Ask is a Model Context Protocol server that connects to Perplexity's Sonar API, enabling AI assistants to perform real-time web searches without leaving their native environment. This integration allows Claude and other MCP-compatible AI assistants to access up-to-date information from across the web, enhancing their ability to provide accurate and current responses to user queries.
Perplexity Ask is a Model Context Protocol (MCP) server that integrates with Perplexity's Sonar API to provide AI assistants with real-time web search capabilities. This integration allows AI assistants like Claude to access current information from across the web without requiring users to switch between applications.
Before installing the Perplexity Ask MCP server, you'll need:
You can install the Perplexity Ask MCP server using either Docker or NPX.
git clone git@github.com:ppl-ai/modelcontextprotocol.git
cd modelcontextprotocol/perplexity-ask
docker build -t mcp/perplexity-ask:latest -f Dockerfile .
{
"mcpServers": {
"perplexity-ask": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PERPLEXITY_API_KEY",
"mcp/perplexity-ask"
],
"env": {
"PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
Alternatively, you can use NPX to install and run the server:
{
"mcpServers": {
"perplexity-ask": {
"command": "npx",
"args": [
"-y",
"server-perplexity-ask"
],
"env": {
"PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
For Claude Desktop, the configuration file is located at:
~/Library/Application Support/Claude/claude_desktop_config.json
You can access it using:
vim ~/Library/Application\ Support/Claude/claude_desktop_config.json
After installation, verify that the MCP server is properly connected to your AI assistant:
Once installed, you can use the Perplexity Ask tool by simply asking your AI assistant to search for information on the web. The assistant will automatically use the Perplexity Sonar API to retrieve relevant and up-to-date information.
Example prompts:
You can modify the search parameters used by the Perplexity Sonar API by editing the index.ts
script in the repository. Refer to the official API documentation for details on available parameters.
If you encounter issues with the Perplexity Ask MCP server:
For additional support, you can contact Perplexity at api@perplexity.ai or file an issue on the GitHub repository.