This server enables Claude Desktop to interact with Perplexity AI for web-based research with citations. You can:
Ask Questions: Submit queries to Perplexity AI for detailed answers
Control Response Length: Limit response size with the
max_tokens
parameterAdjust Randomness: Modify response creativity using the
temperature
parameter (0-2)Filter by Domain: Restrict search results to specific domains with
search_domain_filter
Filter by Recency: Narrow results to specific timeframes (day, week, month, year) using
search_recency_filter
Provides support for storing Perplexity API keys securely in environment variables for better security practices when sharing code.
Allows Claude to perform web-based research through Perplexity AI's API, providing answers with citations. Supports configuration of parameters like temperature, max tokens, domain filtering, and recency filtering.
Perplexity Tool for Claude Desktop
A custom MCP tool that integrates Perplexity AI's API with Claude Desktop, allowing Claude to perform web-based research and provide answers with citations.
Prerequisites Installation
Install Git:
For Mac:
Install Homebrew first by pasting this in Terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Then install Git:
brew install gitFor Windows:
Download Git from git-scm.com
Run the installer
Install Node.js:
For Mac:
brew install nodeFor Windows:
Download from nodejs.org
Run the installer
Verify installations by running:
Tool Installation
Clone the repository
Install dependencies
Set up your API Key
You have two options:
Option 1 (Quick setup):
Open
server.js
Find this line:
Replace with your Perplexity API key
Option 2 (Best practice):
Create a .env file:
# On Mac/Linux: touch .env open .env # On Windows: notepad .envOr simply create a new file named
.env
in your text editorAdd your API key to the .env file:
PERPLEXITY_API_KEY=your-api-key-hereInstall dotenv:
npm install dotenvUpdate server.js:
import 'dotenv/config' const PERPLEXITY_API_KEY = process.env.PERPLEXITY_API_KEY;
Configure Claude Desktop
Open
~/Library/Application Support/Claude/claude_desktop_config.json
Add this configuration:
Replace /full/path/to
with the actual path where you cloned the repository.
Restart Claude Desktop
Usage
Once installed, you can use the tool through Claude with commands like:
"Ask Perplexity about recent developments in AI"
"Use Perplexity to research the history of quantum computing"
"Search Perplexity for information about climate change, focusing on the last month"
Advanced Options
You can specify additional parameters:
temperature
: Controls response randomness (0-2)max_tokens
: Limits response lengthsearch_domain_filter
: Restricts search to specific domainssearch_recency_filter
: Filters by time period (day/week/month/year)
Troubleshooting
Git not found:
Make sure you've installed Git correctly
Try restarting your terminal
On Mac, make sure Homebrew is in your PATH
Node.js errors:
Verify Node.js installation with
node --version
Try reinstalling Node.js
API Key issues:
Make sure you've correctly copied your API key
Check that there are no extra spaces in your .env file
If using Option 2, verify dotenv is installed
Tool not appearing in Claude:
Check the path in claude_desktop_config.json
Make sure the path points to your server.js file
Restart Claude Desktop
Check the console for any error messages
License
MIT
Security Note
If you're planning to share your code or make it public:
Don't commit your API key to Git
Use the .env method (Option 2)
Add .env to your .gitignore file
local-only server
The server can only run on the client's local machine because it depends on local resources.
A custom MCP tool that integrates Perplexity AI's API with Claude Desktop, allowing Claude to perform web-based research and provide answers with citations.
Related Resources
Related MCP Servers
- -securityFlicense-qualityAllows Claude or other MCP-compatible AI assistants to search the web and get up-to-date information using the Perplexity API, with features for filtering results by time period.Last updated -8
- AsecurityAlicenseAqualityAn MCP server that enables Claude to perform web searches using Perplexity's API with intelligent model selection based on query intent and support for domain and recency filtering.Last updated -3MIT License
- AsecurityAlicenseAqualityMCP server that enables Claude to request chat completions with citations from the Perplexity API.Last updated -1MIT License
- -securityAlicense-qualityA 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.Last updated -41812ISC License