MCP Perplexity Search
This server enables AI-powered chat completions using the Perplexity API with various models including Sonar and LLaMA variants. You can:
Utilize predefined prompt templates for technical documentation, security analysis, code review, and API documentation
Create custom templates with specific system messages and output formats
Output responses in multiple formats (text, markdown, or JSON)
Include source URLs for verification
Configure parameters like temperature and max tokens
Provide conversation history via message objects
Integrate through the Model Context Protocol (MCP)
Integrates with Perplexity's AI API to provide advanced chat completion capabilities with specialized prompt templates for various use cases like technical documentation generation, security analysis, code review, and API documentation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Perplexity Searchreview this Python function for security best practices"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Related MCP server: DocGen MCP Server
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 examplessecurity_practices: Security implementation guidelinescode_review: Code analysis and improvementsapi_docs: API documentation in JSON format
custom_template(object, optional): Custom prompt template with:system(string): System message for assistant behaviourformat(string): Output format preferenceinclude_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
Clone the repository
Install dependencies:
pnpm installBuild the project:
pnpm buildRun in development mode:
pnpm devPublishing
The project uses changesets for version management. To publish:
Create a changeset:
pnpm changesetVersion the package:
pnpm changeset versionPublish to npm:
pnpm releaseContributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see the LICENSE file for details.
Acknowledgments
Built on the Model Context Protocol
Powered by Perplexity SONAR
Available Tools
1 toolchat_completionC
Generate chat completions using the Perplexity API
| Name | Required | Description | Default |
|---|---|---|---|
| messages | Yes | ||
| prompt_template | No | Predefined prompt template to use for common use cases. Available templates: - technical_docs: Technical documentation with code examples and source references - security_practices: Security best practices and implementation guidelines with references - code_review: Code analysis focusing on best practices and improvements - api_docs: API documentation in structured JSON format with examples | |
| custom_template | No | Custom prompt template. If provided, overrides prompt_template. | |
| format | No | Response format. Use json for structured data, markdown for formatted text with code blocks. Overrides template format if provided. | text |
| include_sources | No | Include source URLs in the response. Overrides template setting if provided. | |
| model | No | Model to use for completion. Note: llama-3.1 models will be deprecated after 2/22/2025 | sonar |
| temperature | No | Controls randomness in the output. Higher values (e.g. 0.8) make the output more random, while lower values (e.g. 0.2) make it more focused and deterministic. | |
| max_tokens | No | The maximum number of tokens to generate in the response. One token is roughly 4 characters for English text. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure but only states the basic function. It doesn't mention rate limits, authentication requirements, cost implications, error handling, or response characteristics. For a complex API tool with 8 parameters, this is inadequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero wasted words. It's appropriately sized and gets straight to the point without unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a complex chat completion tool with 8 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what a 'chat completion' entails, typical use cases, or what the response looks like. The agent must rely entirely on the schema for operational details.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 88% schema description coverage, the schema already documents most parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema, so it meets the baseline for high coverage but doesn't provide additional semantic context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('generate chat completions') and target ('using the Perplexity API'), providing a specific verb+resource combination. However, with no sibling tools mentioned, it cannot demonstrate differentiation from alternatives, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, prerequisites, or typical use cases. It simply states what the tool does without context about appropriate scenarios or limitations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- First observed
chat_completion
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool's purpose is clearly defined as generating chat completions using the Perplexity API, leaving no room for misselection.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'chat_completion' follows a clear verb_noun pattern, and there are no other tools to compare or create inconsistencies with.
A single tool is generally too few for a server's purpose, as it limits functionality and may indicate an incomplete or overly narrow scope. While it could be appropriate for a very simple service, it often feels thin and lacks the breadth needed for typical agent workflows.
The tool provides a core function for chat completions, but with only one tool, the surface is notably incomplete. There are obvious gaps, such as missing operations for managing conversations, handling different models, or supporting related search functionalities, which could hinder agent performance in broader tasks.
Maintenance
Related MCP Connectors
Provide your AI coding tools with token-efficient access to up-to-date technical documentation forβ¦
@latest documentation and code examples to 9000+ libraries for LLMs and AI code editors in a singlβ¦
Discover, compare, and monitor 1,400+ APIs directly from your AI coding agent.
Versioned documentation registry and semantic search for AI tools and coding assistants.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables 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.180313MIT
- -licenseBqualityNot gradedmaintenanceAutomates the creation of standardized documentation by extracting information from source files and applying templates, with integration capabilities for GitHub, Google Drive, and Perplexity AI.33-
- -licenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to generate professional documentation using structured templates based on the POWER framework. Provides access to standardized templates for README, architecture, API, components, and schema documentation.-
- AlicenseNot gradedqualityDmaintenanceProvides LLMs with up-to-date, version-specific documentation and code examples from library sources directly into prompts, eliminating outdated code generation and hallucinated APIs.807,538MIT