Labsco
mikeapp logo

IIIF Images Server

โ˜… 6

from mikeapp

A server for working with IIIF (International Image Interoperability Framework) manifests and images.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

MCP for IIIF Images

A Model Context Protocol (MCP) server for working with IIIF (International Image Interoperability Framework) manifests and images. See this video for a demonstration.

Features

This MCP server contains the following tools:

  • fetch_iiif_manifest: Fetch a IIIF manifest from a URL. (Note that clients may have difficulty processing large amounts of JSON.)
  • fetch_iiif_image: Retrieve a IIIF image from a base URI, fetching info.json and returning the image data (default: max 1500px dimension, max 800,000 pixels total)
  • fetch_iiif_image_region: Retrieve a specific region of a IIIF image using percentage coordinates, with the region scaled to fit within the same constraints

Caveats

  • The code scales the images to dimensions acceptable to Claude. It will not work with a Level 0 Image API implementation.
  • Claude may not process some IIIF Manifests due to the size of the file.

Testing

To run the tests:

# Run tests once
npm test

# Run tests in watch mode (automatically re-runs on file changes)
npm run test:watch

# Run tests with coverage
npm test -- --coverage

The project uses Vitest as the testing framework, which provides:

  • Fast execution with ES modules support
  • Jest-compatible API with better error messages
  • Built-in coverage reporting
  • Watch mode for development

Available Tools

fetch_iiif_manifest

Fetches and validates a IIIF manifest from a URL.

Parameters:

  • url (required): The URL of the IIIF manifest to fetch

Example usage:

Please fetch the IIIF manifest from https://example.com/manifest.json

fetch_iiif_image

Retrieve a IIIF image from a base URI, fetching info.json and returning the image data.

Parameters:

  • baseUri (required): Base URI of the IIIF Image API resource (without /info.json)

Example usage:

Fetch the IIIF image at https://example.com/iiif/image123

fetch_iiif_image_region

Retrieve a specific region of a IIIF image using percentage coordinates, with the region scaled to fit within the same constraints. Use this to fetch regions of interest at higher detail for more accurate image description and analysis.

Parameters:

  • baseUri (required): Base URI of the IIIF Image API resource (without /info.json)
  • region (required): Region in pct: format (e.g., 'pct:20,20,50,50' for x,y,width,height as percentages)

Example usage:

Fetch a region from the IIIF image at https://example.com/iiif/image123 with region pct:10,10,50,50

Note that you can use these tools together in the course of a conversation, for example:

Fetch the IIIF image at https://example.com/iiif/image123 and describe it.
...
Zoom in on the text at the bottom of the page and transcribe it.