Perplexity Research MCP server

Enables internet research capabilities through Perplexity AI's API, retrieving up-to-date information with source citations while maintaining conversation context.
Back to servers
Setup instructions
Provider
chew-z
Release date
Mar 23, 2025
Language
Go
Stats
1 star

ResearchMCP is a service that provides internet research capabilities through the Model Completion Protocol (MCP). It leverages Perplexity AI's API to offer in-depth, up-to-date information on a wide range of topics, making it useful for applications that need to access current internet-based knowledge.

Requirements

  • Go 1.18 or later
  • Perplexity AI API key

Installation

Setting Up Environment Variables

First, configure the necessary environment variables. You can create a .env file in your project directory with the following settings:

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

Configuration Options

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

Building and Running

Build and run the service with the following commands:

go build
./ResearchMCP

Usage

Research Tool

The service provides a tool called research that can be accessed through the MCP protocol.

Input Schema

The research tool accepts the following input parameters:

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

Example Request

Here's an example of how to make a request to the research tool:

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

Example Response

The service will respond with a structured answer that includes both the research content and sources:

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

Features

  • Internet Research: Access up-to-date information from across the web via Perplexity AI
  • MCP Integration: Fully compatible with the Model Completion Protocol for seamless tool discovery and invocation
  • Error Handling: The service includes graceful error handling with degraded mode operation
  • Structured Logging: Comprehensive logging for monitoring and debugging

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "researchmcp" '{"command":"go","args":["run","github.com/chew-z/researchmcp"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "researchmcp": {
            "command": "go",
            "args": [
                "run",
                "github.com/chew-z/researchmcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "researchmcp": {
            "command": "go",
            "args": [
                "run",
                "github.com/chew-z/researchmcp"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later