Perplexity Tool for Claude Desktop

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.

letsbuildagent

Search
Browser Automation
Local
JavaScript
Visit Server

Tools

ask_perplexity

Ask a question to Perplexity AI

README

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

  1. 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 git
      
    • For Windows:
  2. Install Node.js:

    • For Mac:
      brew install node
      
    • For Windows:
  3. Verify installations by running:

git --version
node --version

Tool Installation

  1. Clone the repository
git clone https://github.com/letsbuildagent/perplexity-tool
cd perplexity-tool
  1. Install dependencies
npm install
  1. Set up your API Key

You have two options:

Option 1 (Quick setup):

  • Open server.js
  • Find this line:
const PERPLEXITY_API_KEY = "YOUR-API-KEY-HERE";
  • Replace with your Perplexity API key

Option 2 (Best practice):

  • Create a .env file:
    # On Mac/Linux:
    touch .env
    open .env
    
    # On Windows:
    notepad .env
    
    Or simply create a new file named .env in your text editor
  • Add your API key to the .env file:
    PERPLEXITY_API_KEY=your-api-key-here
    
  • Install dotenv:
    npm install dotenv
    
  • Update server.js:
    import 'dotenv/config'
    const PERPLEXITY_API_KEY = process.env.PERPLEXITY_API_KEY;
    
  1. Configure Claude Desktop
  • Open ~/Library/Application Support/Claude/claude_desktop_config.json
  • Add this configuration:
{
  "mcpServers": {
    "perplexity-tool": {
      "command": "node",
      "args": [
        "/full/path/to/perplexity-tool/server.js"
      ]
    }
  }
}

Replace /full/path/to with the actual path where you cloned the repository.

  1. 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 length
  • search_domain_filter: Restricts search to specific domains
  • search_recency_filter: Filters by time period (day/week/month/year)

Troubleshooting

  1. Git not found:

    • Make sure you've installed Git correctly
    • Try restarting your terminal
    • On Mac, make sure Homebrew is in your PATH
  2. Node.js errors:

    • Verify Node.js installation with node --version
    • Try reinstalling Node.js
  3. 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
  4. 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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Excel MCP Server

Excel MCP Server

A Model Context Protocol server that enables AI assistants to read from and write to Microsoft Excel files, supporting formats like xlsx, xlsm, xltx, and xltm.

Featured
Local
Go
Playwright MCP Server

Playwright MCP Server

Provides a server utilizing Model Context Protocol to enable human-like browser automation with Playwright, allowing control over browser actions such as navigation, element interaction, and scrolling.

Featured
Local
TypeScript
@kazuph/mcp-fetch

@kazuph/mcp-fetch

Model Context Protocol server for fetching web content and processing images. This allows Claude Desktop (or any MCP client) to fetch web content and handle images appropriately.

Featured
Local
JavaScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
Apple MCP Server

Apple MCP Server

Enables interaction with Apple apps like Messages, Notes, and Contacts through the MCP protocol to send messages, search, and open app content using natural language.

Featured
Local
TypeScript
DuckDuckGo MCP Server

DuckDuckGo MCP Server

A Model Context Protocol (MCP) server that provides web search capabilities through DuckDuckGo, with additional features for content fetching and parsing.

Featured
Python