Grokipedia MCP Server
Search and retrieve articles from Grokipedia with filtering, citations, related pages, and section extraction.
Search for articles with filters (relevance/views sorting, minimum views, pagination)
Get page overviews including metadata, content previews, and citation summaries
Fetch full article content with configurable length limits
Retrieve citation lists with titles, URLs, and descriptions
Discover linked/related pages ranked by mention frequency
List article sections and extract specific sections by header
Use guided prompts for research workflows, finding sources, exploring related topics, and comparing topics
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Grokipedia MCP Server search for machine learning articles sorted by views"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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:
{
"mcpServers": {
"grokipedia": {
"command": "uvx",
"args": ["grokipedia-mcp"]
}
}
}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_linked_pages- Get pages linked from an articleget_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
Related MCP server: Grokipedia MCP Server
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:
cd grokipedia-mcp
uv syncFor development with MCP Inspector and CLI tools:
uv sync --devUsage
Run with MCP Inspector (Development)
The fastest way to test and debug (requires dev dependencies):
uv run --dev mcp dev main.pyThis launches the MCP Inspector UI where you can:
Explore available tools
Test search queries
Retrieve page content
View structured output
Run Directly
# Using the installed entry point
uv run grokipedia-mcp
# Or as a Python module
uv run python -m grokipedia_mcp
# Or directly
uv run python main.pyAvailable 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:
// 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 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:
{"slug": "Machine_learning", "max_length": 15000}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 all citations
{"slug": "Machine_learning"}
// Get first 10 citations only
{"slug": "Machine_learning", "limit": 10}get_linked_pages
Get pages that are linked from a specific article. Grokipedia no longer publishes a curated linked-pages field, so links are derived from /page/<slug> markdown links in the article content and ranked by mention frequency, then first position.
Parameters:
slug(string, required) - Article identifierlimit(int, optional, default: 10) - Maximum number of linked pages to return
Returns: List of linked pages with titles, slugs, and mention counts.
Use this when: You want to discover topics an article references or explore connections between articles.
Examples:
// Get linked pages
{"slug": "Machine_learning"}
// Get more linked 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 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:
// 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:
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
grokipedia-mcp/
├── grokipedia_mcp/
│ ├── __init__.py # Package exports
│ ├── __main__.py # CLI entry point
│ └── server.py # FastMCP server implementation
├── main.py # Direct execution entry point
├── pyproject.toml # Project configuration
└── README.md # This fileTesting
Use the MCP Inspector for interactive testing:
uv run mcp dev main.pyLicense
MIT
Available Tools
7 toolsget_linked_pagesARead-onlyIdempotent
Get pages that are linked from the specified article.
Grokipedia no longer publishes a curated linked-pages field, so links are derived from /page/ markdown links in the article content and ranked by mention frequency, then first position.
Inputs: slug (required), limit. Returns: The server's response to a tool call.
get_pageARead-onlyIdempotent
Get complete page information including metadata, content preview, and citations summary.
Inputs: slug (required), max_content_length. Returns: The server's response to a tool call.
get_page_citationsARead-onlyIdempotent
Get the citations list for a specific page.
Inputs: slug (required), limit. Returns: The server's response to a tool call.
get_page_contentARead-onlyIdempotent
Get only the article content without citations or metadata.
Inputs: slug (required), max_length. Returns: The server's response to a tool call.
get_page_sectionCRead-onlyIdempotent
Extract a specific section from an article by header name.
Inputs: slug (required), section_header (required), max_length. Returns: The server's response to a tool call.
get_page_sectionsARead-onlyIdempotent
Get a list of all section headers in an article.
Inputs: slug (required). Returns: The server's response to a tool call.
searchARead-onlyIdempotent
Search for articles in Grokipedia with optional filtering and sorting.
Inputs: query (required), limit, offset, sort_by, +1 more. Returns: The server's response to a tool call.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools are clearly distinct: search finds articles, get_page retrieves metadata, get_page_content isolates body text, get_page_citations returns references, and get_page_sections lists headers. However, get_page and get_page_content could be confused since both return article content, though the descriptions clarify that get_page includes metadata and citations while get_page_content is content-only.
Tool names mostly follow a consistent verb_noun pattern: get_page, get_page_content, get_page_citations, get_page_sections, get_linked_pages, search. The only deviation is 'search' lacking a noun (e.g., search_pages), but it is still readable and predictable.
Seven tools is well-scoped for a wiki/knowledge-base server. Each tool covers a distinct retrieval need: search, page metadata, content, citations, sections, section detail, and linked pages. No redundant or unnecessary tools.
The server covers the main read-only retrieval workflows for a wiki: search, get page, get content, get citations, get sections, and get linked pages. Minor gaps include no way to get a page's full raw markdown in one call (content preview only) and no direct page history or related-pages API, but agents can work around these with existing tools.
Maintenance
Related MCP Connectors
Real-time web and scholarly search with cited answers and multi-step deep research.
Web search, fetch, extract, and research for AI agents. Markdown output + AI-synthesized answers.
Search and read Wikipedia articles and sections, list cited references, nearby pages, and languages.
Web search, URL content extraction to Markdown, site mapping, and recursive web crawler.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides comprehensive web, news, and Twitter search capabilities using the xAI Grok API with both basic and deep analysis modes. It includes advanced features like timeline generation, sentiment analysis, and built-in reliability through caching and retry logic.524 npm19MIT
- AlicenseAqualityDmaintenanceEnables searching and retrieving articles, citations, and structured content from Grokipedia for research and information retrieval. It provides specialized tools for section extraction, related page discovery, and filtered search results.7MIT
- AlicenseAqualityDmaintenanceEnables searching and retrieving content from Grokipedia, with tools for page lookup, citations, sections, and related pages.7MIT
- AlicenseAqualityDmaintenanceEnables searching X (Twitter) posts, discussions, trends, and web content via Grok API using natural language.310 npm1MIT