Skip to main content
Glama
README.md
# Wikipedia MCP

A Model Context Protocol (MCP) server that provides access to Wikipedia via the free REST API. No API key required.

⭐ If you find this useful, please star the repo — it helps others discover it.

## Tools

| Tool | Description |
|------|-------------|
| `search` | Search Wikipedia for articles matching a query |
| `summary` | Get a Wikipedia article summary + thumbnail by title |
| `random` | Get a random Wikipedia article summary |
| `did_you_know` | Get a random "Did You Know" style fact |
| `dino_fact` | Get a dino/prehistory-specific fact (specific species or random) |
| `featured_article` | Get today's Wikipedia Featured Article |
| `picture_of_the_day` | Get Wikimedia Commons' Picture of the Day (today, or a YYYYMMDD date) |
| `article_extract` | Get a full plain-text extract of an article (longer than `summary`) |
| `article_sections` | Get the table of contents (section headings) for an article — useful for navigating long articles before reading the full body |
| `on_this_day` | Get historical events that happened on today's date |
| `deaths_on_this_day` | Get notable deaths that happened on today's date (companion to `on_this_day`) |
| `categories` | List Wikipedia categories an article belongs to |
| `links` | List outgoing Wikipedia links from an article (the article's reference network) |
| `backlinks` | List incoming Wikipedia links to an article (what links here / referrer pages — inverse of `links`) |
| `external_links` | List external (off-wiki) links from an article — citations, references, and primary sources the article points to (outbound complement to `links` + `backlinks`) |
| `nearby` | List Wikipedia articles geographically near a location — anchor by article title (e.g. 'Eiffel Tower') or lat/lon, with distances |
| `translations` | List all language versions of an article (langlinks) — discover what languages it exists in |
| `revisions` | Show an article's recent edit history (who edited it, when, edit summaries, size deltas) with diff links |
| `pageviews` | Get daily view counts for an article (popularity, trending, historical interest) |
| `news` | Get current events from Wikipedia's Main Page "In the news" section |
| `top_reads` | Get the most-read articles on Wikipedia for a given date |
| `image` | Get just the lead image (thumbnail + original URLs) for an article, no summary text |
| `media_list` | List all media (images, videos, audio) used in an article — full inventory with type, caption, and thumbnail |
| `quote` | Get a random notable quote from a curated list of famous authors |
| `recent_changes` | Live window into Wikipedia right now — most recent edits, with kind filter ('all', 'edit', 'new', 'categorize', 'log') for breaking-news edits, newly published articles, and more |
| `category_members` | List articles filed under a category — taxonomy-based discovery, the reverse of `categories`; each entry has a 1–2 sentence extract + thumbnail |

All tools accept an optional `lang` parameter (one of: `en`, `de`, `es`, `fr`, `ja`, `zh`, `pt`, `it`, `ru`, `nl`). Note: `quote` accepts the parameter for API consistency but is currently English-only (curated list).

## Setup

### 1. Register with mcporter

Add to your `~/.openclaw/workspace/config/mcporter.json`:

```json
{
  "mcpServers": {
    "wikipedia": {
      "command": "python3",
      "args": ["/path/to/wikipedia-mcp/src/server.py"]
    }
  }
}
```

### 2. Restart mcporter

```bash
openclaw gateway restart
```

## Usage

```bash
# Search
mcporter call wikipedia search --args '{"query": "velociraptor", "limit": 5}'

# Article summary
mcporter call wikipedia summary --args '{"title": "Tyrannosaurus"}'

# Random article
mcporter call wikipedia random

# Random dino fact
mcporter call wikipedia dino_fact

# Specific species
mcporter call wikipedia dino_fact --args '{"species": "Spinosaurus"}'

# Today's featured article
mcporter call wikipedia featured_article

# Picture of the Day (curated daily image from Wikimedia Commons)
mcporter call wikipedia picture_of_the_day
mcporter call wikipedia picture_of_the_day --args '{"date": "20260901"}'

# Full plain-text article extract (vs summary)
mcporter call wikipedia article_extract --args '{"title": "Tyrannosaurus"}'

# Article table of contents — section headings (navigate before reading full body)
mcporter call wikipedia article_sections --args '{"title": "Tyrannosaurus"}'

# On this day (historical events for today)
mcporter call wikipedia on_this_day
mcporter call wikipedia on_this_day --args '{"count": 8}'

# Deaths on this day (notable deaths for today — in memoriam content hooks)
mcporter call wikipedia deaths_on_this_day
mcporter call wikipedia deaths_on_this_day --args '{"count": 6}'

# Categories for an article (taxonomy-based discovery)
mcporter call wikipedia categories --args '{"title": "Tyrannosaurus"}'
mcporter call wikipedia categories --args '{"title": "Tyrannosaurus", "limit": 10}'

# Outgoing links from an article (graph-style discovery)
mcporter call wikipedia links --args '{"title": "Tyrannosaurus"}'
mcporter call wikipedia links --args '{"title": "Tyrannosaurus", "limit": 30}'

# Translations — list all language editions of an article
mcporter call wikipedia translations --args '{"title": "Tyrannosaurus"}'
mcporter call wikipedia translations --args '{"title": "Tyrannosaurus", "limit": 10}'

# Revision history — recent edits, editors, summaries, diffs
mcporter call wikipedia revisions --args '{"title": "Tyrannosaurus"}'
mcporter call wikipedia revisions --args '{"title": "Tyrannosaurus", "limit": 20}'

# Daily view counts (popularity research, trending topics)
mcporter call wikipedia pageviews --args '{"title": "Tyrannosaurus"}'
mcporter call wikipedia pageviews --args '{"title": "Python_(programming_language)", "start": "20250101", "end": "20250107"}'

# Current events from Wikipedia's Main Page (today's "In the news")
mcporter call wikipedia news
mcporter call wikipedia news --args '{"limit": 8}'

# Top reads — most-viewed articles on a given date
mcporter call wikipedia top_reads
mcporter call wikipedia top_reads --args '{"date": "20260101", "limit": 15}'

# Lead image — thumbnail + original URLs for an article (no text)
mcporter call wikipedia image --args '{"title": "Tyrannosaurus"}'
mcporter call wikipedia image --args '{"title": "Tyrannosaurus", "lang": "de"}'

# Media inventory — all images/videos/audio in an article (full list, not just lead)
mcporter call wikipedia media_list --args '{"title": "Tyrannosaurus"}'
mcporter call wikipedia media_list --args '{"title": "Tyrannosaurus", "limit": 50}'
mcporter call wikipedia media_list --args '{"title": "Berlin", "lang": "de"}'

# Random notable quote (curated list of famous authors)
mcporter call wikipedia quote
mcporter call wikipedia quote --args '{"lang": "de"}'  # lang accepted, currently English-only

# Non-English Wikipedia
mcporter call wikipedia summary --args '{"title": "Berlin", "lang": "de"}'
```

## Requirements

- Python 3.10+
- `requests>=2.28.0`

## API

Uses Wikipedia's free REST API:
- Search: MediaWiki Action API (`/w/api.php`)
- Summary / Random / Featured / Media-list: REST API v1 (`/api/rest_v1/...`)
- Pageviews / Top reads: Wikimedia cross-wiki metrics API (`https://wikimedia.org/api/rest_v1/metrics/pageviews/...`)

No API key required. Respects Wikipedia's User-Agent policy.

## Development

Run the smoke tests:

```bash
python3 tests/test_server.py
```

## License

MIT

TDQS

A4.1/5.0

Scored across 26 tools

Disambiguation5/5

Every tool targets a distinct resource and action, with descriptions that explicitly disambiguate overlapping pairs (e.g., summary vs article_extract, links, backlinks, external_links, media vs media_list). The daily content tools are each unique (featured_article, on_this_day, deaths_on_this_day, picture_of_the_day, news), so an agent can reliably select the right one.

Naming Consistency5/5

All tools use a single snake_case convention, whether they are noun-phrase ecosystem (article_sections, category_members, external_links) or verb-like names (search, links, care, point). There is no mixing of camelCase, abbreviations, or inconsistent verb styles, so the names feel cohesive and predictable.

Tool Count3/5

With 26 tools, the surface is larger than the typical 3-15 range and crosses the '25+' threshold. However, Wikipedia is a broad domain, and each tool covers a distinct read-only aspect (search, taxonomy, media, statistical, feeds, geo, translations, edit history). The count is high but not bloated for the apparent scope.

Completeness5/5

The toolset covers the read-only Wikipedia domain tightly: search and discovery, overview and full text, navigation through categories, links, backlinks, external links, translations, geo, media, pageview stats, recent changes, revisions, and daily curated feeds. There are no obvious gaps that would cause an agent to hit a dead end when trying to perform a typical Wikipedia research or content-sourcing task.

Maintenance

ActivityActive
ResponsivenessNo issues