GitHub - ppl-ai/modelcontextprotocol: A Model Context Protocol Server connector for Perplexity API, to enable web search without leaving the MCP ecosystem.
Extracto
A Model Context Protocol Server connector for Perplexity API, to enable web search without leaving the MCP ecosystem. - ppl-ai/modelcontextprotocol
Resumen
Resumen Principal
El Perplexity Ask MCP Server representa una innovación crucial que integra la API de Sonar con Claude, dotándolo de capacidades de investigación en tiempo real y a escala web sin precedentes. Esta implementación, cuya arquitectura es acreditada a DeepWiki impulsado por Devin Tools, transforma a Claude en un agente conversacional mucho más dinámico e informado, capaz de trascender las limitaciones del conocimiento estático. Al habilitar una interacción directa con búsquedas web en vivo a través de la herramienta perplexity_ask, se facilita el acceso a información actualizada al instante. El proceso de configuración es meticuloso, abarcando desde la clonación de un repositorio y la instalación de dependencias, hasta la vital asignación de la clave API de Sonar y la modificación del archivo de configuración de Claude Desktop. Este enfoque basado en el Model Context Protocol (MCP) establece un marco estandarizado para enriquecer modelos de IA con herramientas externas, impulsando su utilidad en escenarios que demandan datos de última generación.
Elementos Clave
- Integración de la API de Sonar para Investigación en Tiempo Real: El Perplexity Ask MCP Server se distingue por su capacidad para conectar a Claude con la API de Sonar, otorgándole acceso a información web en tiempo real y a gran escala. Esto permite que Claude realice búsquedas en vivo y acceda a los datos más actuales directamente desde la web, superando las limitaciones de los modelos entrenados con conjuntos de datos estáticos y ampliando significativamente su base de conocimiento.
- Configuración Detallada para Claude Desktop y Cursor: El proceso de implementación está exhaustivamente documentado, abarcando desde la clonación del repositorio de GitHub (
ppl-ai/modelcontextprotocol) y la instalación de dependencias (npm install), hasta la crucial configuración de la clave de la API de Sonar y la
Contenido
Perplexity Ask MCP Server
An MCP server implementation that integrates the Sonar API to provide Claude with unparalleled real-time, web-wide research.
Please refer to the official DeepWiki page for assistance with implementation.
High-level System Architecture
Credits: DeepWiki powered by Devin
Tools
- perplexity_ask
- Engage in a conversation with the Sonar API for live web searches.
- Inputs:
messages(array): An array of conversation messages.- Each message must include:
role(string): The role of the message (e.g.,system,user,assistant).content(string): The content of the message.
- Each message must include:
Configuration
Step 1:
Clone this repository:
git clone git@github.com:ppl-ai/modelcontextprotocol.git
Navigate to the perplexity-ask directory and install the necessary dependencies:
cd modelcontextprotocol/perplexity-ask && npm install
Step 2: Get a Sonar API Key
- Sign up for a Sonar API account.
- Follow the account setup instructions and generate your API key from the developer dashboard.
- Set the API key in your environment as
PERPLEXITY_API_KEY.
Step 3: Configure Claude Desktop
-
Download Claude desktop here.
-
Add this to your
claude_desktop_config.json:
{
"mcpServers": {
"perplexity-ask": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PERPLEXITY_API_KEY",
"mcp/perplexity-ask"
],
"env": {
"PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}NPX
{
"mcpServers": {
"perplexity-ask": {
"command": "npx",
"args": [
"-y",
"server-perplexity-ask"
],
"env": {
"PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}You can access the file using:
vim ~/Library/Application\ Support/Claude/claude_desktop_config.json
Step 4: Build the Docker Image
Docker build:
docker build -t mcp/perplexity-ask:latest -f Dockerfile .Step 5: Testing
Let's make sure Claude for Desktop is picking up the two tools we've exposed in our perplexity-ask server. You can do this by looking for the hammer icon:
After clicking on the hammer icon, you should see the tools that come with the Filesystem MCP Server:
If you see both of these this means that the integration is active. Congratulations! This means Claude can now ask Perplexity. You can then simply use it as you would use the Perplexity web app.
Step 6: Advanced parameters
Currently, the search parameters used are the default ones. You can modify any search parameter in the API call directly in the index.ts script. For this, please refer to the official API documentation.
Troubleshooting
The Claude documentation provides an excellent troubleshooting guide you can refer to. However, you can still reach out to us at api@perplexity.ai for any additional support or file a bug.
Cursor integration
You can also use our MCP with Cursor (or any other app that supports this). To use Sonar with Cursor, you can follow the following steps.
Step 1: Navigate to your Cursor settings:
Step 2: Navigate to the MCP directory
And click on Add new global MCP server
Step 3: Insert the MCP Server Configuration from above
This is the same configuration you would use for any other application that supports MCP.
You should then see the application being part of your available tools like this:
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Fuente: GitHub






