A custom Model Context Protocol implementation that integrates Perplexity AI with Claude Desktop, allowing users to access Perplexity's AI models for both single questions and multi-turn conversations.
A custom Model Context Protocol (MCP) implementation that adds Perplexity AI as a tool provider for Claude Desktop.
Clone this repository:
git clone https://github.com/Family-IT-Guy/perplexity-mcp.git cd perplexity-mcp
Install dependencies:
npm install
Create a .env
file with your API key:
PERPLEXITY_API_KEY=your_api_key_here
Test the server:
node server.js
Clone and navigate to the repository as above
Install globally:
npm install -g .
Now you can run the server from anywhere:
perplexity-mcp
Add this configuration to your claude_desktop_config.json
file:
{ "mcpServers": { "perplexity": { "command": "node", "args": [ "/absolute/path/to/perplexity-mcp/server.js" ], "env": { "PERPLEXITY_API_KEY": "your_perplexity_api_key" } } } }
{ "mcpServers": { "perplexity": { "command": "npx", "args": [ "perplexity-mcp" ], "env": { "PERPLEXITY_API_KEY": "your_perplexity_api_key" } } } }
If you're using Node Version Manager (NVM), you need absolute paths:
{ "mcpServers": { "perplexity": { "command": "/Users/username/.nvm/versions/node/v16.x.x/bin/node", "args": [ "/Users/username/path/to/perplexity-mcp/server.js" ], "env": { "PERPLEXITY_API_KEY": "your_perplexity_api_key" } } } }
Once configured, Claude will have access to these tools:
perplexity_ask - Send a single question to Perplexity
query
(required): The question to askmodel
(optional): Model name (default: llama-3.1-sonar-small-128k-online
)perplexity_chat - Have a multi-turn conversation
messages
(required): Array of conversation messagesmodel
(optional): Model name (default: mixtral-8x7b-instruct
)cat ~/.claude/logs/perplexity.log
"DEBUG": "1"
to the env sectionThis implementation uses the Model Context Protocol (MCP) created by Anthropic to extend Claude Desktop's capabilities. It:
This project is licensed under the ISC License - see the LICENSE file for details.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!