Perplexity Advanced MCP
Perplejidad avanzada MCP
Descripción general
Perplexity Advanced MCP es un paquete de integración avanzado que aprovecha las API de OpenRouter y Perplexity para ofrecer capacidades mejoradas de procesamiento de consultas. Con una interfaz de línea de comandos intuitiva y un cliente API robusto, este paquete facilita interacciones fluidas con modelos de IA para consultas simples y complejas.
Related MCP server: Perplexity MCP Server
Comparación con perplejidad-mcp
Si bien perplexity-mcp proporciona una funcionalidad básica de búsqueda web mediante la API de Perplexity AI, Perplexity Advanced MCP ofrece varias funciones adicionales:
Compatibilidad con múltiples proveedores: admite las API de Perplexity y OpenRouter , lo que le brinda flexibilidad para elegir su proveedor.
Optimización del tipo de consulta: distingue entre consultas simples y complejas, optimizando el costo y el rendimiento.
Compatibilidad con archivos adjuntos: permite incluir contenidos de archivos como contexto en sus consultas, lo que permite respuestas más precisas y contextuales.
Lógica de reintento mejorada: implementa mecanismos de reintento robustos para una mayor confiabilidad
En general, este es el MCP más adecuado para manejar bases de código cuando se integra con editores como Cline o Cursor .
Características
Cliente API unificado: admite las API de OpenRouter y Perplexity con modelos configurables para manejar consultas simples y complejas.
Interfaz de línea de comandos (CLI): administre la configuración de la clave API y ejecute el servidor MCP mediante Typer .
Procesamiento avanzado de consultas: incorpora procesamiento de archivos adjuntos, lo que le permite incluir datos contextuales en sus consultas.
Mecanismo de reintento robusto: utiliza Tenacity para la lógica de reintento para garantizar comunicaciones de API consistentes y confiables.
Registro personalizable: configuración de registro flexible para una depuración detallada y monitoreo del tiempo de ejecución.
Configuración óptima de IA
Para obtener la mejor experiencia con los asistentes de IA (por ejemplo, Cursor , Claude for Desktop ), recomiendo agregar la siguiente configuración a las instrucciones de su proyecto o reglas de IA:
<perplexity-advanced-mcp>
<description>
Perplexity is an LLM that can search the internet, gather information, and answer users' queries.
For example, let's suppose we want to find out the latest version of Python.
1. You would search on Google.
2. Then read the top two or three results directly to verify.
Perplexity does that work for you.
To answer a user's query, Perplexity searches, opens the top search results, finds information on those websites, and then provides the answer.
Perplexity can be used with two types of queries: simple and complex. Choosing the right query type to fulfill the user's request is most important.
</description>
<simple-query>
<description>
It's cheap and fast. However, it's not suitable for complex queries. On average, it's more than 10 times cheaper and 3 times faster than complex queries.
Use it for simple questions such as "What is the latest version of Python?"
</description>
<pricing>
$1/M input tokens
$1/M output tokens
</pricing>
</simple-query>
<complex-query>
<description>
It's slower and more expensive. Compared to simple queries, it's on average more than 10 times more expensive and 3 times slower.
Use it for more complex requests like "Analyze the attached code to examine the current status of a specific library and create a migration plan."
</description>
<pricing>
$1/M input tokens
$5/M output tokens
</pricing>
</complex-query>
<instruction>
When reviewing the user's request, if you find anything unexpected, uncertain, or questionable, **and you think you can get answer from the internet**, do not hesitate to use the "ask_perplexity" tool to consult Perplexity. However, if the internet is not required to satisfy users' request, it's meaningless to ask to perplexity.
Since Perplexity is also an LLM, prompt engineering techniques are paramount.
Remember the basics of prompt engineering, such as providing clear instructions, sufficient context, and examples
Include as much context and relevant files as possible to smoothly fulfill the user's request. When adding files as attachments, make sure they are absolute paths.
</instruction>
</perplexity-advanced-mcp>Esta configuración ayuda a los asistentes de IA a comprender mejor cuándo y cómo utilizar la funcionalidad de búsqueda de Perplexity, optimizando tanto el costo como el rendimiento.
Uso
Instalación mediante herrería
Para instalar Perplexity Advanced MCP para Claude Desktop automáticamente a través de Smithery :
npx -y @smithery/cli install @code-yeongyu/perplexity-advanced-mcp --client claudeInicio rápido con uvx
La forma más sencilla de ejecutar el servidor MCP es usando uvx :
uvx perplexity-advanced-mcp -o <openrouter_api_key> # or -p <perplexity_api_key>También puede configurar las claves API mediante variables de entorno:
export OPENROUTER_API_KEY="your_key_here"
# or
export PERPLEXITY_API_KEY="your_key_here"
uvx perplexity-advanced-mcpNota:
Proporcionar claves API de OpenRouter y Perplexity simultáneamente generará un error
Cuando se proporcionan argumentos CLI y variables de entorno, los argumentos CLI tienen prioridad
La CLI está construida con Typer , lo que garantiza una experiencia de línea de comandos fácil de usar.
Herramienta de búsqueda de MCP
El paquete incluye una herramienta de búsqueda MCP integrada mediante la función ask_perplexity . Admite consultas simples y complejas y procesa archivos adjuntos para proporcionar contexto adicional.
Consultas simples: proporciona respuestas rápidas y eficientes.
Consultas complejas: realiza razonamientos detallados y admite archivos adjuntos con formato XML.
Configuración
Claves API: configure
OPENROUTER_API_KEYoPERPLEXITY_API_KEYa través de opciones de línea de comandos o variables de entorno.Selección de modelo: la configuración (en
src/perplexity_advanced_mcp/config.py) asigna tipos de consulta a modelos específicos:Consultas simples:
perplexity/sonarConsultas complejas:
perplexity/sonar-reasoning
Consultas simples:
sonar-proConsultas complejas:
sonar-reasoning-pro
Antecedentes y filosofía del desarrollo
Este proyecto surgió de mi curiosidad y experimentación personal. Siguiendo la reciente tendencia de "codificación vibrante" , más del 95% del código se escribió con Cline + Cursor IDE. Dicen que "hablar es fácil, enséñame el código"; bueno, con la magia de voz a texto de Wispr Flow , ¡literalmente solo hablé y el código apareció! La mayor parte del desarrollo se realizó diciendo cosas como "Escríbeme el código para xyz, corrige el error aquí xy z" y presionando Enter. Sorprendentemente, crear este proyecto completamente funcional me llevó menos de unas horas.
Desde el andamiaje del proyecto hasta la estructura de archivos, todo se escribió y revisó mediante LLM. Incluso el flujo de trabajo de GitHub Actions para la publicación en PyPI y el proceso de aprobación de versiones se gestionaron mediante Cursor. Como desarrolladora, mi función era:
Iniciar y detener el servidor MCP para ayudar a la IA a realizar pruebas adecuadas
Copiar y proporcionar registros de errores cuando ocurrieron problemas
Encontrar y proporcionar documentación y ejemplos del SDK de Python MCP en Internet
Solicitar modificaciones para el código que no parecía correcto
En el mundo actual, donde muchas cosas se pueden automatizar y reemplazar, espero que este MCP ayude a desarrolladores como tú a descubrir valor más allá de escribir código. Espero que esta herramienta te ayude a convertirte en un desarrollador de la nueva era capaz de tomar decisiones y reflexionar sobre temas de mayor nivel.
Desarrollo
Para contribuir o modificar este paquete:
1. Clonar el repositorio:
gh repo clone code-yeongyu/perplexity-advanced-mcp2. Instalar dependencias:
uv sync3. Contribuir:
¡Agradecemos sus contribuciones! Por favor, sigan las pautas de estilo y envío de código existentes.
Licencia
Este proyecto está licenciado bajo la licencia MIT.
Available Tools
1 toolask_perplexityA
Perplexity is fundamentally an LLM that can search the internet, gather information, and answer users' queries.
For example, let's suppose we want to find out the latest version of Python.
1. You would search on Google.
2. Then read the top two or three results directly to verify.
Perplexity does that work for you.
To answer a user's query, Perplexity searches, opens the top search results, finds information on those websites, and then provides the answer.
Perplexity can be used with two types of queries: simple and complex. Choosing the right query type to fulfill the user's request is most important.
SIMPLE Query:
- Cheap and fast (on average, 10x cheaper and 3x faster than complex queries).
- Suitable for straightforward questions such as "What is the latest version of Python?"
- Pricing: $1/M input tokens, $1/M output tokens.
COMPLEX Query:
- Slower and more expensive (on average, 10x more expensive and 3x slower).
- Suitable for tasks requiring multiple steps of reasoning or deep analysis, such as "Analyze the attached code to examine the current status of a specific library and create a migration plan."
- Pricing: $1/M input tokens, $5/M output tokens.
Instructions:
- When reviewing the user's request, if you find anything unexpected, uncertain, or questionable, do not hesitate to use the "ask_perplexity" tool to consult Perplexity.
- Since Perplexity is also an LLM, prompt engineering techniques are paramount.
- Remember the basics of prompt engineering, such as providing clear instructions, sufficient context, and examples.
- Include as much context and relevant files as possible to smoothly fulfill the user's request.
- IMPORTANT: When adding files as attachments, you MUST use absolute paths (e.g., '/absolute/path/to/file.py'). Relative paths will not work.
Note: All queries must be in English for optimal results.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The query to search for | |
| query_type | Yes | Type of query to determine model selection | |
| attachment_paths | Yes | An optional list of absolute file paths to attach as context for the search query |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It explains the search process (searches, opens top results, finds info, provides answer), pricing/speed trade-offs, and prompt engineering requirements. However, it does not explicitly state that the tool is read-only or idempotent, though implied.
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?
Description is overly verbose, including examples and pricing details that could be streamlined. While front-loaded with purpose, it contains redundant elaboration (e.g., step-by-step hypothetical) that increases length without proportional benefit.
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 tool with three required parameters and no output schema, the description is highly comprehensive. It covers all parameter semantics, usage guidelines, behavioral traits, and even prompt engineering tips, making it fully complete for an agent to invoke correctly.
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?
Schema coverage is 100%, so baseline 3. Description adds significant value: explains query_type enum choices with detailed use cases, and mandates absolute paths for attachment_paths. Also notes English-only for query, which is not in schema.
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?
Description clearly states that Perplexity is an LLM that searches the internet to answer queries, with explicit examples (e.g., latest Python version) and differentiation between simple and complex queries. The verb 'ask' plus resource 'perplexity' is specific and unambiguous.
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?
Provides explicit when-to-use guidance: use when uncertain or questionable, and instructions for choosing query type (simple for straightforward, complex for multi-step analysis). Also mandates English queries and absolute paths for attachments, leaving no ambiguity.
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
- First observed
ask_perplexity
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion with other tools. The tool's purpose is clearly defined.
With a single tool, naming consistency is trivially satisfied. The name 'ask_perplexity' follows a clear verb_noun pattern in snake_case.
A single tool is borderline for a server claiming to offer a 'toolkit'. However, the tool is versatile and handles both simple and complex queries, justifying its singular existence.
The domain is to answer user queries by searching the internet. The single tool covers all necessary functionality (simple and complex queries) without obvious gaps.
Maintenance
Related MCP Connectors
Real-time web search, reasoning, and research through Perplexity's API
Enable AI assistants to perform web searches using Perplexity's Sonar Pro.
Provides AI assistants with access to Seltz's powerful Web Search capabilities.
Web search, fetch, extract, and research for AI agents. Markdown output + AI-synthesized answers.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI-powered search, research, and reasoning capabilities through integration with Perplexity.ai, offering three specialized tools: general conversational AI, deep research with citations, and advanced reasoning.24 npm2MIT
- AlicenseAqualityDmaintenanceIntegrates Perplexity AI's chat capabilities with real-time web search, enabling users to ask questions and receive AI-powered answers with up-to-date information and citations from verified web sources.159 npm1Apache 2.0
- AlicenseAqualityDmaintenanceEnables advanced web search across multiple search engines (Brave, DuckDuckGo, Google, Bing, Yandex) with intelligent backend selection, full content extraction, and advanced filtering by time, language, geography, and content type.3MIT
- AlicenseBqualityDmaintenanceEnables web search using Perplexity AI's API, allowing users to search the web with optional recency filters and integration with Claude, Cursor, and other MCP clients.1MIT