Install
mcp-registry/mcp-server-perplexity
mcp-server-perplexity logo

mcp-server-perplexity

Author: tanigami

Description: Python-based MCP (Model Context Protocol) server that exposes Perplexity AI’s chat-completion API as an MCP tool (ask_perplexity).

Stars: 76

Forks: 30

License: MIT License

Category: Specialized

Overview

Installation

1. Prerequisites
• Python 3.9+
• git
2. Clone the repository
git clone https://github.com/tanigami/mcp-server-perplexity.git cd mcp-server-perplexity
3. Create and activate a virtual environment (recommended)
python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate
4. Install Python dependencies
pip install -r requirements.txt
5. Configure credentials
The server needs a Perplexity API token (and optionally an OpenAI key if the tool chains to OpenAI):
export PERPLEXITY_API_KEY="<your-perplexity-key>" # optional export OPENAI_API_KEY="<openai-key>"
You can alternatively copy `.env.example` to `.env` and edit the values.
6. Run the MCP server locally
python -m mcp_server_perplexity --host 0.0.0.0 --port 8000
7. Verify
Open http://localhost:8000/health or use `curl`:
curl http://localhost:8000/health
You should receive `{ "status": "ok" }`.
8. Docker (optional)
docker build -t mcp-perplexity . docker run -d -p 8000:8000 -e PERPLEXITY_API_KEY=<key> mcp-perplexity

01

ask_perplexity

Request chat completion with citations from Perplexity

License: MIT License
Updated 7/30/2025