Cover image
Try Now
2025-04-05

🔎 A Model Context Protocol (MCP) server for integrating Perplexity's AI API with LLMs.

3 years

Works with Finder

1

Github Watches

3

Github Forks

8

Github Stars

mcp-perplexity-search


⚠️ Notice

This repository is no longer maintained.

The functionality of this tool is now available in mcp-omnisearch, which combines multiple MCP tools in one unified package.

Please use mcp-omnisearch instead.


A Model Context Protocol (MCP) server for integrating Perplexity's AI API with LLMs. This server provides advanced chat completion capabilities with specialized prompt templates for various use cases.

Features

  • 🤖 Advanced chat completion using Perplexity's AI models
  • 📝 Predefined prompt templates for common scenarios:
    • Technical documentation generation
    • Security best practices analysis
    • Code review and improvements
    • API documentation in structured format
  • 🎯 Custom template support for specialized use cases
  • 📊 Multiple output formats (text, markdown, JSON)
  • 🔍 Optional source URL inclusion in responses
  • ⚙️ Configurable model parameters (temperature, max tokens)
  • 🚀 Support for various Perplexity models including Sonar and LLaMA

Configuration

This server requires configuration through your MCP client. Here are examples for different environments:

Cline Configuration

Add this to your Cline MCP settings:

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

Claude Desktop with WSL Configuration

For WSL environments, add this to your Claude Desktop configuration:

{
	"mcpServers": {
		"mcp-perplexity-search": {
			"command": "wsl.exe",
			"args": [
				"bash",
				"-c",
				"source ~/.nvm/nvm.sh && PERPLEXITY_API_KEY=your-perplexity-api-key /home/username/.nvm/versions/node/v20.12.1/bin/npx mcp-perplexity-search"
			]
		}
	}
}

Environment Variables

The server requires the following environment variable:

  • PERPLEXITY_API_KEY: Your Perplexity API key (required)

API

The server implements a single MCP tool with configurable parameters:

chat_completion

Generate chat completions using the Perplexity API with support for specialized prompt templates.

Parameters:

  • messages (array, required): Array of message objects with:
    • role (string): 'system', 'user', or 'assistant'
    • content (string): The message content
  • prompt_template (string, optional): Predefined template to use:
    • technical_docs: Technical documentation with code examples
    • security_practices: Security implementation guidelines
    • code_review: Code analysis and improvements
    • api_docs: API documentation in JSON format
  • custom_template (object, optional): Custom prompt template with:
    • system (string): System message for assistant behaviour
    • format (string): Output format preference
    • include_sources (boolean): Whether to include sources
  • format (string, optional): 'text', 'markdown', or 'json' (default: 'text')
  • include_sources (boolean, optional): Include source URLs (default: false)
  • model (string, optional): Perplexity model to use (default: 'sonar')
  • temperature (number, optional): Output randomness (0-1, default: 0.7)
  • max_tokens (number, optional): Maximum response length (default: 1024)

Development

Setup

  1. Clone the repository
  2. Install dependencies:
pnpm install
  1. Build the project:
pnpm build
  1. Run in development mode:
pnpm dev

Publishing

The project uses changesets for version management. To publish:

  1. Create a changeset:
pnpm changeset
  1. Version the package:
pnpm changeset version
  1. Publish to npm:
pnpm release

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see the LICENSE file for details.

Acknowledgments

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Khalid kalib
  • Write professional emails

  • https://tovuti.be
  • Oede knorrepot die vasthoudt an de goeie ouwe tied van 't boerenleven

  • Gil kaminski
  • Make sure you are post-ready before you post on social media

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • momi
  • Provides initial medical assessments and advice.

  • WILLIAM JOEL FOTEPING
  • Friendly music guide for 60s-2000s songs, with links to listen online.

  • huahuayu
  • A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.

  • deemkeen
  • control your mbot2 with a power combo: mqtt+mcp+llm

  • zhaoyunxing92
  • 本项目是一个钉钉MCP(Message Connector Protocol)服务,提供了与钉钉企业应用交互的API接口。项目基于Go语言开发,支持员工信息查询和消息发送等功能。

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • justmywyw
  • Short and sweet example MCP server / client implementation for Tools, Resources and Prompts.

    Reviews

    3 (1)
    Avatar
    user_bNoRc43V
    2025-04-17

    The mcp-perplexity-search by spences10 is a fantastic tool for improving search efficiency. As a loyal user, I'm extremely impressed by how it leverages perplexity to deliver precise search results. It's incredibly easy to integrate and has proven to be indispensable for my daily tasks. Highly recommend checking it out on GitHub: https://github.com/spences10/mcp-perplexity-search.