Get the FREE Ultimate OpenClaw Setup Guide →

mcp-perplexity-search

🔎 A Model Context Protocol (MCP) server for integrating Perplexity's AI API with LLMs.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio spences10-mcp-perplexity-search npx -y mcp-perplexity-search \
  --env PERPLEXITY_API_KEY="your-perplexity-api-key"

How to use

This MCP server integrates Perplexity's AI capabilities into your workflow by exposing a single MCP tool named chat_completion. It leverages Perplexity's API to generate advanced chat completions with support for predefined templates such as technical documentation generation, security practices analysis, code review, and API documentation in a structured format. Users can select a predefined prompt_template (e.g., technical_docs, security_practices, code_review, api_docs) or supply a custom_template to tailor the assistant's behavior and output format. Output supports multiple formats (text, markdown, json) and can optionally include source URLs. You can adjust model parameters like temperature and max_tokens to control creativity and response length, and choose from Perplexity models such as sonar. This makes it suitable for generating documentation, performing code reviews, extracting API specs, or analyzing security practices within conversations.

How to install

Prerequisites:

  • Node.js and npm/pnpm installed on your system
  • Access to the Perplexity API with an API key
  1. Clone the repository or set up the MCP server in your environment:

  2. Install dependencies (using pnpm as suggested by the project):

pnpm install
  1. Build the project (if a build step is required):
pnpm build
  1. Run the server locally for development (as an MCP service in your MCP client):
pnpm dev
  1. Alternatively, run via npx (as shown in the configuration example):
npx -y mcp-perplexity-search
  1. Ensure your MCP client is configured to launch the server using the provided mcpServers entry (see mcp_config). Provide your Perplexity API key when prompted or via the PERPLEXITY_API_KEY environment variable.

Additional notes

Notes and tips:

  • This project is no longer maintained; functionality has moved to mcp-omnisearch. Consider migrating if you rely on ongoing updates.
  • The server requires a Perplexity API key (PERPLEXITY_API_KEY). Do not expose this key in client-side configurations.
  • You can customize prompts via prompt_template or custom_template to influence system behavior and response formatting.
  • Output formats can be controlled with the format and include_sources options; defaults are text and false for include_sources.
  • If you encounter authentication or API errors, verify the API key and network access to Perplexity services.
  • The npm_package name for this server is mcp-perplexity-search.

Related MCP Servers

Sponsor this space

Reach thousands of developers ↗