Skip to main content
Glama
tobbaz

swedish-portrait-archive-mcp

by tobbaz

Swedish Portrait Archive MCP Server (swedish-portrait-archive-mcp)

A Model Context Protocol (MCP) server for searching and retrieving historical Swedish portraits, biographies, and printed matrikel sources from Svenskt Porträttarkiv (Swedish Portrait Archive).

Svenskt Porträttarkiv contains over one million portraits scanned from printed Swedish biographical collections, military rolls, professional directories, and anniversary publications from the 19th and 20th centuries.


Features

  • Historical Portrait Search (search-portraits): Search by first name, last name, birth/death year, birth parish/county, occupation, and free-text queries.

  • Biographical Details & Transcriptions (get-portrait-details): Fetch full biographical texts, printed book references, Swedish Death Index cross-references (Sveriges Dödbok ID), and formatted genealogical citations.

  • Direct Image Access (get-portrait-image): Generate direct URLs to high-resolution portrait scans (JPEG) and online archive records.

  • Genney Compatibility: Produces ready-to-paste citation blocks designed for Swedish genealogical software (Genney).


Related MCP server: KB MCP Server

Ethics, Politeness & Fair Use

Svenskt Porträttarkiv is operated as a volunteer, non-profit community initiative founded by Omar Henriksson. To ensure respectful, fair, and responsible integration, this MCP server adheres to strict ethical guidelines:

  1. Strict Rate Limiting (RequestQueue): All outgoing network requests are queued sequentially with an enforced delay of at least 400 ms (+ randomized jitter) between requests.

  2. Transparent User-Agent: Every request identifies itself clearly:

    User-Agent: SwedishPortraitArchiveMCP/1.0 (+https://github.com/tobbaz/swedish-portrait-archive-mcp)
  3. No Bulk Scraping: The tools operate exclusively on-demand for targeted genealogical queries. The server does not support mass harvesting or mirroring of the archive.

  4. Attribution & Licensing:

    • Individual portraits and biographical texts are generally licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0).

    • The composite archive collection is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0).

    • Every search result and detail query provides direct links back to the original entry at https://portrattarkiv.se/details/{id}.


MCP Tools

1. search-portraits

Searches the archive for portraits matching given genealogical parameters.

Parameter

Type

Description

firstName

string (optional)

Given name (e.g. "Emanuel" or "Carl August")

lastName

string (optional)

Surname (e.g. "Kastengren" or "Lindahl")

birthYear

string | number (optional)

Birth year (e.g. 1826)

deathYear

string | number (optional)

Death year (e.g. 1904)

birthPlace

string (optional)

Parish, town or county of birth

occupation

string (optional)

Occupation or title (e.g. "Löjtnant", "Veterinär")

employmentPlace

string (optional)

Workplace or place of residence

query

string (optional)

Free-text search across all metadata

limit

number (optional)

Results limit (default: 20, max: 100)

from

number (optional)

Pagination offset

2. get-portrait-details

Retrieves full details for a portrait record.

Parameter

Type

Description

portraitId

string (required)

Portrait unique ID (e.g. "sj9PGLAlnmUAAAAAABlg4w")

Returns transcribed biographies, source collections/books, Sveriges Dödbok ID, and a Genney-formatted citation.

3. get-portrait-image

Returns direct links to the high-resolution JPEG image and archive web page.

Parameter

Type

Description

portraitId

string (required)

Portrait unique ID


Installation & Building

Prerequisites

  • Node.js 18+ or 20+

  • npm

Setup

git clone https://github.com/tobbaz/swedish-portrait-archive-mcp.git
cd swedish-portrait-archive-mcp
npm install
npm run build

Running Tests

npm test

MCP Configuration

Antigravity / Claude Desktop Configuration

Add the server to your mcp_config.json (or claude_desktop_config.json):

{
  "mcpServers": {
    "swedish-portrait-archive": {
      "command": "node",
      "args": [
        "/absolute/path/to/swedish-portrait-archive-mcp/build/index.js"
      ]
    }
  }
}

License

  • Code: Released under the MIT License.

  • Archive Data & Portraits: Provided by Svenskt Porträttarkiv under Creative Commons licenses (CC BY-SA 4.0 / CC BY-NC-SA 4.0).

Available Tools

3 tools
get-portrait-detailsA

Retrieve comprehensive metadata, transcribed biography, book citation, vital statistics, and Genney-ready citation snippet for a specific portrait ID.

ParametersJSON Schema
NameRequiredDescriptionDefault
portraitIdYesThe unique portrait identifier (e.g. "sj9PGLAlnmUAAAAAABlg4w")

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the behavioral burden. The verb 'Retrieve' signals a read-only operation, and the description discloses the returned content categories, including the Genney citation format. It does not cover error/null behavior, but that is a minor gap for a simple get-by-ID tool.

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?

One compact, front-loaded sentence with no filler. It names the action and the full set of returned data efficiently. Every phrase adds useful signal.

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 one-parameter read tool with no output schema, the description is nearly complete: it names the resource, the key, and the returned content. It could explicitly route users to search-portraits when no ID is known, but that is not essential for correct invocation.

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 single parameter portraitId is already fully described in the input schema with an example, and schema description coverage is 100%. The tool description adds no additional parameter-level meaning, so the baseline score of 3 applies.

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 uses a specific verb, 'Retrieve,' and a specific resource, 'portrait details,' keyed by a portrait ID. It also enumerates the payload (metadata, biography, citation, vital statistics, Genney-ready snippet), which clearly distinguishes it from the sibling get-portrait-image tool.

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 makes clear it applies to a specific known portraitId and is meant for fetching detail records. It does not explicitly state when to use search-portraits instead or exclude image retrieval, but the intended context is implied well enough.

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

get-portrait-imageB

Get direct high-resolution image URL (JPEG) and web page links for a portrait by its identifier.

ParametersJSON Schema
NameRequiredDescriptionDefault
portraitIdYesThe unique portrait identifier (e.g. "sj9PGLAlnmUAAAAAABlg4w")

TDQS

B3.3/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. It only lists the returned items ('image URL' and 'links') but does not disclose any behavioral traits such as read-only status, potential errors, rate limits, or whether the URL is temporary or direct. No safety or side-effect information is given.

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 clear sentence with no filler. It front-loads the primary action and outputs, and every word earns its place.

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?

For a simple one-parameter tool, the description states the return types ('image URL' and 'web page links'), but lacks detail on the response structure (e.g., whether it is a single URL or an object with multiple links), error conditions, or any additional fields. No output schema exists, so the description is expected to cover return semantics more fully. This is adequate but leaves ambiguity.

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 already describes portraitId fully with an example. The description's phrase 'by its identifier' adds little beyond the schema. Since schema coverage is 100%, the baseline of 3 is appropriate; the description does not contribute significant extra parameter meaning.

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 uses a specific verb 'Get' and names the exact outputs ('direct high-resolution image URL (JPEG) and web page links') and input ('by its identifier'). This clearly distinguishes it from sibling tools like search-portraits and get-portrait-details, even without naming them.

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?

No guidance is given on when to use this tool versus alternatives. It does not state prerequisites (e.g., 'use after search-portraits to obtain an identifier') or explain when to prefer get-portrait-details instead. The intended usage is only implicit through the phrase 'by its identifier'.

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

search-portraitsA

Search Svenskt Porträttarkiv (Swedish Portrait Archive) for historical portraits by name, birth/death year, birth place, occupation, or free text. Returns matched individuals with ID, book source, biographical snippet, and links.

ParametersJSON Schema
NameRequiredDescriptionDefault
fromNoOffset index for pagination (default: 0)
limitNoMaximum number of results to return (default: 20, max: 100)
queryNoGeneral free-text search across all indexed metadata
lastNameNoSurname/family name to search for (e.g. "Kastengren" or "Lindahl")
birthYearNoYear of birth (e.g. 1826 or "1826")
deathYearNoYear of death (e.g. 1904 or "1904")
firstNameNoGiven/first name to search for (e.g. "Emanuel" or "Carl August")
birthPlaceNoParish, town or county of birth (e.g. "Säbyholm", "Everöd", "Helsingborg")
occupationNoOccupation, profession or title (e.g. "Veterinär", "Löjtnant", "Bokhållare")
employmentPlaceNoPlace of employment or residence

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose the data source and result shape (matched individuals with ID, book source, biographical snippet, and links), but it leaves unspecified behaviors such as how multiple filters combine, whether an empty query is allowed, and how pagination works.

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?

Two sentences with no filler: the first states the action and criteria, the second summarizes the return values. Every clause carries information and the description avoids simply restating the tool name.

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?

The description covers core purpose and output, and the schema documents all 10 parameters, so a basic invocation is feasible. However, because there is no output schema and no annotations, the description leaves gaps around filter combination semantics, empty-query behavior, and pagination interactions.

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?

Input schema coverage is 100% and every parameter already has a meaningful description, so the schema does the heavy lifting. The prose adds a useful category-level overview of the search criteria but does not need to repeat parameter-level details.

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 uses a specific verb ('Search'), names the resource ('Svenskt Porträttarkiv'), and enumerates the search dimensions (name, birth/death year, birth place, occupation, free text). It clearly describes what results come back, but it does not explicitly differentiate itself from the sibling tools get-portrait-details and get-portrait-image.

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

Usage Guidelines3/5

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

The intended use is implied: call this tool to search the portrait archive for matching individuals, presumably before fetching details or images. However, the description never states when not to use it or names the alternatives, so routing to siblings is left to inference.

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 observedget-portrait-details
    • First observedget-portrait-image
    • First observedsearch-portraits

TDQS

A4/5.0

Scored across 3 tools

Disambiguation5/5

Each tool addresses a distinct stage of the workflow: searching for individuals, retrieving detailed metadata for a selected portrait, and fetching the image URL. There is no overlap or ambiguity between these three operations.

Naming Consistency5/5

All tool names follow a consistent lowercase hyphenated verb_noun pattern: search-portraits, get-portrait-details, get-portrait-image. The pattern is predictable and uniform across the set.

Tool Count5/5

Three tools is a perfectly concise scope for this server: search, retrieve details, and retrieve image. Each tool has a clear purpose and none feel redundant or missing.

Completeness5/5

The tool set covers the full user journey for the domain: discovering portraits via search, inspecting detailed metadata and citations, and obtaining the actual image. No obvious operational gaps exist for the stated purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Enables users to search and access digital collections from the Swedish National Archives (Riksarkivet) through multiple APIs. Supports searching records by keywords, exploring collections, and downloading historical images and documents.
    2
    24
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides access to Sweden's National Library (Kungliga biblioteket) open APIs, enabling search and retrieval of 20M+ bibliographic records, 10M+ cultural heritage objects, 2M+ research publications, and linked data through 52 tools across 10 endpoints.
    2
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables full-text search and retrieval of Kansallisarkisto's machine-transcribed archival corpora, including medieval charters from Diplomatarium Fennicum, with filters and stemming support.
    Apache 2.0