perplexity
A Model Context Protocol (MCP) server that provides web search functionality using Perplexity AI's API.
claude mcp add --transport stdio jsonallen-perplexity-mcp uvx perplexity-mcp \ --env PERPLEXITY_MODEL="sonar" \ --env PERPLEXITY_API_KEY="YOUR_PERPLEXITY_API_KEY"
How to use
The perplexity-mcp server exposes a single MCP tool that uses Perplexity AI to perform web searches. It is designed to integrate with the Claude Desktop client (via the MCP) so you can invoke a web search directly from a chat prompt, e.g., asking for the latest information on a topic. The server implements one prompt and one tool: perplexity_search_web. You provide a required query, and you may optionally specify recency (day, week, month, or year) to filter results. The tool returns search results pulled from Perplexity's API, enabling you to verify and reference fresh information within your conversation.
To use it from Claude Desktop or other MCP clients, run the server and configure it in your MCP client’s settings. Then call perplexity_search_web with a string query such as "Search the web for the latest updates on Perplexity" and optionally include recency like {"recency": "week"}. The response will contain the web search results from Perplexity, enabling you to summarize or continue the conversation with current information.
How to install
Prerequisites:
- Python and uv (the UV package manager) installed on your system.
- Perplexity API key available to access Perplexity's search API.
- MCP client (e.g., Claude Desktop) if you want to test from a client, and optionally Smithery for auto-installation.
- Install UV if you don’t have it:
# macOS (Homebrew)
brew install uv
# Linux (curl script via Astral)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
- Install perplexity-mcp via Smithery (optional but recommended):
npx -y @smithery/cli install perplexity-mcp --client claude
- Run the MCP server locally (via uvx as defined in the config):
# If using the mcp_config example, you would start the server via your usual uvx workflow, for example:
uvx perplexity-mcp
- Configure the server in your Claude Desktop or MCP client as shown in the README, ensuring the environment variables are set (API key and model).
Notes:
- Ensure your PERPLEXITY_API_KEY is kept secret and not committed to public repos.
- If you change models, update PERPLEXITY_MODEL accordingly.
Additional notes
Tips and caveats:
- The API key is required to access Perplexity’s web search capabilities; without it, the tool will not return results.
- PERPLEXITY_MODEL is optional; if omitted, the default is sonar. Available models are listed in the README and Perplexity docs.
- When integrating with Claude Desktop, you’ll add the perplexity-mcp tool to your claude_desktop_config.json or Cursor mcp.json as shown in the README.
- If you encounter authentication or rate-limit errors, verify your API key and ensure your subscription level permits web search queries.
- The recency option accepts: day, week, month, year. Default behavior is month if not specified.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP