ResearchMCP

ResearchMCP

By chew-z GitHub

MCP server for Perplexity

golang perplexity-api
Overview

what is ResearchMCP?

ResearchMCP is a Model Completion Protocol (MCP) service that enables internet research using the Perplexity AI API, providing users with in-depth and up-to-date information on various topics.

how to use ResearchMCP?

To use ResearchMCP, set up the required environment variables, build the service using Go, and run it. You can then utilize the 'research' tool to query information.

key features of ResearchMCP?

  • Internet research capabilities through Perplexity AI
  • Integration with MCP protocol for tool discovery
  • Graceful error handling with degraded mode
  • Configurable via environment variables
  • Structured logging for better monitoring

use cases of ResearchMCP?

  1. Conducting academic research on current scientific topics.
  2. Gathering information for market analysis.
  3. Assisting in data collection for content creation.

FAQ from ResearchMCP?

  • What programming language is used for ResearchMCP?

ResearchMCP is built using Go (Golang).

  • Do I need an API key to use ResearchMCP?

Yes, a Perplexity AI API key is required to access the research capabilities.

  • How can I configure ResearchMCP?

Configuration is done through environment variables, which can be set in a .env file.

Content

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:

VariableDescriptionRequiredDefault
PERPLEXITY_API_KEYAPI key for Perplexity AIYes-
PERPLEXITY_MODELModel to use for researchNosonar-medium-online
PERPLEXITY_TIMEOUTTimeout in seconds for API requestsNo90
PERPLEXITY_MAX_RETRIESMaximum number of retry attemptsNo2
PERPLEXITY_INITIAL_BACKOFFInitial backoff time in secondsNo1
PERPLEXITY_MAX_BACKOFFMaximum backoff time in secondsNo10

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 tools information available.
⚡ go-mcp
⚡ go-mcp by ktr0731

⚡ A type-safe, intuitive Go SDK for building MCP servers with ease and confidence

golang mcp
View Details
TimeMCP
TimeMCP by chew-z

Golang MCP server to replace modelcontextprotocol/time MCP server

golang time
View Details

MCP server tool for self-review of GitHub pull requests

golang mcp
View Details

A Go implementation of an MCP (Model Context Protocol) server tools

golang mcp
View Details

Vibe querying with MCP server for Azure Data Explorer (Kusto)

golang azure
View Details
📦 mcp-client-go
📦 mcp-client-go by yincongcyincong

a mcp client for go. Integrate multiple MCP servers

golang ai
View Details

A Model Context Protocol for checking domain name registration status in bulk.

golang mcp-server
View Details