sergekostenchuk/perplexity-pro-mcp
If you are the rightful owner of perplexity-pro-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Perplexity Pro MCP is a high-performance server designed for seamless integration with the Perplexity API, offering multi-threading support for efficient data processing.
Perplexity Pro MCP
High-performance MCP (Model Context Protocol) server for Perplexity API integration with multi-threading support.
ΠΡΡΠΎΠΊΠΎΠΏΡΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡΠ΅Π»ΡΠ½ΡΠΉ MCP (Model Context Protocol) ΡΠ΅ΡΠ²Π΅Ρ Π΄Π»Ρ ΠΈΠ½ΡΠ΅Π³ΡΠ°ΡΠΈΠΈ Ρ Perplexity API Ρ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠΎΠΉ ΠΌΠ½ΠΎΠ³ΠΎΠΏΠΎΡΠΎΡΠ½ΠΎΡΡΠΈ.
π Complete Functionality Overview (EN)
Core Commands
search(query, options?)
Single query search with configurable options
- Parameters: query (required), model, max_tokens
- Example:
search("What is quantum computing?")
multiSearch(queries[], options?)
Parallel execution of up to 5 searches simultaneously
- Limit: maximum 5 queries
- Progress: real-time progress tracking
- Example:
multiSearch(["AI trends", "Quantum computing", "Climate tech"])
deepResearch(topic, depth?)
Multi-level topic exploration with automatic branching (1-3 levels)
- Depth: 1-3 levels (default: 2)
- Branching: up to 5 subtopics per level
- Auto-analysis: key insights extraction
- Example:
deepResearch("Future of renewable energy", 3)
Specialized Commands
factCheck(statement)
Fact verification with credible sources
- Model: sonar-pro for accuracy
- Output: true/false/partially true + sources
codeSearch(query, language?)
Code examples and documentation search
- Languages: optional programming language specification
- Output: code examples + documentation
recentSearch(query, days?)
Recent information search (default: 7 days)
- Range: 1-30 days
- Focus: news and latest developments
academicSearch(query)
Scientific papers and research search
- Output: academic sources + citations
Performance Features
- HTTP/2 Connection Pooling: Minimal latency with persistent connections
- Smart Caching: Content-aware TTL strategies
- Real-time Progress: Visual feedback for long operations
- Error Handling: Automatic retries with exponential backoff
- Performance Monitoring: Built-in statistics and metrics
Benchmarks
Operation | p50 | p95 | p99 |
---|---|---|---|
Single Search | 250ms | 500ms | 1200ms |
Multi-Search (5) | 400ms | 800ms | 1500ms |
Deep Research | 2000ms | 5000ms | 8000ms |
π ΠΠΎΠ»Π½ΠΎΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΡΡΠ½ΠΊΡΠΈΠΎΠ½Π°Π»Π° (RU)
ΠΡΠ½ΠΎΠ²Π½ΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ
search(query, options?)
ΠΠ°Π·ΠΎΠ²ΡΠΉ ΠΏΠΎΠΈΡΠΊ Ρ ΠΎΠ΄Π½ΠΈΠΌ Π·Π°ΠΏΡΠΎΡΠΎΠΌ
- ΠΠ°ΡΠ°ΠΌΠ΅ΡΡΡ: query (ΠΎΠ±ΡΠ·Π°ΡΠ΅Π»ΡΠ½ΠΎ), model, max_tokens
- ΠΡΠΈΠΌΠ΅Ρ:
search("Π§ΡΠΎ ΡΠ°ΠΊΠΎΠ΅ ΠΊΠ²Π°Π½ΡΠΎΠ²ΡΠ΅ Π²ΡΡΠΈΡΠ»Π΅Π½ΠΈΡ?")
multiSearch(queries[], options?)
ΠΠ°ΡΠ°Π»Π»Π΅Π»ΡΠ½ΡΠΉ ΠΏΠΎΠΈΡΠΊ Π΄ΠΎ 5 Π·Π°ΠΏΡΠΎΡΠΎΠ² ΠΎΠ΄Π½ΠΎΠ²ΡΠ΅ΠΌΠ΅Π½Π½ΠΎ
- ΠΠΈΠΌΠΈΡ: ΠΌΠ°ΠΊΡΠΈΠΌΡΠΌ 5 Π·Π°ΠΏΡΠΎΡΠΎΠ²
- ΠΡΠΎΠ³ΡΠ΅ΡΡ: ΠΎΡΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ Π² ΡΠ΅Π°Π»ΡΠ½ΠΎΠΌ Π²ΡΠ΅ΠΌΠ΅Π½ΠΈ
- ΠΡΠΈΠΌΠ΅Ρ:
multiSearch(["AI ΡΡΠ΅Π½Π΄Ρ", "ΠΠ²Π°Π½ΡΠΎΠ²ΡΠ΅ ΠΊΠΎΠΌΠΏΡΡΡΠ΅ΡΡ", "ΠΠ»ΠΈΠΌΠ°Ρ ΡΠ΅Ρ Π½ΠΎΠ»ΠΎΠ³ΠΈΠΈ"])
deepResearch(topic, depth?)
ΠΠ½ΠΎΠ³ΠΎΡΡΠΎΠ²Π½Π΅Π²ΠΎΠ΅ ΠΈΡΡΠ»Π΅Π΄ΠΎΠ²Π°Π½ΠΈΠ΅ ΡΠ΅ΠΌΡ (1-3 ΡΡΠΎΠ²Π½Ρ Π³Π»ΡΠ±ΠΈΠ½Ρ)
- ΠΠ»ΡΠ±ΠΈΠ½Π°: 1-3 ΡΡΠΎΠ²Π½Ρ (ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ 2)
- ΠΠ΅ΡΠ²Π»Π΅Π½ΠΈΠ΅: Π΄ΠΎ 5 ΠΏΠΎΠ΄ΡΠ΅ΠΌ Π½Π° ΡΡΠΎΠ²Π΅Π½Ρ
- ΠΠ²ΡΠΎΠ°Π½Π°Π»ΠΈΠ·: ΠΈΠ·Π²Π»Π΅ΡΠ΅Π½ΠΈΠ΅ ΠΊΠ»ΡΡΠ΅Π²ΡΡ ΠΈΠ½ΡΠ°ΠΉΡΠΎΠ²
- ΠΡΠΈΠΌΠ΅Ρ:
deepResearch("ΠΡΠ΄ΡΡΠ΅Π΅ Π²ΠΎΠ·ΠΎΠ±Π½ΠΎΠ²Π»ΡΠ΅ΠΌΠΎΠΉ ΡΠ½Π΅ΡΠ³ΠΈΠΈ", 3)
Π‘ΠΏΠ΅ΡΠΈΠ°Π»ΠΈΠ·ΠΈΡΠΎΠ²Π°Π½Π½ΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ
factCheck(statement)
ΠΡΠΎΠ²Π΅ΡΠΊΠ° ΡΠ°ΠΊΡΠΎΠ² Ρ ΠΈΡΡΠΎΡΠ½ΠΈΠΊΠ°ΠΌΠΈ
- ΠΠΎΠ΄Π΅Π»Ρ: sonar-pro Π΄Π»Ρ ΡΠΎΡΠ½ΠΎΡΡΠΈ
- ΠΡΡ ΠΎΠ΄: ΠΏΡΠ°Π²Π΄Π°/Π»ΠΎΠΆΡ/ΡΠ°ΡΡΠΈΡΠ½ΠΎ ΠΏΡΠ°Π²Π΄Π° + ΠΈΡΡΠΎΡΠ½ΠΈΠΊΠΈ
codeSearch(query, language?)
ΠΠΎΠΈΡΠΊ ΠΊΠΎΠ΄Π° ΠΈ Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ
- Π―Π·ΡΠΊΠΈ: ΠΎΠΏΡΠΈΠΎΠ½Π°Π»ΡΠ½ΠΎ ΡΠΊΠ°Π·Π°ΡΡ ΡΠ·ΡΠΊ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ
- Π Π΅Π·ΡΠ»ΡΡΠ°Ρ: ΠΏΡΠΈΠΌΠ΅ΡΡ ΠΊΠΎΠ΄Π° + Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ
recentSearch(query, days?)
ΠΠΎΠΈΡΠΊ ΡΠ²Π΅ΠΆΠ΅ΠΉ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΠΈ (ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ 7 Π΄Π½Π΅ΠΉ)
- ΠΠΈΠ°ΠΏΠ°Π·ΠΎΠ½: 1-30 Π΄Π½Π΅ΠΉ
- Π€ΠΎΠΊΡΡ: Π½ΠΎΠ²ΠΎΡΡΠΈ ΠΈ ΠΏΠΎΡΠ»Π΅Π΄Π½ΠΈΠ΅ ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠΈ
academicSearch(query)
ΠΠΎΠΈΡΠΊ Π½Π°ΡΡΠ½ΡΡ ΡΡΠ°ΡΠ΅ΠΉ ΠΈ ΠΈΡΡΠ»Π΅Π΄ΠΎΠ²Π°Π½ΠΈΠΉ
- Π Π΅Π·ΡΠ»ΡΡΠ°Ρ: Π°ΠΊΠ°Π΄Π΅ΠΌΠΈΡΠ΅ΡΠΊΠΈΠ΅ ΠΈΡΡΠΎΡΠ½ΠΈΠΊΠΈ + ΡΠΈΡΠ°ΡΡ
ΠΡΠΎΠ±Π΅Π½Π½ΠΎΡΡΠΈ ΠΏΡΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡΠ΅Π»ΡΠ½ΠΎΡΡΠΈ
- HTTP/2 Connection Pooling: ΠΠΈΠ½ΠΈΠΌΠ°Π»ΡΠ½Π°Ρ Π·Π°Π΄Π΅ΡΠΆΠΊΠ° ΡΠ΅ΡΠ΅Π· ΠΏΠΎΡΡΠΎΡΠ½Π½ΡΠ΅ ΡΠΎΠ΅Π΄ΠΈΠ½Π΅Π½ΠΈΡ
- Smart Caching: ΠΠΎΠ½ΡΠ΅ΠΊΡΡΠ½ΠΎ-Π·Π°Π²ΠΈΡΠΈΠΌΠΎΠ΅ ΠΊΠ΅ΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Ρ ΡΠ°Π·Π½ΡΠΌΠΈ TTL
- ΠΡΠΎΠ³ΡΠ΅ΡΡ Π² ΡΠ΅Π°Π»ΡΠ½ΠΎΠΌ Π²ΡΠ΅ΠΌΠ΅Π½ΠΈ: ΠΠΈΠ·ΡΠ°Π»ΡΠ½Π°Ρ ΠΎΠ±ΡΠ°ΡΠ½Π°Ρ ΡΠ²ΡΠ·Ρ Π΄Π»Ρ Π΄Π»ΠΈΡΠ΅Π»ΡΠ½ΡΡ ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠΉ
- ΠΠ±ΡΠ°Π±ΠΎΡΠΊΠ° ΠΎΡΠΈΠ±ΠΎΠΊ: ΠΠ²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠ΅ ΠΏΠΎΠ²ΡΠΎΡΡ Ρ ΡΠΊΡΠΏΠΎΠ½Π΅Π½ΡΠΈΠ°Π»ΡΠ½ΡΠΌ backoff
- ΠΠΎΠ½ΠΈΡΠΎΡΠΈΠ½Π³ ΠΏΡΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡΠ΅Π»ΡΠ½ΠΎΡΡΠΈ: ΠΡΡΡΠΎΠ΅Π½Π½Π°Ρ ΡΡΠ°ΡΠΈΡΡΠΈΠΊΠ° ΠΈ ΠΌΠ΅ΡΡΠΈΠΊΠΈ
ΠΡΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡΠ΅Π»ΡΠ½ΠΎΡΡΡ
ΠΠΏΠ΅ΡΠ°ΡΠΈΡ | p50 | p95 | p99 |
---|---|---|---|
ΠΠ΄ΠΈΠ½ΠΎΡΠ½ΡΠΉ ΠΏΠΎΠΈΡΠΊ | 250ms | 500ms | 1200ms |
ΠΡΠ»ΡΡΠΈ-ΠΏΠΎΠΈΡΠΊ (5) | 400ms | 800ms | 1500ms |
ΠΠ»ΡΠ±ΠΎΠΊΠΎΠ΅ ΠΈΡΡΠ»Π΅Π΄ΠΎΠ²Π°Π½ΠΈΠ΅ | 2000ms | 5000ms | 8000ms |
Features (EN)
- β‘ HTTP/2 Connection Pooling - Minimal latency with persistent connections
- π Parallel Search - Execute up to 5 searches simultaneously
- π§ Deep Research - Multi-level exploration with automatic topic branching
- πΎ Smart Caching - Content-aware TTL strategies for optimal performance
- π Real-time Progress - Visual feedback for long-running operations
- π‘οΈ Robust Error Handling - Automatic retries with exponential backoff
- π Performance Monitoring - Built-in statistics and metrics
Installation
Quick Install (Recommended)
npx @mlllm/perplexity-pro-mcp
This will:
- Check Node.js compatibility (requires v20+)
- Prompt for your Perplexity API key
- Test the API connection
- Configure Claude Desktop automatically
- Build and install the MCP server
Manual Install
# Clone the repository
git clone https://github.com/sergekostenchuk/perplexity-pro-mcp.git
cd perplexity-pro-mcp
# Install dependencies
npm install
# Set your API key
export PERPLEXITY_API_KEY=your-api-key-here
# Build the project
npm run build
# Run the installer
npm run install-local
Available Commands
Main Search Commands
search(query, options?)
Perform a single search query.
// In Claude Desktop
search("What are the latest developments in quantum computing?")
// With options
search("Explain transformer architecture", {
model: "pplx-70b-online",
max_tokens: 2000
})
multiSearch(queries[], options?)
Execute multiple searches in parallel (up to 5).
multiSearch([
"Latest AI breakthroughs 2024",
"Quantum computing applications",
"Climate technology innovations"
])
deepResearch(topic, depth?)
Perform comprehensive multi-level research on a topic.
// Basic research (2 levels deep)
deepResearch("Future of renewable energy")
// Exhaustive research (3 levels)
deepResearch("CRISPR gene editing applications", 3)
Specialized Commands
factCheck(statement)
Verify facts and claims with sources.
factCheck("The moon landing happened in 1969")
codeSearch(query, language?)
Search for code examples and documentation.
codeSearch("binary search implementation", "python")
codeSearch("React hooks best practices")
recentSearch(query, days?)
Find information from recent timeframes.
recentSearch("OpenAI announcements", 7)
recentSearch("Stock market news", 1)
academicSearch(query)
Search academic papers and research.
academicSearch("machine learning in healthcare")
Utility Commands
help()
- Display all available commands with examplesstats()
- Show connection and cache statisticsconfig()
- Display current configurationclearCache()
- Clear the response cache
Configuration
Environment Variables
PERPLEXITY_API_KEY=your-api-key-here
Claude Desktop Configuration
The installer automatically adds this configuration:
{
"mcpServers": {
"perplexity-pro": {
"command": "node",
"args": ["/path/to/perplexity-pro-mcp/dist/index.js"],
"env": {
"PERPLEXITY_API_KEY": "your-api-key"
}
}
}
}
API Client Usage
TypeScript/JavaScript
import { PerplexityClient } from '@mlllm/perplexity-pro-mcp';
const client = new PerplexityClient({
apiKey: process.env.PERPLEXITY_API_KEY,
maxConnections: 5,
timeout: 30000,
});
// Simple search
const result = await client.search({
query: 'What is quantum entanglement?',
options: {
model: 'pplx-70b-online',
max_tokens: 1500,
},
});
// Multi-search
const multiResults = await client.multiSearch(
['AI trends', 'Robotics advances', 'Neural interfaces'],
{ model: 'pplx-70b-online' }
);
// Stream responses
const stream = client.streamSearch({
query: 'Explain machine learning',
options: { stream: true }
});
for await (const chunk of stream) {
process.stdout.write(chunk);
}
// Get statistics
console.log(client.getConnectionStats());
Performance
Benchmarks
Operation | p50 Latency | p95 Latency | p99 Latency |
---|---|---|---|
Single Search | 250ms | 500ms | 1200ms |
Multi-Search (5) | 400ms | 800ms | 1500ms |
Deep Research | 2000ms | 5000ms | 8000ms |
Caching Strategy
Content Type | TTL | Use Case |
---|---|---|
Facts | 7 days | Historical information, definitions |
News | 1 hour | Current events, breaking news |
Code | 24 hours | Documentation, examples |
Research | 3 days | Academic papers, studies |
Recent | 15 minutes | Real-time data |
Advanced Features
Progress Tracking
Multi-search operations provide real-time progress updates:
const results = await multiSearch([...queries], {
showProgress: true
});
// Output:
// Processing batch 1
// β Completed: "AI trends" (187ms)
// β Completed: "Robotics" (234ms)
// ...
Connection Pool Monitoring
stats()
// Output:
// Active connections: 2
// Idle connections: 3
// Average response time: 267ms
// Cache hit rate: 67%
Error Handling
The client implements intelligent retry logic:
- Network errors: 3 retries with exponential backoff
- Rate limits (429): Automatic throttling
- Server errors (5xx): Configurable retry attempts
Development
Project Structure
perplexity-pro-mcp/
βββ src/
β βββ index.ts # MCP server entry point
β βββ api/ # HTTP client implementation
β βββ cache/ # Caching strategies
β βββ engines/ # Search engines (multi, deep)
β βββ mcp/ # MCP protocol handlers
β βββ utils/ # Logging and helpers
βββ tests/ # Test suites
βββ scripts/ # Installation scripts
βββ dist/ # Compiled output
Running Tests
# Run all tests
npm test
# Watch mode
npm run test:watch
# Coverage report
npm run test:coverage
Building
# Development build
npm run build
# Production build
npm run build:prod
Troubleshooting
Common Issues
-
"API key is invalid"
- Verify your API key at https://www.perplexity.ai/settings/api
- Ensure no extra spaces in the key
-
"Claude Desktop not found"
- The installer will provide manual configuration steps
- Check the config location for your OS
-
"Connection timeout"
- Check your internet connection
- Verify firewall settings allow HTTPS to api.perplexity.ai
-
"Rate limit exceeded"
- The client automatically handles rate limits
- Reduce parallel requests if persistent
Debug Mode
Enable detailed logging:
export DEBUG=perplexity:*
export NODE_ENV=development
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
MIT License - see LICENSE file for details
Acknowledgments
- Built for Claude Desktop
- Powered by Perplexity AI
- Uses the Model Context Protocol
Version: 2.0.0
Author: kostenchuksergey
Repository: GitHub