mcp-server-wikipedia

mcp-server-wikipedia

Enables efficient Wikipedia access through a progressive retrieval strategy that minimizes token usage by searching, summarizing, and fetching only relevant sections.

Category
Visit Server

README

mcp-server-wikipedia 📚

PyPI version License: MIT CI

This project exposes Wikipedia as an MCP server using a Progressive Retrieval Strategy. It is designed to minimize token usage by allowing LLMs to "scout" information before fetching large bodies of text.

The Problem: Token Waste

Wikipedia integrations often fetch multiple full pages up front, then decide what mattered. This fills the context window with irrelevant data and increases latency and cost.

The Solution: The Librarian Philosophy

This server implements a "Progressive Retrieval Ladder." Like a librarian helping you find a specific book, it encourages the model to:

  1. Search for several candidate titles.
  2. Summarize the candidates to find the right one.
  3. Inspect the TOC to find the relevant section.
  4. Fetch only the specific section OR the full page only if necessary.
graph TD
    A[Search Articles] --> B[Get Summaries]
    B --> C{Correct Page?}
    C -- No --> A
    C -- Yes --> D[Get TOC]
    D --> E[Get Section / Page]

Tools

  • search_articles(query, limit=5): Top matching pages with snippets.
  • get_summaries(titles): Compact summaries for multiple candidate pages.
  • get_toc(title): Table of contents / section map for a page.
  • get_section(title, section): Retrieve a single section by index or title.
  • get_page(title): Retrieve the full plain-text page.

Token Efficiency Benchmark

In deterministic testing, this progressive strategy achieves up to 80% token reduction compared to naive full-page retrieval. Detailed results can be found in BENCHMARK.md.

Strategy Token Usage (Avg)
Naive (Full Page) ~100%
MCP (Progressive) ~20%

Quick Start

Installation

From PyPI:

pip install mcp-server-wikipedia

Or run it directly via npx (if using the JS wrapper) or the python entry point:

python -m mcp_server_wikipedia

For development:

git clone https://github.com/surendranb/wikipedia-mcp-server.git
cd wikipedia-mcp-server
python3 -m venv .venv
source .venv/bin/source
pip install -e .

Run

wikipedia-mcp-server

MCP Client Configuration

Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "wikipedia": {
      "command": "wikipedia-mcp-server"
    }
  }
}

Cursor / VS Code

Specify the wikipedia-mcp-server command in your MCP settings.

Example Prompts

  • "Search for 'photosynthesis light dependent reactions' and summarize the top 3 candidates."
  • "What molecules are produced during the light-dependent reactions of photosynthesis? Search first, then fetch only the relevant section."

Development

Run tests:

python -m unittest discover -s tests -p "test_*.py" -v

Run benchmarks:

pip install -e ".[benchmark]"
python scripts/benchmark_token_efficiency.py

Contributing

We value simplicity and surgical efficiency. If you have an improvement that maintains the single-file architecture and enhances retrieval precision, we welcome your input. See CONTRIBUTING.md.

License

MIT License. See LICENSE for details.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured