Perplexity Research

by chew-z

1 stars
301 downloads
Not rated
GitHub

About

Enables internet research capabilities through Perplexity AI's API, retrieving up-to-date information with source citations while maintaining conversation context.

Details

Author
chew-z
Repository
chew-z/ResearchMCP
GitHub stars
1
Downloads
301
Categories
AI, Design, Developer Tools, Search, API, Knowledge Base, Frontend, Infrastructure, Other

- Internet research through Perplexity AI
- Integration with MCP protocol for tool discovery and invocation
- Graceful error handling with degraded mode
- Configurable through environment variables
- Structured logging

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Perplexity Research
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 -y
    • Argument 2 @highlight/mcp-server

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

1. Set up the required environment variables (you can use a .env file)
2. Build and run the service:

go build
./ResearchMCP

research

Perform a research query or question using the Perplexity AI API. Requires a 'query' parameter which is a string representing the research topic.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "perplexity research": {
            "env": {},
            "args": [
                "-y",
                "@highlight/mcp-server"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Macos

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Windows

{
    "env": [],
    "args": [
        "/c",
        "npx",
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "cmd"
}

ResearchMCP

A Model Completion Protocol (MCP) service for internet research using Perplexity AI.

Overview

ResearchMCP is a service that provides internet research capabilities through the MCP protocol. It exposes a "research" tool that allows querying Perplexity AI's API for in-depth, up-to-date information on a wide range of topics.

Features

- Internet research through Perplexity AI
- Integration with MCP protocol for tool discovery and invocation
- Graceful error handling with degraded mode
- Configurable through environment variables
- Structured logging

Requirements

- Go 1.18 or later
- Perplexity AI API key

Configuration

The service is configured through environment variables:

| Variable | Description | Required | Default |
|----------|-------------|----------|---------|
| PERPLEXITY_API_KEY | API key for Perplexity AI | Yes | - |
| PERPLEXITY_MODEL | Model to use for research | No | sonar-medium-online |
| PERPLEXITY_TIMEOUT | Timeout in seconds for API requests | No | 90 |
| PERPLEXITY_MAX_RETRIES | Maximum number of retry attempts | No | 2 |
| PERPLEXITY_INITIAL_BACKOFF | Initial backoff time in seconds | No | 1 |
| PERPLEXITY_MAX_BACKOFF | Maximum backoff time in seconds | No | 10 |

Usage

1. Set up the required environment variables (you can use a .env file)
2. Build and run the service:

go build
./ResearchMCP

Example .env file

PERPLEXITY_API_KEY=your_api_key_here
PERPLEXITY_MODEL=sonar-medium-online
PERPLEXITY_TIMEOUT=120
PERPLEXITY_MAX_RETRIES=3
PERPLEXITY_INITIAL_BACKOFF=2
PERPLEXITY_MAX_BACKOFF=15

API

Research Tool

Name: research

Input Schema:

{
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The research query or question"
}
},
"required": ["query"]
}

Example Request:

{
"name": "research",
"arguments": {
"query": "What is the current state of quantum computing?"
}
}

Example Response:

{
"content": [
{
"type": "text",
"text": "Comprehensive research report on quantum computing...\n\nSources:\n- https://example.com/source1\n- https://example.com/source2"
}
]
}

Development

Project Structure

- main.go: Application entry point
- config.go: Configuration handling
- logger.go: Logging infrastructure
- perplexity.go: Perplexity API integration
- structs.go: Data structures
- context.go: Context handling

Code Style

Run formatting and linting with the provided scripts:

./run_format.sh
./run_lint.sh

License

This project is licensed under the MIT License - see the LICENSE file for details.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.