# perplexity-mcp

> MCP Server

This repository provides a Model Context Protocol (MCP) server, enabling web search functionality through Perplexity AI's API for the Anthropic Claude desktop client. It allows users to search the web

## Overview

- **Category:** Search & Knowledge
- **Language:** Python
- **Stars:** 307
- **Forks:** 10
- **Owner:** jsonallen
- **GitHub:** https://github.com/jsonallen/perplexity-mcp
- **Created:** 2024-12-27T01:20:11+00:00
- **Updated:** 2025-03-27T18:27:30+00:00
- **Source:** https://model-context-protocol.com/servers/perplexity-ai-web-search-mcp-server

## Setup

## Setup

1.  **Installing via Smithery:** To install Perplexity MCP for Claude Desktop automatically via [Smithery](https://smithery.ai/server/perplexity-mcp), run `npx -y @smithery/cli install perplexity-mcp --client claude`.
2.  **Requires UV:** Install UV (Fast Python package and project manager) using Homebrew (`brew install uv`) or the provided curl/powershell commands.
3.  **Environment Variables:** Set the `PERPLEXITY_API_KEY` environment variable in your claude_desktop_config.json with your Perplexity AI API key.
4.  **Optional Environment Variables:** Optionally, set the `PERPLEXITY_MODEL` environment variable to specify the Perplexity model to use (defaults to "sonar").
5.  **Cursor & Claude Desktop Installation:** Add the tool as an MCP server by editing the Cursor/Claude config file with the provided JSON configuration, ensuring to replace `XXXXXXXXXXXXXXXXXXXX` with your actual API key.
6.  **Cursor Configuration Location:** On MacOS: `/Users/your-username/.cursor/mcp.json`, On Windows: `C:\Users\your-username\.cursor\mcp.json`.
7.  **Claude Desktop Configuration Location:** On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`, On Windows: `%APPDATA%/Claude/claude_desktop_config.json`.
8.  **Verification:** To verify the server is working, open the Claude client and use a prompt like "search the web for news about openai in the past week".

## Tools

## Available Tools

1.  **perplexity_search_web Prompt:** Search the web using Perplexity AI with a required "query" argument and an optional "recency" argument to filter results by time period.
2.  **perplexity_search_web Tool:** Search the web using Perplexity AI, taking "query" as a required string argument and an optional "recency" parameter to filter results.
