# libofcongress-mcp-server

Connects AI assistants to Library of Congress digital archives, Chronicling America historical newspapers with OCR, and LCSH subject headings.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 5
- Author: cyanheads
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/cyanheads/libofcongress-mcp-server
- Updated: 2026-10-17
- HTML: https://affpapa.org/en/nevibecode/mcp/libofcongress-mcp-server

## What it does

This server connects agents to digitized collections from the Library of Congress and the Chronicling America newspaper archive. It provides six tools and one resource URI (`libofcongress://item/{+item_id}`) to inject catalog metadata directly into conversation context. Catalog queries support filters across eight formats, including photos, maps, audio, films, books, and manuscripts.

Newspaper searches return only an initial snippet of roughly 500 characters from the OCR text. Reading the full page or extracting sentences around a specific keyword requires calling `libofcongress_get_newspaper_page` with a `match` parameter. The catalog search caps results at 100 entries per request, ignoring larger limits up to 1000 with a notice. The collection filter cannot be combined with a format filter.

Users can run the server locally through `npx` or point directly to the public hosted HTTP endpoint. The hosted setup needs no local runtime configuration.

## Requirements
- Needs: Node.js (commands run via npx)
- Remote server: `https://libofcongress.caseyjhand.com/mcp`
- Environment variables: `LOC_USER_AGENT`, `LOC_REQUEST_DELAY_MS`, `MCP_LOG_LEVEL`, `MCP_SESSION_MODE`, `MCP_TRANSPORT_TYPE`, `MCP_HTTP_HOST`, `MCP_HTTP_PORT`, `MCP_HTTP_ENDPOINT_PATH`, `MCP_AUTH_MODE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

1. **Platform CLI: remote server**
```bash
claude mcp add --transport http libofcongress-mcp-server https://libofcongress.caseyjhand.com/mcp
```

2. **Platform CLI**
```bash
claude mcp add --env LOC_USER_AGENT=<LOC_USER_AGENT> --env LOC_REQUEST_DELAY_MS=<LOC_REQUEST_DELAY_MS> --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> --env MCP_SESSION_MODE=<MCP_SESSION_MODE> --env MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> --transport stdio libofcongress-mcp-server -- npx -y @cyanheads/libofcongress-mcp-server
```
Replace <…> with your own values. 4 more environment variables are in the server README

### Codex

1. **Platform CLI: remote server**
```bash
codex mcp add libofcongress-mcp-server --url https://libofcongress.caseyjhand.com/mcp
```

2. **Platform CLI**
```bash
codex mcp add libofcongress-mcp-server --env LOC_USER_AGENT=<LOC_USER_AGENT> --env LOC_REQUEST_DELAY_MS=<LOC_REQUEST_DELAY_MS> --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> --env MCP_SESSION_MODE=<MCP_SESSION_MODE> --env MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> -- npx -y @cyanheads/libofcongress-mcp-server
```
Replace <…> with your own values. 4 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "libofcongress-mcp-server": {
            "url": "https://libofcongress.caseyjhand.com/mcp"
        }
    }
}
```
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "libofcongress-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@cyanheads/libofcongress-mcp-server"
            ],
            "env": {
                "LOC_USER_AGENT": "<LOC_USER_AGENT>",
                "LOC_REQUEST_DELAY_MS": "<LOC_REQUEST_DELAY_MS>",
                "MCP_LOG_LEVEL": "<MCP_LOG_LEVEL>",
                "MCP_SESSION_MODE": "<MCP_SESSION_MODE>",
                "MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>"
            }
        }
    }
}
```
Replace <…> with your own values. 4 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "libofcongress-mcp-server": {
            "type": "http",
            "url": "https://libofcongress.caseyjhand.com/mcp"
        }
    }
}
```
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "libofcongress-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@cyanheads/libofcongress-mcp-server"
            ],
            "env": {
                "LOC_USER_AGENT": "<LOC_USER_AGENT>",
                "LOC_REQUEST_DELAY_MS": "<LOC_REQUEST_DELAY_MS>",
                "MCP_LOG_LEVEL": "<MCP_LOG_LEVEL>",
                "MCP_SESSION_MODE": "<MCP_SESSION_MODE>",
                "MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>"
            }
        }
    }
}
```
Replace <…> with your own values. 4 more environment variables are in the server README

### Gemini CLI

1. **Platform CLI: remote server**
```bash
gemini mcp add -t http libofcongress-mcp-server https://libofcongress.caseyjhand.com/mcp
```

2. **Platform CLI**
```bash
gemini mcp add -e LOC_USER_AGENT=<LOC_USER_AGENT> -e LOC_REQUEST_DELAY_MS=<LOC_REQUEST_DELAY_MS> -e MCP_LOG_LEVEL=<MCP_LOG_LEVEL> -e MCP_SESSION_MODE=<MCP_SESSION_MODE> -e MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> libofcongress-mcp-server npx -y @cyanheads/libofcongress-mcp-server
```
Replace <…> with your own values. 4 more environment variables are in the server README

## When to use it
- Search Library of Congress digital archives by format, location, and date
- Extract OCR transcripts and contextual passages from historic US newspapers
- Resolve standardized Library of Congress Subject Headings for research
- Retrieve structured bibliographic metadata, rights details, and media links

## Example prompts
- Search the Library of Congress catalog for panoramic maps of Chicago published between 1870 and 1890.
- Find articles mentioning the influenza pandemic in Kansas newspapers from late 1918.
- Retrieve metadata and direct download files for item `sn95047246/1935-09-05/ed-1`.

## Similar
- [Zotero MCP](https://affpapa.org/en/nevibecode/mcp/zotero-mcp.md) — MCP server · ★ 5585
- [arxiv-mcp-server](https://affpapa.org/en/nevibecode/mcp/arxiv-mcp-server.md) — MCP server · ★ 3235
- [PaperBanana](https://affpapa.org/en/nevibecode/mcp/paperbanana.md) — MCP server · ★ 2418
- [MATLAB MCP Server](https://affpapa.org/en/nevibecode/mcp/matlab-mcp-server.md) — MCP server · ★ 1723
- [Hex Research](https://affpapa.org/en/nevibecode/mcp/hex-research.md) — MCP server · ★ 584
- [DocsAgent — Zotero, Obsidian & Apple Notes MCP Server](https://affpapa.org/en/nevibecode/mcp/docsagent-zotero-obsidian-apple-notes-mcp-server.md) — MCP server · ★ 578

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
