Grokipedia MCP Server
MCP server for searching and retrieving content from Grokipedia
The User of the MCP assumes full responsibility for interacting with Grokipedia.
Please see the Xai Terms of Service if you have any doubts.
Elon, please don't sue me. I only wanted my agents to have access to truthful information and stop referencing wikipedia all the time.
Quick Start
Add this to your MCP configuration file:
Verifying Installation
You should see the Grokipedia server available with these tools:
search- Search with filtersget_page- Get page overviewget_page_content- Get full contentget_page_citations- Get citationsget_related_pages- Get linked pagesget_page_sections- List all section headersget_page_section- Extract specific sections
And these prompts:
research_topic- Research workflowfind_sources- Find citationsexplore_related- Explore connectionscompare_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 (Development)
Using uv:
For development with MCP Inspector and CLI tools:
Usage
Run with MCP Inspector (Development)
The fastest way to test and debug (requires dev dependencies):
This launches the MCP Inspector UI where you can:
Explore available tools
Test search queries
Retrieve page content
View structured output
Run Directly
Available Tools
search
Search for articles in Grokipedia with filtering and sorting options.
Parameters:
query(string, required) - Search querylimit(int, optional, default: 12) - Maximum number of resultsoffset(int, optional, default: 0) - Pagination offsetsort_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:
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:
get_page_content
Get only the article content without citations or metadata.
Parameters:
slug(string, required) - Article identifiermax_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:
get_page_citations
Get the citations list for a specific page.
Parameters:
slug(string, required) - Article identifierlimit(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_related_pages
Get pages that are linked from a specific article.
Parameters:
slug(string, required) - Article identifierlimit(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_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:
get_page_section
Extract a specific section from an article by header name.
Parameters:
slug(string, required) - Article identifiersection_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:
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:
FastMCP for declarative MCP server implementation
grokipedia-api-sdk AsyncClient for API communication
Lifespan context for client connection management
Structured output using Pydantic models from the SDK
Comprehensive error handling with specific exception types
Error Handling
The server handles various error scenarios:
ValueErrorfor invalid parameters or not found pagesRuntimeErrorfor network or API errorsDetailed logging at debug, info, warning, and error levels
Development
Project Structure
Testing
Use the MCP Inspector for interactive testing:
License
MIT