realtime-research-connector
A Model Context Protocol (MCP) mechanism connecting to the Sonar API, enabling interactive sessions that harness live, comprehensive web exploration capabilities. Facilitates immediate extraction of up-to-the-minute global data during user dialogue.
Author

perplexityai
Quick Info
Actions
Tags
Perplexity Ask MCP Server Implementation
This repository details an MCP server configuration designed to bridge Claude with the Sonar API, granting the model access to expansive, current internet research functionalities.
For detailed technical guidance on deployment, consult the official DeepWiki reference page.
Architectural Overview
Attribution: DeepWiki, developed utilizing Devin technology
Exposed Capabilities
- perplexity_ask
- Initiate a conversational exchange with the Sonar API to perform dynamic web investigations.
- Required Parameters:
messages(list of objects): A sequence of conversational turns.- Each entry necessitates:
role(string): Designating the speaker (e.g.,system,user,assistant).content(string): The textual payload of the message.
Deployment Guide
Phase 1: Acquisition and Setup
Execute the following sequence to retrieve the source code and install local prerequisites:
bash git clone git@github.com:ppl-ai/modelcontextprotocol.git
Navigate into the specific tool directory and resolve dependencies:
bash cd modelcontextprotocol/perplexity-ask && npm install
Phase 2: Securing Sonar Access Credentials
- Register for access to the Sonar API.
- Complete the required onboarding steps and generate your unique authentication key via the developer portal.
- Establish the key within your execution environment, naming the variable
PERPLEXITY_API_KEY.
Phase 3: Configuration within Claude Desktop
-
Obtain the Claude desktop client from this download link.
-
Integrate the following structure into your
claude_desktop_config.jsonfile:
{ "mcpServers": { "perplexity-ask": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "PERPLEXITY_API_KEY", "mcp/perplexity-ask" ], "env": { "PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE" } } } }
Via NPX Execution Method
Alternatively, using NPX:
{ "mcpServers": { "perplexity-ask": { "command": "npx", "args": [ "-y", "server-perplexity-ask" ], "env": { "PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE" } } } }
Locate the configuration file path:
bash vim ~/Library/Application\ Support/Claude/claude_desktop_config.json
Phase 4: Constructing the Container Image
Use the following command to build the Docker artifact:
bash docker build -t mcp/perplexity-ask:latest -f Dockerfile .
Phase 5: Verification of Functionality
Confirm that the Claude Desktop environment successfully recognizes the two functionalities exposed by your perplexity-ask service by checking for the presence of the wrench/hammer icon:
Upon selection of this icon, the tools provided by the Filesystem MCP Server (and the new one) should appear in the list:
If both toolsets are visible, the integration is confirmed as operational. Claude is now equipped to utilize Perplexity's search capabilities, mimicking standard usage patterns found on the Perplexity web interface.
Phase 6: Fine-tuning Operational Parameters
Currently, the server defaults to standard API search settings. For customization of any underlying search parameter, modifications must be made directly within the source code file named index.ts. Consult the official API documentation for parameter definitions.
Troubleshooting Assistance
While the official Claude documentation offers a comprehensive debugging resource, users encountering issues are invited to seek further assistance by emailing api@perplexity.ai or submitting an inquiry via the bug reporting portal.
Cursor Application Integration
This MCP facility is also compatible with Cursor (and any other application supporting the MCP standard). To integrate Sonar within Cursor, follow these sequential steps.
Step 1: Accessing Cursor Preferences
Step 2: Navigating to the MCP Directory
Initiate the process by clicking on the option labeled Add new global MCP server
Step 3: Importing the Server Configuration
Input the identical configuration structure detailed previously, as this format is universal across all MCP-compatible platforms.
The application should then list the newly integrated service among its selectable utilities, similar to this illustration:
Licensing Statement
This MCP server software is distributed under the terms of the MIT License. This grants users the freedom to employ, alter, and disseminate the code, contingent upon adherence to the stipulated conditions outlined in the LICENSE file within the project's repository.
