Skip to main content
Glama
yanexr

wikimedia-image-search-mcp

by yanexr

Wikimedia Image Search MCP Server

This MCP (Model Context Protocol) server enables AI assistants to search for images on Wikimedia Commons. It provides detailed metadata and optional thumbnail composites to help AI models visually compare results.

Overview

This server is designed to give AI assistants "eyes" when searching for visual content. Instead of guessing based on filenames or text descriptions alone, the AI can retrieve a structured list of image metadata and a composite image containing thumbnails of the search results.

This capability is particularly useful when an AI assistant needs to:

  • Find suitable images for creating websites, articles, or presentations.

  • Select images for educational materials or books.

  • Verify the visual content of an image before recommending it.

  • Compare multiple images to choose the most relevant one for a specific context.

By providing both metadata (license, author, description, dimensions) and a visual preview, the AI can make informed decisions about which images to use or download.

Related MCP server: webfetch

Setup

Prerequisites

  • Node.js: Version 18 or higher.

  • MCP Client: A compatible client such as VS Code, Cursor, Claude Code, Windsurf, Cline, Claude Desktop...

Installation

To use this server, configure your MCP client to run it using npx.

Add the following configuration to your MCP settings file (typically located at %APPDATA%\Code\User\globalStorage\mcp-servers.json on Windows or ~/Library/Application Support/Code/User/globalStorage/mcp-servers.json on macOS).

{
  "mcpServers": {
    "wikimedia-image-search": {
      "command": "npx",
      "args": [
        "-y",
        "wikimedia-image-search-mcp"
      ]
    }
  }
}

Go to Cursor Settings > MCP > Add new MCP Server.

  • Name: wikimedia-image-search

  • Type: command

  • Command: npx -y wikimedia-image-search-mcp

Alternatively, edit your .cursor/mcp.json file:

{
  "mcpServers": {
    "wikimedia-image-search": {
      "command": "npx",
      "args": [
        "-y",
        "wikimedia-image-search-mcp"
      ]
    }
  }
}

Edit your claude_desktop_config.json file (typically located at %APPDATA%\Claude\claude_desktop_config.json on Windows or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS).

{
  "mcpServers": {
    "wikimedia-image-search": {
      "command": "npx",
      "args": [
        "-y",
        "wikimedia-image-search-mcp"
      ]
    }
  }
}

Run the following command in your terminal:

claude mcp add wikimedia-image-search -- npx -y wikimedia-image-search-mcp

Tool Usage

This server exposes a single tool: wikimedia_search_images.

Tool Schema

The tool accepts the following parameters:

  • query (string, required): The search terms (e.g., "sunset ocean", "eiffel tower").

  • limit (number, optional): Maximum number of results to return (default: 9, max: 50).

  • offset (number, optional): Number of results to skip for pagination.

  • license (string, optional): Filter by license. Options: "all" (default) or "no_restrictions" (CC0/Public Domain).

  • include_thumbnails (boolean, optional): Whether to generate and return a composite image of thumbnails (default: true).

How It Works

  1. Fetching: The tool queries the Wikimedia Commons API using the provided search terms and filters. It retrieves raw JSON data containing image URLs, metadata, and license information.

  2. Processing: The raw JSON response is parsed and transformed into a clean, structured list of ImageMetadata objects.

  3. Formatting:

    • Text: The metadata list is converted into a YAML-formatted string. This provides the AI with a readable, structured text overview of the results (including file size, dimensions, author, and license).

    • Visual: If include_thumbnails is true, the tool downloads the thumbnail for each result. It then uses the sharp library to composite these thumbnails into a single grid image, with index numbers overlaid on each image.

  4. Response: The tool returns a multi-content message containing the YAML text and the composite image (MIME type image/jpeg).

You can view examples of the output files in the test-output/ directory:

Demonstration

Development

To contribute to this project or run it locally from source:

  1. Clone the repository:

    git clone https://github.com/yanexr/wikimedia-image-search-mcp.git
    cd wikimedia-image-search-mcp
  2. Install dependencies:

    npm install
    # or
    pnpm install
  3. Build the project:

    npm run build
    # or
    pnpm run build
  4. Local Configuration: To test the server locally with an MCP client, point the configuration to your built file.

    {
      "mcpServers": {
        "wikimedia-local": {
          "command": "node",
          "args": [
            "C:/path/to/wikimedia-image-search-mcp/dist/index.js"
          ]
        }
      }
    }
  5. Testing and Debugging: You can use the MCP Inspector to test the server interactively:

    npm run inspect
    # or
    pnpm run inspect

Available Tools

1 tool
wikimedia_search_imagesSearch Wikimedia Commons ImagesA

Search for images on Wikimedia Commons with metadata including download URLs and optional thumbnail composite image for visual comparison. Use results to e.g. fetch full images that are relevant for your task.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results to return (1-50). 12 or fewer is recommended, especially if including thumbnails is enabled.
queryYesSearch query. Note: Wikimedia uses strict keyword matching, not semantic search. Use common, fewer terms for more results.
offsetNoNumber of results to skip for pagination
licenseNoFilter images by license type: 'no_restrictions' for CC0/public domain only, 'all' for any licenseall
include_thumbnailsNoIf true, returns an additional composite image so you can visually view and compare the results. Set to false to save processing time or if you're unable to view images.

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of disclosing behaviors. It mentions the optional thumbnail composite image and that results include metadata with download URLs. It does not disclose rate limits, pagination behavior, or the strict keyword matching (which is in the schema's query description). Some useful context is added, but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the primary purpose and key features, and ends with a practical usage hint. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with no output schema and no annotations, the description gives a solid overview: what it does, what results contain, and a usage example. It could mention pagination or that results are limited, but the schema covers limits. The description is fairly complete for its complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all five parameters well. The description adds no extra parameter-specific guidance beyond what the schema provides. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific action ('Search for images on Wikimedia Commons') and the resource, while mentioning key outputs (metadata, download URLs, optional thumbnail). It is specific enough to distinguish from a generic image search, even without sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear use case ('Use results to e.g. fetch full images that are relevant for your task') and implies when to use this tool (when needing images from Wikimedia Commons). However, it does not explicitly state alternatives or when-not-to-use, but with no sibling tools this is acceptable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 1 tool updatev1.0.2
    • First observedwikimedia_search_images

TDQS

A4.1/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of confusion or overlap. The tool's purpose is clearly defined and unique.

Naming Consistency5/5

The single tool name follows a clear verb_noun pattern (search_images) with a descriptive prefix, making it predictable and readable. Since there is only one tool, consistency is trivially maintained.

Tool Count3/5

The server is narrowly scoped for image search, so one tool is not unreasonable, but it feels minimal. A small set of complementary tools (e.g., fetching image details or paginating results) could make the server more robust.

Completeness4/5

The search tool provides comprehensive metadata and download URLs, enabling the core workflow of finding and fetching images. However, there are no additional tools for operations like direct image retrieval or querying specific image details, leaving a minor gap.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    This MCP server enables AI assistants to search for images on Wikimedia Commons, providing detailed metadata and optional thumbnail combinations to assist AI models in visual comparisons.
    1
    2
    Apache 2.0
  • A
    license
    A
    quality
    A
    maintenance
    License-first federated image search for AI agents and humans. Exposes MCP tools for concise, attribution-aware image discovery, license probing, and guarded downloads across open, platform, and editorial sources.
    7
    49
    3
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Enables searching and retrieving images from Wikipedia Commons with detailed metadata including licenses and authors.
    2
    33
    10
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    An MCP server that enables AI assistants to search royalty-free stock photos using natural language, example images, or similarity, and render results as an inline thumbnail grid.
    3
    MIT