perplexity
Complete MCP server for integrating Perplexity's Sonar API with Claude Code - enables web search, academic research, and document analysis with full privacy protection
claude mcp add --transport stdio promptadvisers-perplexity-mcp-server $(pwd)/scripts/run_mcp_silent.sh
How to use
Perplexity MCP Server for Claude Code integrates Perplexity's Sonar web search and scholarly capabilities directly into Claude Code sessions. With this server you can perform real-time web searches, search academic papers, analyze images from URLs or base64 data, and analyze PDF documents. You can also filter search results by including or excluding specific domains and tune the amount of context used for searches to balance depth with efficiency. In Claude Code, enable the Perplexity MCP server and use commands like the perplexity search_web tool to perform web-wide queries, or specialized tools for academic literature and image/PDF analysis. The setup is designed to work seamlessly via the provided mcp_config.json configuration and the small wrapper script, giving Claude Code access to Perplexity’s capabilities without leaving your workflow.
How to install
Prerequisites:
- Claude Code installed and accessible
- Python 3.8 or higher
- A Perplexity API key
- A terminal/command line
Installation steps:
- Clone the repository and navigate into it
git clone https://github.com/YOUR_USERNAME/perplexity-mcp-server.git
cd perplexity-mcp-server
- Set up a Python virtual environment and install dependencies
python3 -m venv mcp_venv
source mcp_venv/bin/activate # on macOS/Linux
# or: mcp_venv\Scripts\activate # on Windows (PowerShell)
pip install -r requirements.txt
- Configure your API key
cp config/.env.example .env
# edit .env to set PERPLEXITY_API_KEY=your_actual_api_key
- Ensure scripts are executable (Linux/macOS)
chmod +x scripts/run_mcp_silent.sh
chmod +x src/perplexity_fastmcp.py
- Create the Claude MCP configuration (example)
mkdir -p ~/.claude
cat > ~/.claude/mcp_config.json << EOF
{
"mcpServers": {
"perplexity": {
"command": "$(pwd)/scripts/run_mcp_silent.sh",
"args": [],
"env": {}
}
}
}
EOF
- Start testing locally
python src/perplexity_mcp_server.py
Then integrate with Claude Code using the mcp_config.json you created.
Additional notes
Tips and notes:
- Ensure your PERPLEXITY_API_KEY is correctly set in the .env file used by the server.
- The wrapper script (run_mcp_silent.sh) is the entry point for Claude Code integration; keep it executable and in the expected path.
- If you update the repository, re-check the path in ~/.claude/mcp_config.json to point to the current script location.
- You can filter searches by domain inclusion/exclusion when configuring the MCP server; consult the server code to adjust defaults.
- If Claude Code doesn’t see the MCP server, verify that the mcp_config.json path is correctly referenced in Claude Code and that the server process is running.
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