The Perplexity MCP Server integrates Perplexity AI as a tool provider for Claude Desktop using the Model Context Protocol (MCP). This allows Claude users to access Perplexity's AI models for both single questions and multi-turn conversations directly from the desktop application.
Clone the 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 the appropriate 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"
}
}
}
}
After configuration, Claude Desktop will have access to these Perplexity tools:
Use the perplexity_ask tool to send a single question to Perplexity:
query
(required): The question to askmodel
(optional): Model name (default: llama-3.1-sonar-small-128k-online
)Use the perplexity_chat tool for multi-turn conversations:
messages
(required): Array of conversation messagesmodel
(optional): Model name (default: mixtral-8x7b-instruct
)If you encounter issues with the Perplexity MCP Server:
cat ~/.claude/logs/perplexity.log
claude_desktop_config.json
format is correct"DEBUG": "1"
to the env section of your configurationThere are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.