A Go library and Model Context Protocol (MCP) server for accessing 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.
This project provides two ways to interact with Grokipedia:
A standalone Go package for direct API access to Grokipedia's search and page retrieval functionality.
An MCP-compatible server that exposes Grokipedia functionality as tools for AI assistants like Claude.
Both the library and MCP server provide access to:
- 🔍 Full-text search: Find articles by querying Grokipedia's search API
- 📄 Page retrieval: Get complete article content, titles, and citations
- ⚙️ Configurable parameters: Set custom limits and offsets for search results
The MCP server exposes these as tools for AI assistants:
search_grokipedia: Search for articles with configurable limit/offsetget_grokipedia_page: Retrieve full page content by slug
- Clone or download this repository
- Navigate to the project directory
- Install dependencies:
go mod tidy
MCP Server:
make build
# or
go build -o grokipedia-mcp ./cmd/grokipedia-mcpGo Library: Add to your project with:
go get github.com/benoute/grokipedia-client-go/pkg/grokipediaAdd the package to your Go project:
go get github.com/benoute/grokipedia-client-go/pkg/grokipediaimport "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- Build the server:
make build
# or
go build -o grokipedia-mcp ./cmd/grokipedia-mcp- Configure Claude Desktop by adding to
claude_desktop_config.json:
{
"mcpServers": {
"grokipedia": {
"command": "/absolute/path/to/grokipedia-mcp",
"args": [],
"env": {}
}
}
}- Restart Claude Desktop
Once configured, Claude can use:
search_grokipedia- Search with optional limit/offset parametersget_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"