Handles environment variables management, allowing secure storage of the Perplexity API key required for authentication with the Perplexity AI service.
Serves as the runtime environment for the MCP server, requiring Node.js 18+ for operation and providing the foundation for server execution.
Enables direct interaction with Perplexity AI API, providing advanced question answering capabilities through multiple Perplexity models (sonar-reasoning, sonar-pro, sonar-deep-research) with customizable system prompts and support for both direct questions and search queries.
Perplexity Insight MCP Server
An MCP server implementation for interfacing with the Perplexity AI API, providing advanced question answering capabilities through the standardised Model Context Protocol.
Features
Seamless integration with Perplexity AI API
Support for different Perplexity models (sonar-reasoning, sonar-pro, sonar-deep-research)
Customisable system prompts and user queries
Proper error handling and response formatting
Rate limiting protection
Easy integration with Windsurf IDE
Requirements
Node.js 18+
Perplexity API key
Installation
Environment Variables
Create a .env
file with the following variables:
Usage
Run the server:
API Tools
The server exposes the following tools:
perplexity_ask
- Send a direct question to Perplexity AIperplexity_search
- Perform a search query with Perplexity AI
Changing Models
Both tools support the following Perplexity models:
sonar-reasoning
(default) - Perplexity's reasoning-focused model, best for general questionssonar-pro
- Enhanced model with improved capabilities for professional use casessonar-deep-research
- Specialised for in-depth research and complex queries
To specify a model when using the tools, include the model
parameter in your request:
You can also customise the system prompt and maximum token count:
Tool Response Format
The server follows the MCP specification for tool responses:
Windsurf Integration
Setting up in Windsurf
Build the server:
npm run buildOpen Windsurf and navigate to Settings
Find the "AI Settings" or "Model Context Protocol" section
Add a new MCP server with the following details:
Name: Perplexity Insight
Type: Local Process
Command: Path to your Node.js executable
Arguments: Path to your compiled
index.js
fileWorking Directory: Path to your project directory
Environment Variables: Make sure to include
PERPLEXITY_API_KEY=your_api_key_here
Enable the server and restart Windsurf if necessary
Example Configuration
Here's an example configuration for the mcp_config.json
file:
Replace /path/to/perplexity-insight-MCP
with the actual path to your installation directory and use your actual Perplexity API key.
Using Perplexity in Windsurf
Use the AI Assistant panel to ask questions that will be directed to Perplexity
For web searches, include specific terms like "search for" in your queries
To change models, include the model name in your query as shown in the "Changing Models" section
Windsurf will automatically use the appropriate Perplexity tool based on your query
Development
For local development:
Troubleshooting
If you encounter issues with the MCP server:
Check that your API key is valid and properly set in the
.env
fileVerify that the response format matches the MCP specification
Look for any error messages in the server logs
Ensure Windsurf is properly configured to use the MCP server
License
MIT
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.
Interfaces with the Perplexity AI API to provide advanced question answering capabilities through the standardized Model Context Protocol, supporting multiple Perplexity models.
Related MCP Servers
- AsecurityAlicenseAqualityInteracting with Perplexity API.Last updated -183MIT License
- AsecurityFlicenseAqualityThis server provides access to the Perplexity AI API, enabling interaction through chatting, searching, and documentation retrieval within MCP-based systems.
- AsecurityFlicenseAqualityProvides a standardized way to integrate Perplexity AI's features like chat, search, and documentation access into MCP-based systems.Last updated -1
- -securityAlicense-qualityProvides access to Perplexity AI models through two tools: ask\_perplexity for expert programming assistance and chat\_perplexity for maintaining ongoing conversations with context preservation.Last updated -MIT License