npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cbuk100011/grokipedia-mcp

v0.2.2

Published

MCP server for Grokipedia

Readme

Grokipedia MCP Server

MCP server for searching and retrieving content from Grokipedia.

Please see the xAI Terms of Service if you have any doubts.

Quick Start

Add this to your MCP configuration file:

{
  "mcpServers": {
    "grokipedia": {
      "command": "npx",
      "args": ["-y", "grokipedia-mcp"]
    }
  }
}

Or if installed globally:

{
  "mcpServers": {
    "grokipedia": {
      "command": "grokipedia-mcp"
    }
  }
}

Or for local development (after running npm run build):

{
  "mcpServers": {
    "grokipedia": {
      "command": "node",
      "args": ["./dist/cli.js"]
    }
  }
}

Verifying Installation

You should see the Grokipedia server available with these tools:

  • search - Search with filters
  • get_page - Get page overview
  • get_page_content - Get full content
  • get_page_citations - Get citations
  • get_related_pages - Get linked pages
  • get_page_sections - List all section headers
  • get_page_section - Extract specific sections

And these prompts:

  • research_topic - Research workflow
  • find_sources - Find citations
  • explore_related - Explore connections
  • compare_topics - Compare two topics

Features

  • Search with Filters: Search with sorting (relevance/views) and filtering (min views)
  • Page Content: Retrieve articles, citations, and metadata with smart truncation
  • Related Pages: Discover linked/related articles
  • Section Extraction: Get specific sections from long articles
  • Smart Suggestions: Helpful alternatives when pages aren't found
  • Guided Prompts: Pre-built workflows for research, sources, exploration

Installation

Global Installation

npm install -g grokipedia-mcp

Local Development

# Clone the repository
git clone https://github.com/your-repo/grokipedia-mcp.git
cd grokipedia-mcp

# Install dependencies
npm install

# Build
npm run build

# Run
npm start

Usage

Run with stdio (default)

grokipedia-mcp

Run with SSE transport

grokipedia-mcp --transport sse --port 8888

Environment Variables

  • MCP_TRANSPORT - Transport protocol (stdio or sse, default: stdio)
  • PORT - Port for HTTP transports (default: 8888)

Available Tools

search

Search for articles in Grokipedia with filtering and sorting options.

Parameters:

  • query (string, required) - Search query
  • limit (int, optional, default: 12) - Maximum number of results
  • offset (int, optional, default: 0) - Pagination offset
  • sort_by (string, optional, default: "relevance") - Sort by "relevance" or "views"
  • min_views (int, optional) - Filter to articles with at least this many views

Returns: List of search results with title, slug, snippet, relevance score, and view count.

Examples:

// Basic search
{"query": "machine learning", "limit": 5}

// Sort by most viewed
{"query": "python", "sort_by": "views"}

// Filter popular articles only
{"query": "artificial intelligence", "min_views": 1000}

get_page

Get complete page information including metadata, content preview, and citations summary. Includes smart suggestion of alternatives if page not found.

Parameters:

  • slug (string, required) - Article identifier (from search results)
  • max_content_length (int, optional, default: 5000) - Maximum content length

Returns: Complete page object with metadata, truncated content, and citation summaries.

Features:

  • Suggests similar pages if the requested slug doesn't exist
  • Provides overview with content preview and citations

Use this when: You need an overview of a page with metadata and a content preview.

Example:

{"slug": "Machine_learning"}

get_page_content

Get only the article content without citations or metadata.

Parameters:

  • slug (string, required) - Article identifier
  • max_length (int, optional, default: 10000) - Maximum content length

Returns: Only the article content (title and content text).

Use this when: You need to read the full article content without citations.

Example:

{"slug": "Machine_learning", "max_length": 15000}

get_page_citations

Get the citations list for a specific page.

Parameters:

  • slug (string, required) - Article identifier
  • limit (int, optional) - Maximum number of citations to return (returns all if not specified)

Returns: List of citations with titles, URLs, and descriptions. Includes total count and returned count.

Use this when: You need to access source references and citations.

Examples:

// Get all citations
{"slug": "Machine_learning"}

// Get first 10 citations only
{"slug": "Machine_learning", "limit": 10}

get_related_pages

Get pages that are linked from a specific article.

Parameters:

  • slug (string, required) - Article identifier
  • limit (int, optional, default: 10) - Maximum number of related pages to return

Returns: List of related/linked pages with titles and slugs.

Use this when: You want to discover related topics or explore connections between articles.

Examples:

// Get related pages
{"slug": "Machine_learning"}

// Get more related pages
{"slug": "Quantum_computing", "limit": 20}

get_page_sections

Get a list of all section headers in an article.

Parameters:

  • slug (string, required) - Article identifier

Returns: List of all section headers with their levels (h1, h2, h3, etc.).

Use this when: You want to see the structure/outline of an article before reading specific sections.

Example:

{"slug": "Machine_learning"}

get_page_section

Extract a specific section from an article by header name.

Parameters:

  • slug (string, required) - Article identifier
  • section_header (string, required) - Section header to extract (case-insensitive)
  • max_length (int, optional, default: 5000) - Maximum section content length

Returns: Content of the specified section only.

Use this when: You need just one section of a long article (e.g., "Applications", "History", "Examples").

Examples:

// Get specific section
{"slug": "Neural_networks", "section_header": "Applications"}

// Get longer section
{"slug": "Python", "section_header": "Syntax", "max_length": 10000}

Note: Articles can be 100,000+ characters. Content is automatically truncated to prevent overwhelming LLM context windows. Use the max_length parameters to control the amount returned.

Prompts

The server provides pre-built prompts for common workflows:

research_topic

Guided workflow to research a topic: search -> retrieve -> analyze related pages and citations

find_sources

Find authoritative sources and citations for academic/research purposes

explore_related

Discover connections between topics and suggested further reading

compare_topics

Compare two topics side-by-side with their content and citations

Architecture

The server uses:

  • @modelcontextprotocol/sdk for MCP server implementation
  • Zod for parameter validation
  • Native fetch for API communication
  • Commander for CLI argument parsing

Error Handling

The server handles various error scenarios:

  • Error for invalid parameters or not found pages
  • Network errors for connectivity issues
  • Detailed error messages for debugging

Development

Project Structure

grokipedia-mcp/
├── src/
│   ├── index.ts        # Package exports
│   ├── cli.ts          # CLI entry point
│   ├── server.ts       # MCP server implementation
│   ├── client.ts       # Grokipedia API client
│   ├── types.ts        # TypeScript type definitions
│   └── icon.png        # Server icon
├── package.json        # Project configuration
├── tsconfig.json       # TypeScript configuration
└── README.md           # This file

Building

npm run build

Development Mode

npm run dev

Type Checking

npm run typecheck

License

MIT