Skip to main content
Glama
surendranb

mcp-server-wikipedia

by surendranb

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.

Related MCP server: Wikipedia MCP Server

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.

Install Server
A
license - permissive license
B
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Enables LLMs to search for keywords and fetch full page content from Wikipedia across various languages. It provides direct access to Wikipedia information through search and fetch tools.
    Last updated
    2
    2
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to access Wikipedia content, search articles, retrieve historical events, and fetch images through the Wikipedia API.
    Last updated
    4
    129
    1
    MIT
  • F
    license
    -
    quality
    C
    maintenance
    Provides comprehensive Wikipedia access for AI assistants via MCP Streamable HTTP transport, enabling search, article retrieval, summaries, section analysis, link discovery, and multi-language support.
    Last updated
    2
  • A
    license
    -
    quality
    D
    maintenance
    Enables token-efficient web page fetching by converting HTML to Markdown with tiered access (outline, section, search) to minimize LLM context usage.
    Last updated
    13
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • LLM-ready web search + instant answers + URL-to-clean-text fetch for agents and RAG.

  • AI-agent web search, answer-ready content. Beats Tavily: 60.7% of quality duels, 20.2% fewer tokens.

  • Token-efficient search for coding agents over public and private documentation.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/surendranb/wikipedia-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server