Perplexity MCP Server

Perplexity MCP Server

Enables intelligent code analysis and debugging through the Perplexity AI's API, offering detailed error analysis, pattern detection, and comprehensive solutions, with integration support for the Claude desktop client.

PoliTwit1984

Developer Tools
Visit Server

Tools

search

Search Perplexity for coding help

README

Perplexity MCP Server

A Model Context Protocol (MCP) server that provides intelligent code analysis and debugging capabilities using Perplexity AI's API. Works seamlessly with the Claude desktop client.

<a href="https://glama.ai/mcp/servers/oxchzx8c75"><img width="380" height="200" src="https://glama.ai/mcp/servers/oxchzx8c75/badge" alt="Perplexity Server MCP server" /></a>

Features

  • Intelligent Error Analysis: Detailed breakdown of coding errors with root cause analysis
  • Pattern Detection: Automatically recognizes common error patterns and provides targeted solutions
  • Comprehensive Solutions: Step-by-step fixes with multiple implementation alternatives
  • Best Practices: Includes coding standards and error prevention tips
  • Python Support: Specialized handling of Python type errors and common coding issues

Example Usage

Ask questions like:

  • "Fix this TypeError in my Python code"
  • "What's causing this error message?"
  • "How do I fix this code?"

Include your code snippet for targeted analysis:

def calculate_total(items):
    total = 0
    for item in items:
        total = total + item['price']  # TypeError: string + int

data = [
    {'name': 'Book', 'price': '10'},
    {'name': 'Pen', 'price': '2'}
]

result = calculate_total(data)

The server will provide:

  1. Root cause analysis of the error
  2. Step-by-step solution with code examples
  3. Best practices to prevent similar issues
  4. Alternative implementation approaches

Installation

Prerequisites

  • Node.js 18 or higher
  • A Perplexity AI API key

Option 1: Install from npm (Recommended)

# Using npm
npm install -g perplexity-mcp

# Or using the repository directly
npm install -g git+https://github.com/yourusername/perplexity-mcp.git

Option 2: Install from Source

  1. Clone the repository:
git clone https://github.com/yourusername/perplexity-server.git
cd perplexity-server
  1. Install dependencies:
npm install
  1. Build and install globally:
npm run build
npm install -g .

Configure Claude Desktop

Add to your Claude desktop configuration file:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "perplexity": {
      "command": "perplexity-mcp",
      "args": [],
      "env": {
        "PERPLEXITY_API_KEY": "your-api-key-here"
      }
    }
  }
}

Or if installed from source:

{
  "mcpServers": {
    "perplexity": {
      "command": "node",
      "args": ["/absolute/path/to/perplexity-server/build/index.js"],
      "env": {
        "PERPLEXITY_API_KEY": "your-api-key-here"
      }
    }
  }
}

Security

  • The API key is stored securely in Claude's desktop configuration file
  • The key is passed to the server as an environment variable
  • No sensitive data is stored in the repository
  • The server expects the API key to be provided by Claude's environment

Development

Project Structure

perplexity-server/
├── src/
│   └── index.ts      # Main server implementation
├── package.json      # Project configuration
└── tsconfig.json    # TypeScript configuration

Available Scripts

  • npm run build: Build the project
  • npm run watch: Watch for changes and rebuild automatically
  • npm run prepare: Prepare the package for publishing
  • npm run inspector: Run the MCP inspector for debugging

Contributing

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

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python