@cyanheads/libofcongress-mcp-server

v0.2.5 pre-1.0

Search LOC digital collections, browse Chronicling America newspapers with full OCR text, and look up LC Subject Headings via MCP. STDIO or Streamable HTTP.

@cyanheads/libofcongress-mcp-server
claude mcp add --transport http libofcongress-mcp-server https://libofcongress.caseyjhand.com/mcp
codex mcp add libofcongress-mcp-server --url https://libofcongress.caseyjhand.com/mcp
{
  "mcpServers": {
    "libofcongress-mcp-server": {
      "url": "https://libofcongress.caseyjhand.com/mcp"
    }
  }
}
gemini mcp add --transport http libofcongress-mcp-server https://libofcongress.caseyjhand.com/mcp
{
  "mcpServers": {
    "libofcongress-mcp-server": {
      "command": "bunx",
      "args": [
        "@cyanheads/libofcongress-mcp-server@latest"
      ]
    }
  }
}
{
  "mcpServers": {
    "libofcongress-mcp-server": {
      "type": "http",
      "url": "https://libofcongress.caseyjhand.com/mcp"
    }
  }
}
curl -X POST https://libofcongress.caseyjhand.com/mcp \
  -H "Content-Type: application/json" \
  -H "MCP-Protocol-Version: 2025-11-25" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0.0"}}}'

Tools

6

libofcongress_get_item

open-world

Retrieve the full metadata record for a specific LOC digital item. Returns contributors, subjects, rights information, physical description, notes, related items, and links to digital resources (TIFF, JPEG, PDF) for items with digital surrogates. Use after libofcongress_search to get complete details on a result. Pass the bare item ID from the search result — do not include URL path segments.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "libofcongress_get_item",
    "arguments": {
      "item_id": "<item_id>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "item_id": {
      "type": "string",
      "minLength": 1,
      "description": "LOC item ID from a libofcongress_search result's \"id\" field (e.g., \"loc.pnp.ppmsc.02404\" or \"2009632251\"). Pass the bare ID only — no URL path segments."
    }
  },
  "required": [
    "item_id"
  ],
  "additionalProperties": false
}
view source ↗

libofcongress_search_newspapers

open-world

Search historical newspaper pages in the Chronicling America corpus. Returns matching pages with OCR text excerpts (~500 characters), publication title, date, state, and the page URL needed for libofcongress_get_newspaper_page. Filters by keyword, date range, US state, and newspaper title. The OCR excerpts are sufficient for relevance assessment — call libofcongress_get_newspaper_page with the returned url field to read the full page text. OCR quality varies: 19th-century and degraded materials may contain fragmented or garbled text.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "libofcongress_search_newspapers",
    "arguments": {
      "query": "<query>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Keyword search across OCR text and newspaper metadata."
    },
    "date_start": {
      "description": "Start year for date filter, inclusive (e.g., 1900). Omit for no lower bound.",
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "date_end": {
      "description": "End year for date filter, inclusive (e.g., 1920). Omit for no upper bound.",
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "state": {
      "description": "Filter to newspapers published in this US state. Use the full state name, lowercase (e.g., \"oklahoma\", \"new york\").",
      "type": "string"
    },
    "newspaper_title": {
      "description": "Filter to a specific newspaper by title (partial match accepted).",
      "type": "string"
    },
    "limit": {
      "default": 25,
      "description": "Results per page. Default 25, max 100.",
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "page": {
      "default": 1,
      "description": "1-indexed page number for paginating results.",
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "query",
    "limit",
    "page"
  ],
  "additionalProperties": false
}
view source ↗

libofcongress_get_newspaper_page

open-world

Retrieve the full OCR text of a specific historical newspaper page along with publication metadata. Pass the url field from a libofcongress_search_newspapers result — do not construct this URL manually. OCR quality varies by digitization batch and era: 19th-century and degraded materials may contain fragmented text, garbled words, and line-break artifacts that are surfaced as-is. When a page exists but has no digitized text, ocr_available is false and ocr_text is empty — this is a data property, not an error.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "libofcongress_get_newspaper_page",
    "arguments": {
      "page_url": "<page_url>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "page_url": {
      "type": "string",
      "description": "The url field from a libofcongress_search_newspapers result (e.g., \"https://www.loc.gov/resource/sn83045462/1905-03-15/ed-1/seq-1/\"). Always pass the value directly from search results — do not construct or modify this URL."
    }
  },
  "required": [
    "page_url"
  ],
  "additionalProperties": false
}
view source ↗

libofcongress_search_subjects

open-world

Search Library of Congress Subject Headings (LCSH) by keyword. Returns controlled-vocabulary subject labels and their URIs. Use the returned label as the subject filter in libofcongress_search — LCSH uses precise, standardized terms that differ from natural language (e.g., "World War, 1939-1945" not "World War II"; "Photography, Aerial" not "Aerial photography"). Running this tool before a subject-filtered libofcongress_search dramatically improves result quality.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "libofcongress_search_subjects",
    "arguments": {
      "query": "<query>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Keyword or partial subject heading to search for (e.g., \"civil war\", \"immigration\", \"jazz\")."
    },
    "limit": {
      "default": 10,
      "description": "Maximum number of subject headings to return. Default 10, max 50.",
      "type": "integer",
      "minimum": 1,
      "maximum": 50
    }
  },
  "required": [
    "query",
    "limit"
  ],
  "additionalProperties": false
}
view source ↗

libofcongress_browse_collections

open-world

List and browse Library of Congress curated digital collections. Returns collection names, descriptions, item counts, slugs, and URLs. Optionally filter by keyword. Collections are curated subsets of the digital holdings with specific focuses (e.g., "Civil War Glass Negatives", "Baseball Cards", "WPA Posters"). Use the returned URL to navigate directly to a collection on loc.gov.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "libofcongress_browse_collections",
    "arguments": {}
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "query": {
      "description": "Optional keyword to filter collections by name or description. Omit to list all collections.",
      "type": "string"
    },
    "limit": {
      "default": 25,
      "description": "Maximum number of collections to return. Default 25, max 100.",
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "page": {
      "default": 1,
      "description": "1-indexed page number for paginating results.",
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "limit",
    "page"
  ],
  "additionalProperties": false
}
view source ↗

Resources

1

LOC digital item metadata by ID. Returns the same full record as libofcongress_get_item. Use libofcongress_search to discover item IDs first.

uri libofcongress://item/{item_id} mime application/json