perplexity-pro-mcp

sergekostenchuk/perplexity-pro-mcp

3.2

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

Operationp50p95p99
Single Search250ms500ms1200ms
Multi-Search (5)400ms800ms1500ms
Deep Research2000ms5000ms8000ms

πŸ” ПолноС описаниС Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΎΠ½Π°Π»Π° (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
  • ΠœΠΎΠ½ΠΈΡ‚ΠΎΡ€ΠΈΠ½Π³ ΠΏΡ€ΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΠΈ: ВстроСнная статистика ΠΈ ΠΌΠ΅Ρ‚Ρ€ΠΈΠΊΠΈ

ΠŸΡ€ΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΡŒ

ΠžΠΏΠ΅Ρ€Π°Ρ†ΠΈΡp50p95p99
ΠžΠ΄ΠΈΠ½ΠΎΡ‡Π½Ρ‹ΠΉ поиск250ms500ms1200ms
ΠœΡƒΠ»ΡŒΡ‚ΠΈ-поиск (5)400ms800ms1500ms
Π“Π»ΡƒΠ±ΠΎΠΊΠΎΠ΅ исслСдованиС2000ms5000ms8000ms

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 examples
  • stats() - Show connection and cache statistics
  • config() - Display current configuration
  • clearCache() - 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

Operationp50 Latencyp95 Latencyp99 Latency
Single Search250ms500ms1200ms
Multi-Search (5)400ms800ms1500ms
Deep Research2000ms5000ms8000ms

Caching Strategy

Content TypeTTLUse Case
Facts7 daysHistorical information, definitions
News1 hourCurrent events, breaking news
Code24 hoursDocumentation, examples
Research3 daysAcademic papers, studies
Recent15 minutesReal-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

  1. "API key is invalid"

  2. "Claude Desktop not found"

    • The installer will provide manual configuration steps
    • Check the config location for your OS
  3. "Connection timeout"

    • Check your internet connection
    • Verify firewall settings allow HTTPS to api.perplexity.ai
  4. "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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see LICENSE file for details

Acknowledgments


Version: 2.0.0
Author: kostenchuksergey
Repository: GitHub