MCP (Model Context Protocol) server for Perplexity's API Platform - providing AI assistants with real-time web search, reasoning, and research capabilities through Sonar models and the Search API.
Fork: This is a fork of arjunkmrm/perplexity-search, enhanced with additional tools and self-hosting capabilities based on the official Perplexity MCP Server.
MCP Endpoint: https://mcp.techmavie.digital/perplexity/mcp
Analytics Dashboard: https://mcp.techmavie.digital/perplexity/analytics/dashboard
This fork significantly extends the original arjunkmrm/perplexity-search with the following improvements:
The original fork only had a single search tool. This version now includes 4 tools matching the official Perplexity MCP server:
| Tool | Model | Description |
|---|---|---|
perplexity_ask |
sonar-pro |
General conversational AI with real-time web search |
perplexity_research |
sonar-deep-research |
Deep, comprehensive research for thorough analysis |
perplexity_reason |
sonar-reasoning-pro |
Advanced reasoning and problem-solving |
perplexity_search |
Search API | Direct web search with ranked results and metadata |
- Streamable HTTP Transport - Added
src/http-server.tsfor VPS deployment (original only supported Smithery/stdio) - Docker Support - Complete
Dockerfileanddocker-compose.ymlfor containerized deployment - Nginx Configuration - Ready-to-use reverse proxy config for production deployment
- GitHub Actions - Auto-deployment workflow on push to main branch
- Built-in analytics tracking for all tool calls
- Visual dashboard at
/analytics/dashboardwith:- Total requests and tool call counts
- Tool usage distribution chart
- Hourly request trends (last 24 hours)
- Recent tool calls feed
- Unique client tracking
- Query Parameter:
?apiKey=YOUR_KEY(recommended for MCP clients) - Header:
X-API-Key: YOUR_KEY - Environment Variable:
PERPLEXITY_API_KEY(server default)
strip_thinkingparameter forperplexity_researchandperplexity_reasonto remove<think>...</think>tags and save context tokens- Configurable timeout via
PERPLEXITY_TIMEOUT_MSenvironment variable (default: 5 minutes) - Health check endpoint at
/healthfor monitoring - Proper error handling with detailed error messages
The easiest way to use this MCP server is via the hosted endpoint. No installation required!
For Claude Desktop / Cursor / Windsurf, add to your MCP configuration:
{
"mcpServers": {
"perplexity": {
"transport": "streamable-http",
"url": "https://mcp.techmavie.digital/perplexity/mcp?apiKey=YOUR_PERPLEXITY_API_KEY"
}
}
}Note: Replace
YOUR_PERPLEXITY_API_KEYwith your Perplexity API Key.
npx @modelcontextprotocol/inspector
# Select "Streamable HTTP"
# Enter URL: https://mcp.techmavie.digital/perplexity/mcp?apiKey=YOUR_PERPLEXITY_API_KEY# List all available tools
curl -X POST "https://mcp.techmavie.digital/perplexity/mcp?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
# Call the hello tool
curl -X POST "https://mcp.techmavie.digital/perplexity/mcp?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"perplexity_hello","arguments":{}}}'
# Perform a search
curl -X POST "https://mcp.techmavie.digital/perplexity/mcp?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"perplexity_search","arguments":{"query":"What is MCP?"}}}'
# Ask a question
curl -X POST "https://mcp.techmavie.digital/perplexity/mcp?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"perplexity_ask","arguments":{"messages":[{"role":"user","content":"What is MCP?"}]}}}'
# Perform research
curl -X POST "https://mcp.techmavie.digital/perplexity/mcp?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"perplexity_research","arguments":{"messages":[{"role":"user","content":"What is MCP?"}]}}}'
# Reason and solve a problem
curl -X POST "https://mcp.techmavie.digital/perplexity/mcp?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"perplexity_reason","arguments":{"messages":[{"role":"user","content":"What is MCP?"}]}}}'- 4 powerful tools matching the official Perplexity MCP server
- Real-time web search, research, and reasoning capabilities
- Built-in analytics dashboard
- Supports user-provided API keys via URL query parameter
General-purpose conversational AI with real-time web search using the sonar-pro model. Great for quick questions and everyday searches.
Parameters:
messages(required): Array of conversation messages withroleandcontent
Deep, comprehensive research using the sonar-deep-research model. Ideal for thorough analysis and detailed reports.
Parameters:
messages(required): Array of conversation messages withroleandcontentstrip_thinking(optional): If true, removes<think>...</think>tags from the response to save context tokens
Advanced reasoning and problem-solving using the sonar-reasoning-pro model. Perfect for complex analytical tasks.
Parameters:
messages(required): Array of conversation messages withroleandcontentstrip_thinking(optional): If true, removes<think>...</think>tags from the response to save context tokens
Direct web search using the Perplexity Search API. Returns ranked search results with titles, URLs, snippets, and metadata.
Parameters:
query(required): Search query stringmax_results(optional): Maximum number of results (1-20, default: 10)country(optional): ISO 3166-1 alpha-2 country code for regional results (e.g., US, GB, MY)
A simple test tool to verify that the MCP server is working correctly.
The server supports three ways to provide a Perplexity API key:
- Query Parameter (recommended):
?apiKey=YOUR_KEY - Header:
X-API-Key: YOUR_KEY - Environment Variable:
PERPLEXITY_API_KEY(server default)
If you prefer to run your own instance, see deploy/DEPLOYMENT.md for detailed VPS deployment instructions with Docker and Nginx.
# Using Docker
docker compose up -d --build
# Or run directly
npm run build:tsc
npm run start:http# Install dependencies
npm install
# Run HTTP server in development mode
npm run dev:http
# Or build and run production version
npm run build:tsc
npm run start:http
# Test health endpoint
curl http://localhost:8080/health├── src/
│ ├── index.ts # Main MCP server entry point (Smithery)
│ └── http-server.ts # Streamable HTTP server for VPS
├── deploy/
│ ├── DEPLOYMENT.md # VPS deployment guide
│ └── nginx-mcp.conf # Nginx reverse proxy config
├── .github/
│ └── workflows/
│ └── deploy-vps.yml # GitHub Actions auto-deploy
├── docker-compose.yml # Docker deployment config
├── Dockerfile # Container build config
├── package.json # Project dependencies
├── tsconfig.json # TypeScript configuration
└── README.md # This file
The response from the perplexity_search tool includes:
content: The search results contentcitations: Array of citations for the information