Step 1: Clone the Repository
Clone the repository to your local machine:
git clone [email protected]: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.
- Add the following configuration 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"
}
}
}
}
- Alternatively, use the NPX configuration:
{
"mcpServers": {
"perplexity-ask": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-perplexity-ask"
],
"env": {
"PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
- Access the file using:
vim ~/Library/Application Support/Claude/claude_desktop_config.json
Step 4: Build the Docker Image
Build the Docker image with the following command:
docker build -t mcp/perplexity-ask:latest -f Dockerfile .
Step 5: Testing
- Ensure Claude for Desktop is recognizing the tools by looking for the hammer icon.
- Click the hammer icon to verify the tools from the Filesystem MCP Server are visible.
Step 6: Advanced Parameters
- Modify search parameters directly in the
index.tsscript as needed, referring to the official API documentation.
Troubleshooting
- Refer to the Claude documentation for troubleshooting.
- For additional support, contact: [email protected]