Get the FREE Ultimate OpenClaw Setup Guide →

mcp -perplexity

MCP server from mkusaka/mcp-server-perplexity

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

How to use

This MCP server integrates Perplexity AI's API to provide advanced search capabilities within the MCP ecosystem. It exposes a tool called perplexity_search that lets MCP clients perform searches using Perplexity models such as sonar-reasoning-pro, sonar-reasoning, sonar-pro, and sonar. You can configure the number of results and select a model to tailor the search experience. The server is designed to be MCP Inspector compatible, enabling you to inspect and validate interactions through the MCP Inspector tool. To use, ensure your environment has a Perplexity API key and that the server is running, then invoke perplexity_search from your MCP client with a query and optional parameters for model and count. |

When running locally, the server exposes a command interface via Node.js and reads configuration from environment variables, notably PERPLEXITY_API_KEY, to authenticate requests to Perplexity AI. The tool will return a structured set of search results with relevant metadata, plus error handling to aid debugging in case of API or network issues.

How to install

Prerequisites:

  • Node.js (recommended LTS) and npm or pnpm
  • Internet access to install dependencies

Installation steps:

  1. Clone the repository or download the package.
  2. Install dependencies:
    • pnpm install
  3. Build the project:
    • pnpm build
  4. Obtain a Perplexity API key:
  5. Configure the environment variable with your API key:
    • export PERPLEXITY_API_KEY=your_api_key_here
  6. Run the server:
    • node dist/index.js
    • or if you made the file executable: ./dist/index.js
  7. Optional: run in development or inspect MCP interactions:
    • pnpm dev
    • pnpm inspect

Additional notes

Notes and tips:

  • The server supports the perplexity_search tool with customizable models and result counts. Default model is sonar, and default count is 5 (range 1-10).
  • Logs are written to perplexity-mcp.log at the project root for troubleshooting.
  • Ensure the PERPLEXITY_API_KEY environment variable is set before starting the server to avoid authentication errors.
  • The server is MCP Inspector compatible, allowing you to verify MCP protocol interactions during development.
  • Supported models list: sonar-reasoning-pro, sonar-reasoning, sonar-pro, sonar.
  • If you switch between development and production builds, make sure the dist/index.js path reflects the built output.

Related MCP Servers

Sponsor this space

Reach thousands of developers