Skip to content

benoute/grokipedia-client-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grokipedia Client

A Go library and Model Context Protocol (MCP) server for accessing Grokipedia.

What is Grokipedia?

Grokipedia is an AI-generated online encyclopedia launched by xAI, providing articles created primarily by Grok, xAI's large language model. It's positioned as an alternative to traditional encyclopedias with a focus on comprehensive, unbiased knowledge.

Components

This project provides two ways to interact with Grokipedia:

📚 Go Library (pkg/grokipedia)

A standalone Go package for direct API access to Grokipedia's search and page retrieval functionality.

🤖 MCP Server (cmd/grokipedia-mcp)

An MCP-compatible server that exposes Grokipedia functionality as tools for AI assistants like Claude.

Features

Both the library and MCP server provide access to:

  1. 🔍 Full-text search: Find articles by querying Grokipedia's search API
  2. 📄 Page retrieval: Get complete article content, titles, and citations
  3. ⚙️ Configurable parameters: Set custom limits and offsets for search results

MCP Tools

The MCP server exposes these as tools for AI assistants:

  • search_grokipedia: Search for articles with configurable limit/offset
  • get_grokipedia_page: Retrieve full page content by slug

Installation

  1. Clone or download this repository
  2. Navigate to the project directory
  3. Install dependencies:
    go mod tidy

Building the Components

MCP Server:

make build
# or
go build -o grokipedia-mcp ./cmd/grokipedia-mcp

Go Library: Add to your project with:

go get github.com/benoute/grokipedia-client-go/pkg/grokipedia

Usage

📚 Using the Go Library

Add the package to your Go project:

go get github.com/benoute/grokipedia-client-go/pkg/grokipedia
import "github.com/benoute/grokipedia-client-go/pkg/grokipedia"

// Search with default parameters (limit: 10, offset: 0)
output, err := grokipedia.Search(context.Background(), grokipedia.SearchInput{Query: "quantum computing"})
if err != nil {
    // handle error
}
// output.Results contains slugs of matching pages

// Search with custom limit and offset
output, err := grokipedia.Search(context.Background(), grokipedia.SearchInput{
    Query:  "artificial intelligence",
    Limit:  20,
    Offset: 10,
})

// Get full page content
page, err := grokipedia.GetPage(context.Background(), "Quantum_computing")
if err != nil {
    // handle error
}
// page contains Title, Content, Citations

🤖 Using the MCP Server

Installation & Setup

  1. Build the server:
make build
# or
go build -o grokipedia-mcp ./cmd/grokipedia-mcp
  1. Configure Claude Desktop by adding to claude_desktop_config.json:
{
  "mcpServers": {
    "grokipedia": {
      "command": "/absolute/path/to/grokipedia-mcp",
      "args": [],
      "env": {}
    }
  }
}
  1. Restart Claude Desktop

Available Tools

Once configured, Claude can use:

  • search_grokipedia - Search with optional limit/offset parameters
  • get_grokipedia_page - Retrieve full article content

Example queries:

  • "Search for information about artificial intelligence"
  • "What is quantum computing?"
  • "Find articles on climate change"
  • "Get the full content of the United_Petroleum page"
  • "Read the article about Python programming"

About

A Go library and MCP server for accessing Grokipedia

Resources

Stars

Watchers

Forks

Packages

No packages published