https://github.com/ppl-ai/modelcontextprotocol
A Model Context Protocol Server connector for Perplexity API, to enable web search without leaving the MCP ecosystem.
https://github.com/ppl-ai/modelcontextprotocol
Last synced: 30 days ago
JSON representation
A Model Context Protocol Server connector for Perplexity API, to enable web search without leaving the MCP ecosystem.
- Host: GitHub
- URL: https://github.com/ppl-ai/modelcontextprotocol
- Owner: ppl-ai
- Created: 2025-03-10T19:44:02.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-03-10T20:31:37.000Z (about 1 month ago)
- Last Synced: 2025-03-10T21:22:46.156Z (about 1 month ago)
- Language: JavaScript
- Size: 330 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-mcp-servers - Perplexity - Leverage Perplexity's Sonar API for comprehensive web research in conversational AI (🏢 Enterprise-Supported Implementations / Search & Data Retrieval)
- awesome-mcp-servers - Perplexity - Leverage Perplexity's Sonar API for comprehensive web research in conversational AI (🏢 Enterprise-Supported Implementations / Search & Data Retrieval)
- awesome-mcp-zh - Perplexity
- awesome-rainmana - ppl-ai/modelcontextprotocol - A Model Context Protocol Server connector for Perplexity API, to enable web search without leaving the MCP ecosystem. (JavaScript)
- Awesome-MCP-Servers-directory - Perplexity - An MCP server that connects to Perplexity's Sonar API, enabling real-time web-wide research in conversational AI (Research & Data)
- awesome-mcp-servers - Perplexity - A Model Context Protocol Server connector for Perplexity API, to enable web search without leaving the MCP ecosystem. (Table of Contents / AI Services)
- awesome-mcp-servers - Perplexity - An MCP server that connects to Perplexity's Sonar API, enabling real-time web-wide research in conversational AI. (Official Servers)
README
# Perplexity Ask MCP Server
An MCP server implementation that integrates the Sonar API to provide Claude with unparalleled real-time, web-wide research.

## 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.## Configuration
### Step 1:
Clone this repository:
```bash
git clone [email protected]:ppl-ai/modelcontextprotocol.git
```Navigate to the `perplexity-ask` directory and install the necessary dependencies:
```bash
cd modelcontextprotocol/perplexity-ask && npm install
```### Step 2: Get a Sonar API Key
1. Sign up for a [Sonar API account](https://docs.perplexity.ai/guides/getting-started).
2. Follow the account setup instructions and generate your API key from the developer dashboard.
3. Set the API key in your environment as `PERPLEXITY_API_KEY`.### Step 3: Configure Claude Desktop
1. Download Claude desktop [here](https://claude.ai/download).
2. Add this to your `claude_desktop_config.json`:
```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
```json
{
"mcpServers": {
"perplexity-ask": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-perplexity-ask"
],
"env": {
"PERPLEXITY_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
```You can access the file using:
```bash
vim ~/Library/Application\ Support/Claude/claude_desktop_config.json
```### Step 4: Build the Docker Image
Docker build:
```bash
docker build -t mcp/perplexity-ask:latest -f perplexity-ask/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](https://docs.perplexity.ai/api-reference/chat-completions).
### Troubleshooting
The Claude documentation provides an excellent [troubleshooting guide](https://modelcontextprotocol.io/docs/tools/debugging) you can refer to. However, you can still reach out to us at [email protected] for any additional support or [file a bug](https://github.com/ppl-ai/api-discussion/issues).
## 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.