Provides search functionality through Perplexity AI's continuously refreshed index with support for web, academic, and SEC search modes, geographic filtering, and customizable result limits
Perplexity Search MCP
This is a tool based on the Model Context Protocol (MCP) that wraps the search functionality of Perplexity AI into a standardized tool that can be called via MCP.
This project is built with TypeScript and runs on the Bun runtime.
✨ Features
Provides the
perplexity_search
tool via MCP.Supports various parameters for Perplexity search, such as:
query
: A single or multiple search queries.max_results
: Specifies the maximum number of results to return.country
: Filters search results by geographic location.search_mode
: Supportsweb
,academic
, andsec
search modes.
Communicates with the host environment via standard input/output (Stdio).
🚀 Getting Started
1. Prerequisites
Ensure you have Bun installed.
You will need an API key from Perplexity AI.
2. Installation
After cloning the project, run the following command in the root directory to install the required dependencies:
3. Configuration
This server requires the PERPLEXITY_API_KEY
environment variable to be set.
4. Running the Server (Development)
To run the server directly from the TypeScript source for development, execute the following command:
The server will start and listen for MCP messages on standard I/O.
5. Building the Project
You can also build the project into a single, optimized JavaScript file.
This command compiles index.ts
and places the output in out/perplexity-search-mcp.js
.
After building, you can run the compiled file directly:
🛠️ Tool Definition
perplexity_search
Description: Get ranked search results from Perplexity’s continuously refreshed index with advanced filtering and customization options.
Input Parameters:
Parameter | Type | Description | Default |
|
or
| The search query or queries to execute. | Required |
|
| The maximum number of search results to return (max 20). |
|
|
| Country code to filter results by geographic location (e.g., 'US', 'GB', 'DE'). | Optional |
|
| Controls the maximum number of tokens retrieved from each webpage. Higher values provide more comprehensive content but may increase processing time. |
|
|
| The search mode. Can be
,
, or
. |
|
Output:
The tool returns a JSON string containing an array of search results from the Perplexity API.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables AI-powered search capabilities through Perplexity AI's continuously refreshed index. Supports web, academic, and SEC search modes with advanced filtering options including geographic location and customizable result limits.