Get the FREE Ultimate OpenClaw Setup Guide →

perplexity

A Model Context Protocol (MCP) server for research and documentation assistance using Perplexity AI. Won 1st @ Cline Hackathon

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

How to use

Perplexity MCP Server provides an AI-assisted research workflow with three tools designed for different depths of inquiry. The Search tool is ideal for quick lookups and concise answers, the Reason tool handles multi-step analyses and comparisons, and the Deep Research tool is best for in-depth studies and comprehensive reports. You interact with these tools by calling use_mcp_tool with the server_name set to perplexity and the appropriate tool_name (search, reason, or deep_research). Each tool accepts a query and optional parameters such as force_model to steer model selection. This setup lets you route requests to the most suitable Perplexity model based on the complexity of the task, while maintaining a consistent interface for requesting results.

Example flows:

  • Quick fact: use the search tool for straightforward questions and expect brief, direct answers.
  • Complex analysis: use the reason tool for multi-step explanations, comparisons, or problem-solving tasks.
  • In-depth research: use deep_research when you need thorough investigation, structured reports, and focus areas to tailor the output.

To run the MCP server, configure it in your MCP settings and invoke the tools via your agent or client that supports use_mcp_tool, passing the server_name perplexity and the desired tool_name along with your query and options.

How to install

Prerequisites:

Installation steps:

  1. Clone the repository or obtain the Perplexity MCP server package
  2. Install dependencies (if provided by the repository):
npm install
  1. Ensure you have an API key ready and set it in your environment or in your MCP settings as shown in the examples (PERPLEXITY_API_KEY).

  2. Run or configure the MCP server using the details in the mcp_config example. If you plan to run directly with Node, you might use a command like:

node /path/to/perplexity-server/build/index.js

Prerequisites recap:

  • Node.js environment
  • Perplexity API key
  • Access to the Perplexity MCP server build or package

Additional notes

Notes and tips:

  • API key handling: The PERPLEXITY_API_KEY can be supplied via environment variables, a command-line argument, or a .env file. If your environment does not auto-detect the key, provide it explicitly in the MCP settings as shown in the README examples.
  • NPX usage is recommended for macOS users if you do not want to install locally; it runs the Perplexity MCP server on demand without a global install.
  • If the MCP client cannot parse the API key from the environment, you can pass the key via a --api-key argument or set a project-wide .env file and use --cwd to point to that directory.
  • Ensure network access to Perplexity services for the MCP server to function correctly.
  • You can toggle between models by using force_model in tool arguments if your queries require a specific model behavior or to optimize results.
  • If you upgrade the Perplexity MCP server, verify that the build/index.js path remains valid and that environment variables are still correctly referenced.

Related MCP Servers

Sponsor this space

Reach thousands of developers