npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

wikimedia-image-search-mcp

v1.0.2

Published

MCP server enabling AI assistants to search Wikimedia Commons images with metadata and visual previews

Readme

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.

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