Perplexity Search MCP Server
March 19, 2025 ยท View on GitHub
A Model Context Protocol (MCP) server that provides web search capabilities using the Perplexity API.
Features
- Search the web using Perplexity's powerful search API
- Filter search results by recency (month, week, day, hour)
- Seamless integration with MCP-compatible AI assistants
Prerequisites
- Node.js (v14 or higher)
- A Perplexity API key (get one from Perplexity AI)
Installation
-
Clone this repository:
git clone https://github.com/Viktor-berg5061/perplexity-serch-v2.git cd perplexity-serch-v2 -
Install dependencies:
npm install -
Set up your Perplexity API key:
Create a
.envfile in the root directory with the following content:PERPLEXITY_API_KEY=your_api_key_hereOr set it as an environment variable:
export PERPLEXITY_API_KEY=your_api_key_here
Usage
Start the MCP server:
npm start
Or run it directly:
node index.js
Integration with MCP Settings
To use this server with an MCP-compatible AI assistant, add it to your MCP settings configuration:
{
"mcpServers": {
"perplexity-search-v2": {
"command": "node",
"args": ["path/to/perplexity-serch-v2/index.js"],
"env": {
"PERPLEXITY_API_KEY": "your_api_key_here"
},
"disabled": false,
"autoApprove": []
}
}
}
Available Tools
search
Search the web using the Perplexity API.
Parameters:
query(required): The search query stringsearch_recency_filter(optional): Filter search results by recency (options: month, week, day, hour)
License
MIT