Get the FREE Ultimate OpenClaw Setup Guide →

perplexity

This Model Context Protocol (MCP) server enables LLMs like Claude to perform internet research using the Perplexity API. It provides real-time, up-to-date information with source citations.

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

How to use

The Perplexity MCP Server exposes six functions to perform web, academic, financial, and filtered searches, with built-in result caching. The four search functions—perplexity_search, perplexity_academic_search, perplexity_financial_search, and perplexity_filtered_search—return search results and automatically include the source URLs. They also save results locally when caching is enabled, allowing you to reference prior queries via unique IDs. The two cache-management functions—list_previous and get_previous_result—let you browse and retrieve previously cached results by their IDs. To use, run the MCP server in its native mode and issue function calls through your MCP client or CLI, specifying the appropriate function name and parameters as shown in the documentation examples. The server supports per-query model selection, domain filters, date ranges, and options to include images or related questions, giving you fine-grained control over search behavior and results. When caching is enabled, responses will include a 10-character result ID that ties together the saved content and metadata for reuse in later conversations with an LLM or an external client.

How to install

Prerequisites:\n- Go 1.23 or later installed on your system\n- A compatible environment for running the MCP server (Linux/macOS; Windows may require WSL or equivalent)\n\nInstallation steps:\n1) Clone the repository to your local machine:\nbash\ngit clone https://github.com/your-org/gomcpgo-perplexity-mcp-server.git\ncd gomcpgo-perplexity-mcp-server\n\n2) Install any build dependencies if required (Go toolchain is typically sufficient):\nbash\ngo version\n, ensure you have a Go toolchain installed.\n3) Build the server binary:\nbash\n./run.sh build\n or, if you prefer a direct build:\nbash\ngo build -o perplexity ./cmd/perplexity\n\n4) Prepare the environment (example):\nbash\nexport PERPLEXITY_API_KEY="your-api-key"\n\n5) Run in MCP mode:\nbash\n./run.sh run\n# or directly: ./perplexity\n\n6) Verify the server is listening and ready to accept MCP calls. You should see startup logs indicating MCP mode is active.

Additional notes

Environment variables and configuration options:\n- PERPLEXITY_API_KEY is required to authenticate with Perplexity API.\n- Optional settings exist for PERPLEXITY_DEFAULT_MODEL, PERPLEXITY_MAX_TOKENS, PERPLEXITY_TEMPERATURE, PERPLEXITY_TOP_P, PERPLEXITY_TOP_K, PERPLEXITY_TIMEOUT, PERPLEXITY_RETURN_IMAGES, PERPLEXITY_RETURN_RELATED, and PERPLEXITY_RESULTS_ROOT_FOLDER.\n- When PERPLEXITY_RESULTS_ROOT_FOLDER is set, the server caches results under unique IDs (10-character IDs) and saves content metadata, enabling quick reuse in future sessions.\n- The API supports various search parameters such as model choice, domain filters, content types, language, country, and date ranges.\nCommon issues: ensure your API key is valid and has the necessary permissions, verify that the server binary has execute permissions (chmod +x perplexity), and confirm that the environment is able to reach the Perplexity API endpoints (network access, firewall rules).

Related MCP Servers

Sponsor this space

Reach thousands of developers