Get the FREE Ultimate OpenClaw Setup Guide →

perplexity

A server that implements the MCP protocol to bring perplexity API into context.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio laodev1-perplexity-mcp-server node path\to\perplexity-mcp-server\dist\index.js \
  --env PERPLEXITY_API_KEY="YOUR_PERPLEXITY_API_KEY"

How to use

The Perplexity MCP Server is a Node.js implementation of the Model Context Protocol (MCP) that acts as a secure bridge between Claude and Perplexity AI's capabilities. It exposes two MCP tools: perplexity_chat for full message-history based chat completions, and perplexity_ask for quick, single-query interactions. These tools let Claude invoke Perplexity’s language models with structured inputs, enabling advanced conversations or simple Q&A flows through a standardized MCP interface. You can register and use these tools via the MCP SDK, and the server handles input validation, error reporting, and tool execution lifecycle to ensure reliable interactions.

To use the tools, configure the server in Claude Desktop or your MCP client with the perplexity server entry. perplexity_chat accepts historical messages, a model choice, and a temperature setting to influence generation. perplexity_ask accepts a single query and an optional model. When invoked, the server routes requests to Perplexity AI, returns the generated responses, and manages tool-specific outputs within the MCP framework.

How to install

Prerequisites:

  • Node.js (LTS) installed
  • npm installed
  • Access to a Perplexity API key
  1. Clone the repository:
git clone https://github.com/yourusername/perplexity-mcp-server.git
cd perplexity-mcp-server
  1. Install dependencies:
npm install
  1. Create a .env file with your API key:
PERPLEXITY_API_KEY=your-api-key-here
  1. Build the project (TypeScript to JavaScript):
npm run build
  1. Run the development server (or configure as a packaged server):
npm run dev
  1. If integrating with Claude Desktop, add the server entry to claude_desktop_config.json as shown in the Configuration section of the README.

Additional notes

Environment variables:

  • PERPLEXITY_API_KEY: Your Perplexity API key must be provided for the server to access Perplexity models.

Configuration tips:

  • Ensure the dist/index.js path in your mcp_config matches your build output location.
  • The MCP server uses stdio transport and the @modelcontextprotocol/sdk; ensure your environment supports these components.

Common issues:

  • Authentication errors: verify the PERPLEXITY_API_KEY is correct and present in the environment.
  • Build failures: ensure TypeScript compilation completes without errors before starting the server.
  • Incorrect tool parameters: align inputs with the provided schemas for perplexity_chat and perplexity_ask.

Related MCP Servers

Sponsor this space

Reach thousands of developers