Perplexity MCP Server
Servidor MCP de Perplexity
Descripción general
El servidor MCP de Perplexity es una implementación en Node.js del Protocolo de Contexto de Modelo (MCP) de Anthropic que permite a Claude interactuar con los modelos de lenguaje de Perplexity. Este servidor proporciona un puente seguro entre Claude y las capacidades de Perplexity AI, lo que permite interacciones mejoradas con la IA mediante el uso de herramientas.
Related MCP server: Perplexity MCP Server
Herramientas disponibles
El servidor actualmente implementa dos herramientas principales:
1. perplejidad_chat
Herramienta avanzada para completar chats con soporte para historial completo de mensajes.
{
"name": "perplexity_chat",
"description": "Generate a chat completion using Perplexity AI",
"parameters": {
"model": "string (optional) - One of: llama-3.1-sonar-small-128k-online, llama-3.1-sonar-large-128k-online, llama-3.1-sonar-huge-128k-online",
"messages": "array of {role, content} objects - The conversation history",
"temperature": "number (optional) - Sampling temperature between 0-2"
}
}2. perplejidad_pregunta
Interfaz de consulta única simplificada para preguntas rápidas.
{
"name": "perplexity_ask",
"description": "Send a simple query to Perplexity AI",
"parameters": {
"query": "string - The question or prompt to send",
"model": "string (optional) - One of: llama-3.1-sonar-small-128k-online, llama-3.1-sonar-large-128k-online, llama-3.1-sonar-huge-128k-online"
}
}Instalación
Clonar el repositorio:
git clone https://github.com/yourusername/perplexity-mcp-server.git cd perplexity-mcp-serverInstalar dependencias:
npm installCrear archivo
.env:PERPLEXITY_API_KEY=your-api-key-hereConstruir el proyecto:
npm run build
Configuración del escritorio de Claude
Para agregar este servidor a Claude Desktop, actualice su claude_desktop_config.json :
{
"mcpServers": {
//more servers...
"perplexity": {
"command": "node",
"args": ["path\\to\\perplexity-mcp-server\\dist\\index.js"],
"env": {
"PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY"
}
}
//more servers...
}
}El archivo de configuración normalmente se encuentra en:
Ventanas:
%APPDATA%/Claude/config/claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/config/claude_desktop_config.jsonLinux:
~/.config/Claude/config/claude_desktop_config.json
Desarrollo
Inicie el servidor de desarrollo con recompilación automática:
npm run devEl servidor utiliza TypeScript e implementa el protocolo MCP utilizando el paquete @modelcontextprotocol/sdk .
Arquitectura
Componentes principales
Clase PerplexityServer
Implementa el protocolo de servidor MCP
Maneja el registro y ejecución de herramientas.
Gestiona el manejo de errores y el ciclo de vida del servidor.
Sistema de herramientas
Definiciones de herramientas modulares
Manipuladores de herramientas con seguridad de tipos
Validación de entrada estructurada
Detalles técnicos
Creado con TypeScript para seguridad de tipos
Utiliza
@modelcontextprotocol/sdkpara la implementación de MCPSe comunica a través del transporte stdio
Configuración basada en el entorno
Manejo de errores
El servidor implementa un manejo integral de errores:
Informe de errores de API
Manejo de solicitudes de herramientas no válidas
Gestión de errores de conexión
Manejo de señales de proceso
Dependencias
@modelcontextprotocol/sdk: ^1.0.3dotenv: ^16.4.7isomorphic-fetch: ^3.0.0
Contribuyendo
Bifurcar el repositorio
Crea tu rama de funciones (
git checkout -b feature/amazing-feature)Confirme sus cambios (
git commit -m 'Add some amazing feature')Empujar a la rama (
git push origin feature/amazing-feature)Abrir una solicitud de extracción
Seguridad
Las claves API se gestionan a través de variables de entorno
Validación de entrada para todos los parámetros de la herramienta
Los mensajes de error se desinfectan antes de su salida.
Aislamiento de procesos mediante el protocolo MCP
Licencia
Este proyecto está licenciado bajo la licencia ISC.
Solución de problemas
Problemas comunes y soluciones:
Servidor no encontrado
Verifique que la ruta en
claude_desktop_config.jsonsea correctaAsegúrese de que el servidor esté compilado (
npm run build)Comprueba si Node.js está en tu PATH
Errores de autenticación
Verifique su clave API de Perplexity en .env
Compruebe si la clave API tiene los permisos necesarios
Errores de ejecución de herramientas
Verifique que los parámetros de la herramienta coincidan con el esquema
Comprobar la conectividad de la red
Revise los registros del servidor para ver mensajes de error detallados
Available Tools
2 toolsperplexity_askB
Send a simple query to Perplexity AI
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | The model to use for completion | |
| query | Yes | The question or prompt to send |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations and a minimal description, the tool's behavior is opaque. It does not disclose whether the query is synchronous, what response format to expect, or any safety/reliability traits.
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 clear sentence that immediately conveys the tool's purpose. It is appropriately front-loaded and concise, though it could incorporate more detail without becoming wordy.
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 simple query tool with no output schema, the description lacks information about the response (e.g., text output, confidence scores). The agent would need to infer or discover the return type from usage.
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 both parameters have descriptions. The description adds no extra value beyond the schema, but baseline 3 is appropriate as the schema already documents parameters adequately.
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 ('Send a simple query') and the target resource ('Perplexity AI'). It distinguishes from the sibling tool 'perplexity_chat' by implying this is for a single query, while 'chat' likely involves multi-turn conversation.
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?
No guidance is provided on when to use this tool versus the sibling 'perplexity_chat'. There is no mention of prerequisites, limitations, or alternatives, leaving the agent to infer usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
perplexity_chatC
Generate a chat completion using Perplexity AI
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | The model to use for completion | |
| messages | Yes | Array of messages in the conversation | |
| temperature | No | Sampling temperature (0-2) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No behavioral traits are disclosed beyond the minimal description. The schema includes a model with 'sonar-small-online' suggesting internet access, but this is not mentioned. With no annotations, the description should provide more context about side effects, permissions, or rate limits.
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 sentence, which is concise, but it is too brief to convey necessary information. It could be expanded without losing conciseness.
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?
Given the tool has 3 parameters and a sibling tool, the description is insufficient. It does not explain the role of Perplexity AI, the meaning of different models, or how this tool differs from 'perplexity_ask'. The lack of output schema increases the need for a more complete description.
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 description coverage is 100%, so all parameters are documented in the schema. The description adds no additional meaning beyond what is already in the schema. Baseline score of 3 is appropriate.
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 tool's purpose: generating a chat completion using Perplexity AI. However, it does not differentiate from the sibling tool 'perplexity_ask', which likely performs a similar but distinct function.
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 the sibling tool 'perplexity_ask'. The context hints at a distinction (chat vs. ask), but it is not explicitly stated.
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.
2 tool updates
v1.0.1- First observed
perplexity_ask - First observed
perplexity_chat
TDQS
Scored across 2 tools
Both tools involve querying Perplexity AI, with only subtle differences in description ('simple query' vs 'chat completion'). An agent would likely struggle to decide which to use, as the boundaries are unclear.
Both tools follow a consistent 'perplexity_<verb>' pattern. The verbs 'ask' and 'chat' are different but semantically related, and no mixing of naming conventions is present.
With only 2 tools, the server feels minimal for a service like Perplexity AI, which typically offers more nuanced capabilities (e.g., different models, streaming). However, it covers basic query and chat needs.
The tool surface covers basic query and chat interactions but lacks operations such as specifying model parameters, context handling, or result streaming. This may limit agent flexibility.
Maintenance
Related MCP Connectors
Persistent context for Claude. Your AI always knows your projects and next actions across sessions.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Agent personas for Claude. 16 tools, 13 personas, 3 workflows. Zero extra API cost. Free.
Create projects, nodes, and tasks in UluP Spaces by conversation with Claude.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Node.js/TypeScript implementation of a Model Context Protocol server for the Deepseek R1 language model, optimized for reasoning tasks with a large context window and fully integrated with Claude Desktop.169MIT
- AlicenseNot gradedqualityFmaintenanceA custom Model Context Protocol implementation that integrates Perplexity AI with Claude Desktop, allowing users to access Perplexity's AI models for both single questions and multi-turn conversations.35 npm15ISC
- FlicenseNot gradedqualityDmaintenanceInterfaces with the Perplexity AI API to provide advanced question answering capabilities through the standardized Model Context Protocol, supporting multiple Perplexity models.-
- AlicenseBqualityDmaintenanceA Node.js implementation of the Kagi Model Context Protocol server that enables Claude AI to search the web and summarize documents, videos, and audio using Kagi's APIs.218 npmMIT