Skip to main content
Glama
mikeapp
by mikeapp

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.

Related MCP server: IIIF MCP Server

Claude Desktop Configuration

Install from Claude Desktop Extension (DXT) file

  1. Install and log in to Claude Desktop

  2. Download the .dxt file from the latest release

  3. Double-click the .dxt file

  4. Install the extension when prompted by Claude

Install from Source Code

  1. Clone this repository

  2. Install dependencies: npm install

  3. Make the server executable: chmod +x server/server.js

To use this MCP server with Claude Desktop, add the following configuration to your Claude Desktop config file. Adjust the file path as necessary. You may also need to provide the full path to your node command.

macOS

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-iiif-images": {
      "command": "node",
      "args": ["/PATH/TO/mcp-iiif-images/server/server.js"]
    }
  }
}

Windows

Edit %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-iiif-images": {
      "command": "node",
      "args": ["C:\\path\\to\\mcp-iiif-images\\server\\server.js"]
    }
  }
}

Linux

Edit ~/.config/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-iiif-images": {
      "command": "node",
      "args": ["/path/to/mcp-iiif-images/server/server.js"]
    }
  }
}

General MCP Usage

The server supports two transport modes:

Standard Mode (stdio)

Run the server using stdio transport (default):

npm start
# or
node server/server.js

HTTP Streaming Mode

Run the server using HTTP streaming transport:

node server/server.js --http
# or with custom port
node server/server.js --http --port 8080

Command-line Options

  • --http: Use HTTP streaming transport instead of stdio

  • --port PORT: Port number for HTTP server (default: 3000)

  • --help: Show help message

When using HTTP mode, the server will start an HTTP server with the following endpoints:

  • GET /sse: Establish Server-Sent Events connection

  • POST /messages?sessionId=<id>: Send MCP messages

HTTP Streaming Mode

For HTTP streaming mode, you'll need to start the server manually with the --http flag and then configure Claude Desktop to connect via HTTP:

node server/server.js --http --port 3000

Then configure Claude Desktop to use the HTTP transport (refer to Claude Desktop documentation for HTTP transport configuration).

Note: Update the path in the args array to match the actual location where you've installed this server.

After updating the configuration, restart Claude Desktop for the changes to take effect.

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.

Available Tools

3 tools
fetch_iiif_imageA

Retrieve a IIIF image from a base URI, fetching info.json and returning the image data scaled to roughly 1M pixels total area.

ParametersJSON Schema
NameRequiredDescriptionDefault
baseUriYesBase URI of the IIIF Image API resource (without /info.json)

TDQS

A4/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the tool's process ('fetching info.json and returning the image data scaled to roughly 1M pixels total area'), which adds valuable context about scaling behavior. However, it doesn't mention potential errors, rate limits, authentication needs, or what happens with invalid URIs, leaving some behavioral aspects unclear.

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 a single, well-structured sentence that efficiently conveys the tool's purpose, process, and scaling behavior. Every element earns its place with no wasted words, and the information is appropriately front-loaded.

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 single-parameter tool with no annotations and no output schema, the description provides good coverage of what the tool does and its scaling behavior. However, it doesn't describe the return format (image data type, structure) or error handling, which would be helpful given the absence of output schema. The description is mostly complete but has minor gaps.

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?

The schema description coverage is 100%, so the schema already documents the single parameter thoroughly. The description doesn't add any additional parameter semantics beyond what's in the schema (base URI format, exclusion of /info.json). This meets the baseline expectation when schema coverage is complete.

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 the specific action ('Retrieve'), resource ('IIIF image'), and scope ('from a base URI'). It distinguishes from siblings by focusing on full image retrieval rather than region extraction (fetch_iiif_image_region) or manifest fetching (fetch_iiif_manifest). The description goes beyond just restating the name by specifying the operational details.

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 clear context about when to use this tool ('Retrieve a IIIF image from a base URI') and implicitly distinguishes from fetch_iiif_image_region (which handles regions) and fetch_iiif_manifest (which handles manifests). However, it doesn't explicitly state when NOT to use this tool or name alternatives, keeping it from a perfect score.

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

fetch_iiif_image_regionA

Retrieve a specific region of a IIIF image using percentage coordinates, with the region scaled to roughly 1M pixels total area. Use this to fetch regions of interest at higher detail for more accurate image description and analysis.

ParametersJSON Schema
NameRequiredDescriptionDefault
baseUriYesBase URI of the IIIF Image API resource (without /info.json)
regionYesRegion in pct: format (e.g., 'pct:20,20,50,50' for x,y,width,height as percentages)

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context about scaling to 1M pixels and the purpose for higher detail, but it does not cover aspects like rate limits, authentication needs, error handling, or response format, leaving gaps in behavioral understanding.

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 appropriately sized and front-loaded, with two sentences that efficiently convey the tool's purpose and usage without any wasted words. Each sentence adds value, making it concise and well-structured.

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

Completeness3/5

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

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is adequate but incomplete. It explains the purpose and scaling behavior but lacks details on output format, error cases, or integration with sibling tools, which could hinder agent effectiveness in some scenarios.

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 both parameters fully. The description adds some semantic context by mentioning percentage coordinates and the scaling effect, but it does not provide additional syntax or format details beyond what the schema specifies, meeting the baseline for high coverage.

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 the tool's purpose with specific verbs ('Retrieve', 'fetch') and resources ('specific region of a IIIF image'), distinguishing it from sibling tools by specifying percentage coordinates and scaling to 1M pixels. It explicitly mentions the use case for higher detail in image description and analysis.

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 clear context on when to use this tool ('to fetch regions of interest at higher detail for more accurate image description and analysis'), but it does not explicitly state when not to use it or name alternatives like the sibling 'fetch_iiif_image' tool for full images.

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

fetch_iiif_manifestC

Fetch and validate a IIIF manifest from a URL

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesURL of the IIIF manifest to fetch

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'fetch and validate,' implying network I/O and validation logic, but doesn't specify error handling, timeout behavior, authentication needs, rate limits, or what validation entails. This leaves significant gaps for a tool that interacts with external URLs.

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 a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it highly concise and well-structured for quick understanding.

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

Completeness2/5

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

Given the tool's complexity (fetching and validating external resources) and lack of annotations or output schema, the description is insufficient. It doesn't explain return values, error conditions, or behavioral traits like network reliability, leaving the agent with incomplete context for safe and effective use.

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?

The input schema has 100% description coverage, with the 'url' parameter well-documented. The description adds no additional parameter details beyond what the schema provides, such as URL format constraints or validation rules. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('fetch and validate') and resource ('IIIF manifest from a URL'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'fetch_iiif_image' or 'fetch_iiif_image_region', which likely handle different IIIF resources.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus its siblings (e.g., for manifests vs. images/regions) or any prerequisites. It lacks explicit when/when-not instructions or alternative recommendations.

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. 3 tool updatesv1.0.0
    • First observedfetch_iiif_image
    • First observedfetch_iiif_image_region
    • First observedfetch_iiif_manifest

TDQS

B3.4/5.0

Scored across 3 tools

Disambiguation4/5

The tools are mostly distinct: fetch_iiif_image retrieves full images, fetch_iiif_image_region handles specific regions, and fetch_iiif_manifest deals with manifests. However, the first two tools could be confused as both fetch images, though the region variant is clearly specialized for partial extraction.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with 'fetch_iiif_' prefix, using snake_case uniformly. This predictability makes it easy for agents to understand and select the right tool.

Tool Count3/5

With only 3 tools, the set feels thin for a full IIIF image server, lacking operations like listing resources, updating metadata, or handling annotations. While it covers basic fetching, the scope is limited and may require workarounds for common workflows.

Completeness2/5

The tool surface is severely incomplete for IIIF image handling. It only supports fetching images, regions, and manifests, missing essential CRUD operations such as creating, updating, or deleting resources, and lacks tools for searching or managing collections, which are core to the IIIF domain.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers