perplexity-mcp-server
Provides tools to perform fast search-augmented queries and deep multi-source research using the Perplexity API, enabling AI agents to retrieve real-time information and generate detailed reports.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@perplexity-mcp-serverSummarize the latest tech news"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Perplexity MCP Server
Supercharge your AI agents with Perplexity's Search API!
An MCP (Model Context Protocol) server providing comprehensive access to the Perplexity AI API. It enables LLMs and AI agents to perform fast, search-augmented queries and conduct exhaustive, multi-source deep research, all through a standardized, secure, and easy-to-integrate protocol.
Built on the cyanheads/mcp-ts-template, this server follows a modular architecture with robust error handling, logging, and security features.
🚀 Core Capabilities: Perplexity Tools 🛠️
This server equips your AI with specialized tools to leverage Perplexity's unique capabilities:
Tool Name | Description | Key Features |
Performs a fast, search-augmented query using the Perplexity API. Ideal for quick questions and real-time information retrieval. | - Filter by recency ( | |
Conducts an exhaustive, multi-source investigation for complex topics, delivering a detailed report. | - Ideal for in-depth analysis and report generation.- Control research depth and cost with |
Note: For the deep research tool, I recommend allowing a longer timeout (e.g. 180 seconds) through MCP Clients like Cline. Other clients may time out after 60 seconds, which isn't sufficient for deep research.
Related MCP server: MCP Perplexity Pro
Table of Contents
Overview
The Perplexity MCP Server acts as a bridge, allowing applications (MCP Clients) that understand the Model Context Protocol (MCP)—like advanced AI assistants (LLMs), IDE extensions, or custom research tools—to interact directly and efficiently with the Perplexity AI API.
Instead of complex, one-off API integrations, your tools can leverage this server to:
Automate Research: Enable agents to perform quick lookups or deep-dive research programmatically.
Enhance AI Reasoning: Provide LLMs with up-to-date, verifiable information from the web to ground their responses.
Integrate Search into Workflows: Seamlessly add search-augmented generation to any AI-driven task.
Built on the robust mcp-ts-template, this server provides a standardized, secure, and efficient way to expose Perplexity's functionality via the MCP standard.
Developer Note: This repository includes a .clinerules file that serves as a developer cheat sheet for your LLM coding agent with quick reference for the codebase patterns, file locations, and code snippets.
Features
Core Utilities
Leverages the robust utilities provided by the mcp-ts-template:
Logging: Structured, configurable logging with file rotation and optional MCP notifications.
Error Handling: Centralized error processing with standardized
McpErrortypes.Configuration: Environment variable loading (
dotenv) with Zod validation.Input Validation/Sanitization: Uses
zodfor schema validation and a dedicated sanitization utility.Request Context: Operation tracking and correlation via unique request IDs using
AsyncLocalStorage.Type Safety: Strong typing enforced by TypeScript and Zod schemas.
HTTP Transport: High-performance HTTP server using Hono, featuring session management and CORS support.
Authentication: Robust authentication layer supporting JWT and OAuth 2.1.
Perplexity Integration
Dual API Support: Full integration with both the standard Chat Completions API (
perplexity_search) and the more intensive research models (perplexity_deep_research).Advanced Search Control: Fine-grained control over search parameters, including recency, domain filtering, and academic source prioritization.
Cost Tracking: A utility to estimate the cost of API calls based on token usage and model, helping manage expenses.
Resilient API Client: A dedicated service for interacting with the Perplexity API, featuring built-in error handling and request/response logging.
Installation
Prerequisites
npm (comes with Node.js)
A Perplexity API Key - Get one from your Perplexity account settings
Setup
Clone the repository:
git clone https://github.com/cyanheads/perplexity-mcp-server.git cd perplexity-mcp-serverInstall dependencies:
npm installBuild the project:
npm run build
Configuration
Environment Variables
Configure the server by creating a .env file in the project root (you can copy .env.example). These variables can also be set in your MCP client's configuration.
Variable | Description | Default |
| Required. Your API key for Perplexity. |
|
| Transport mechanism: |
|
| Port for the HTTP server (if |
|
| Host address for the HTTP server. |
|
| Logging level ( |
|
| Authentication for HTTP: |
|
| Required for |
|
MCP Client Settings
Add the following to your MCP client's configuration file (e.g., cline_mcp_settings.json):
{
"mcpServers": {
"perplexity-mcp-server": {
"command": "node",
"args": ["/path/to/your/perplexity-mcp-server/dist/index.js"],
"env": {
"PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY_HERE"
}
}
}
}Project Structure
The codebase follows a modular structure within the src/ directory:
src/
├── index.ts # Entry point: Initializes and starts the server
├── config/ # Configuration loading (env vars, package info)
│ └── index.ts
├── mcp-server/ # Core MCP server logic and capability registration
│ ├── server.ts # Server setup, capability registration
│ ├── transports/ # Transport handling (stdio, http)
│ └── tools/ # MCP Tool implementations (subdirs per tool)
├── services/ # External service integrations (Perplexity API client)
├── types-global/ # Shared TypeScript type definitions
└── utils/ # Common utility functions (logger, error handler, etc.)For a detailed file tree, run npm run tree or see docs/tree.md.
Tools
The Perplexity MCP Server provides two primary tools for interacting with the Perplexity API.
Tool Name | Description | Key Arguments |
| Performs a fast, search-augmented query. |
|
| Conducts an exhaustive, multi-source research query. |
|
Note: All tools support comprehensive error handling and return structured JSON responses.
Development
Build and Test
# Build the project (compile TS to JS in dist/)
npm run build
# Clean build artifacts
npm run clean
# Generate a file tree representation for documentation
npm run tree
# Clean build artifacts and then rebuild the project
npm run rebuild
# Start the server using stdio (default)
npm startLicense
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityCmaintenanceAn MCP server integrating Perplexity AI's API to offer advanced search capabilities with support for multiple models and result configuration.Last updated11,2821MIT
- Alicense-qualityDmaintenanceA comprehensive MCP server that provides intelligent access to Perplexity AI's search and reasoning models with automatic model selection, conversation management, and project-aware storage. Supports real-time search, deep research, chat sessions, and async operations for complex queries.Last updated213MIT
- Alicense-qualityFmaintenanceAn MCP server that integrates with Poe's API to provide AI-powered search and research tools from Perplexity, Reka, Exa, and Linkup.Last updated468MIT
- Flicense-qualityBmaintenanceA powerful MCP server that enables AI agents to perform structured, multi-step internet research and generate comprehensive reports automatically.Last updated3
Related MCP Connectors
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
An MCP server that integrates with Discord to provide AI-powered features.
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyanheads/perplexity-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server