Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-perplexity-server

MCP.Pizza Chef: PoliTwit1984

The mcp-perplexity-server is a Model Context Protocol (MCP) server designed to enhance code analysis and debugging workflows by leveraging Perplexity AI's API. It provides intelligent error analysis, pattern detection, and comprehensive solutions with step-by-step fixes and multiple implementation alternatives. The server specializes in Python error handling, including type errors and common coding issues, while promoting best coding practices and error prevention tips. Seamlessly integrated with the Claude desktop client, it enables developers to quickly identify root causes of errors and receive targeted solutions, improving coding efficiency and quality.

Use This MCP server To

Analyze and debug Python code errors intelligently Detect common coding error patterns automatically Provide step-by-step code fix recommendations Offer multiple alternative solutions for code issues Enforce coding best practices and error prevention Integrate with Claude desktop client for seamless workflow

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.

Perplexity Server MCP server

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

mcp-perplexity-server FAQ

How do I integrate mcp-perplexity-server with the Claude desktop client?
The server is designed for seamless integration with the Claude desktop client, requiring minimal configuration to connect via MCP protocol.
Does mcp-perplexity-server support languages other than Python?
Currently, the server specializes in Python error analysis, particularly type errors and common issues, with plans for future language support.
What kind of error analysis does mcp-perplexity-server provide?
It offers intelligent error analysis including root cause identification, pattern detection, and detailed breakdowns of coding errors.
Can mcp-perplexity-server suggest multiple solutions for a single coding error?
Yes, it provides comprehensive solutions with multiple implementation alternatives to choose from.
How does mcp-perplexity-server help with coding best practices?
The server includes coding standards and error prevention tips as part of its solution recommendations to improve code quality.
Is the mcp-perplexity-server limited to local development environments?
No, it can be deployed in various environments as long as it can communicate with Perplexity AI's API and the MCP client.
What are the prerequisites for running mcp-perplexity-server?
You need access to Perplexity AI's API and a compatible MCP client like Claude desktop client to utilize its features.
How does mcp-perplexity-server handle Python type errors specifically?
It provides specialized analysis and targeted fixes for Python type errors, helping developers quickly resolve these common issues.