Skip to main content
Glama
Wikimedia Commons MCP Server

Wikimedia Commons MCP Server

by irfandemir00

Wikimedia Commons MCP Server

Model Context Protocol (MCP) server for searching, inspecting, and safely downloading media from Wikimedia Commons.

Features

  • 10 Read/Download Tools:

    • search_files: CirrusSearch with keyword, fileType, category, hasStatement (P180=...), sort order, and pagination.

    • get_file_details: Original & thumbnail URLs, dimensions, MIME, SHA-1, license/attribution, author, description, categories, and EXIF metadata.

    • preview_image: Size-bounded raster thumbnail returned as MCP ImageContent for visual inspection.

    • search_categories: Full-text category search with subcategory/file counts.

    • browse_category: List subcategories, files, or pages inside any Commons category.

    • get_picture_of_the_day: Today's (or any YYYY-MM-DD) Picture of the Day with localized caption and file details.

    • get_structured_data: Wikibase MediaInfo (M<pageId>) multilingual captions and statements with resolved Wikidata labels.

    • search_nearby: Coordinate + radius search for geotagged files.

    • get_file_usage: Global usage across Wikipedia and sister Wikimedia projects.

    • download_file: Sandboxed local download into COMMONS_DOWNLOAD_DIR with path traversal protection, size caps, and SHA-1 verification for originals.

  • 2 MCP Resources:

    • commons://potd

    • commons://file/{title}

Related MCP server: Wikipedia MCP Server

Configuration

Variable

Default

Description

COMMONS_DOWNLOAD_DIR

~/Downloads/wikimedia-commons

Sandbox root directory for download_file

WIKIMEDIA_USER_AGENT

wikimedia-commons-mcp/0.1.0 (...)

Descriptive User-Agent header per Wikimedia API policy

COMMONS_REQUEST_TIMEOUT_MS

15000

HTTP request timeout (1000..120000 ms)

COMMONS_MAX_DOWNLOAD_BYTES

52428800

Max download size in bytes (default 50 MB)

COMMONS_MAX_PREVIEW_BYTES

2097152

Max inline preview size in bytes (default 2 MB)

COMMONS_CACHE_TTL_MS

300000

In-memory read cache TTL (0 disables caching)

COMMONS_CACHE_MAX_ENTRIES

250

Maximum cached entries

Development

npm install
npm run build
npm run verify

Example mcp_config.json

{
  "mcpServers": {
    "wikimedia-commons": {
      "command": "node",
      "args": ["/path/to/wikimedia-commons-mcp/dist/cli.js"],
      "env": {
        "WIKIMEDIA_USER_AGENT": "wikimedia-commons-mcp/0.1.0 (https://commons.wikimedia.org/wiki/Main_Page)"
      }
    }
  }
}

Available Tools

10 tools
browse_categoryBrowse Wikimedia Commons CategoryA
Read-onlyIdempotent

List subcategories, files, or pages inside a specific Wikimedia Commons category with continuation-token pagination.

Inputs: category (required), limit, types, continueToken.

download_fileDownload Wikimedia Commons FileA

Safely download an original Wikimedia Commons file or resized thumbnail into the configured sandbox download directory (COMMONS_DOWNLOAD_DIR). Enforces path traversal protection, size limits, and SHA-1 integrity verification for original files.

Inputs: title (required), width, filename, overwrite, +1 more.

get_file_detailsGet Wikimedia Commons File DetailsA
Read-onlyIdempotent

Retrieve full metadata for a Wikimedia Commons file: original and thumbnail URLs, dimensions, MIME type, SHA-1, license, attribution, author, description, categories, and EXIF technical metadata.

Inputs: title (required), thumbWidth, includeHiddenCategories.

get_file_usageGet Global File Usage Across WikisA
Read-onlyIdempotent

List Wikipedia and sister Wikimedia project pages that embed a given Wikimedia Commons file.

Inputs: title (required), limit, continueToken.

get_picture_of_the_dayGet Wikimedia Commons Picture of the DayA
Read-onlyIdempotent

Retrieve the Wikimedia Commons Picture of the Day for today (UTC) or a specific YYYY-MM-DD date, including localized caption and full file metadata.

Inputs: date, language, thumbWidth.

get_structured_dataGet Structured Data on CommonsA
Read-onlyIdempotent

Retrieve Wikibase MediaInfo (M-entity) multilingual captions and structured statements (such as P180 depicts, license, copyright status) with resolved Wikidata labels.

Inputs: title (required), language.

preview_imagePreview Wikimedia Commons ImageA
Read-onlyIdempotent

Fetch a size-bounded raster thumbnail of a Commons file and return it as MCP ImageContent for direct visual inspection, alongside attribution metadata.

Inputs: title (required), width.

search_categoriesSearch Wikimedia Commons CategoriesA
Read-onlyIdempotent

Search Wikimedia Commons categories (Namespace 14) by keyword and retrieve subcategory/file counts.

Inputs: query (required), limit, offset.

search_filesSearch Wikimedia Commons FilesA
Read-onlyIdempotent

Search media files on Wikimedia Commons using keywords, file type filters, category filters, or Structured Data statements (e.g. P180=Q146). Returns URLs, dimensions, MIME types, and license attribution.

Inputs: sort, limit, query, offset, +4 more.

search_nearbySearch Nearby Geotagged Commons FilesA
Read-onlyIdempotent

Find geotagged Wikimedia Commons media files within a given radius (in meters) around geographic coordinates.

Inputs: latitude (required), longitude (required), limit, thumbWidth, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 10 tools

    Disambiguation4/5

    Each tool targets a distinct action-resource pair (keyword search, category search, category browsing, geo search, metadata, structured data, usage, preview, download, POTD), so an agent can generally pick correctly. The only mild overlaps are preview_image vs. download_file (both fetch file content) and search_files vs. browse_category (both enumerate files), but the descriptions clearly separate them by output form and entry point.

    Naming Consistency5/5

    All names follow a consistent snake_case verb_noun pattern (get_file_details, search_files, browse_category, download_file, preview_image). The only stylistic outlier is the longer noun in get_picture_of_the_day, which is still the same convention.

    Tool Count5/5

    Ten tools is a well-scoped surface for a media repository server, with each tool covering a genuinely different capability (discovery, metadata, structured data, geo, retrieval). There are no obvious filler or redundant entries.

    Completeness4/5

    The surface covers discovery (keyword, category, geo), metadata, structured MediaInfo, image preview, file download with integrity checks, usage tracking, and POTD—solid coverage for a read-only Commons client. Minor gaps exist around batch/multi-file operations and higher-level discovery (e.g., related/similar media or category tree traversal beyond one level), which agents can work around via pagination.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers