historical-investigator-mcp
Enables searching and retrieving historical records from the Library of Congress, including newspapers, photos, maps, manuscripts, audio, and film, via the Model Context Protocol.
README
Historical Investigator MCP
A beginner-friendly Model Context Protocol (MCP) server that searches historical records from the Library of Congress APIs.
Built with TypeScript, Node.js, the official @modelcontextprotocol/sdk, and zod for input validation.
Setup
npm install
npm run build
Running the server
The server communicates over stdio (standard for MCP):
npm start
Cursor / MCP client configuration
Add this to your MCP settings (for example in Cursor):
{
"mcpServers": {
"historical-investigator": {
"command": "node",
"args": ["/absolute/path/to/historical-investigator-mcp/dist/index.js"]
}
}
}
Replace the path with your local clone of this project.
Tools
1. search_historical_newspapers
Search historical newspaper records from Chronicling America via the Library of Congress API.
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | yes | Search keywords |
state |
string | no | US state name or abbreviation |
dateStart |
string | no | Start date (YYYY-MM-DD) |
dateEnd |
string | no | End date (YYYY-MM-DD) |
limit |
number | no | Max results (1–100, default 20) |
Example prompt: “Search Chronicling America for articles about the San Francisco earthquake in California between 1906-04-01 and 1906-04-30.”
Uses the Chronicling America collection endpoint with:
q— keyword searchfa=location:{state}— state filter (e.g.location:california)start_date/end_date— date range (YYYY-MM-DD)c— result limitfo=json— JSON response
The response includes a requestUrl field with the exact LOC API URL used, which helps with debugging.
Date filtering limitation: The LOC API accepts start_date and end_date, but results are not always strictly limited to that range. You may see newspaper pages from nearby dates (or later years) when the search terms appear in OCR text. If you need an exact date window, check each result’s date field and filter client-side.
2. get_newspaper_item
Fetch metadata for a specific LOC item or resource.
| Parameter | Type | Required | Description |
|---|---|---|---|
itemIdOrUrl |
string | yes | Item ID (e.g. 2014717546) or full loc.gov URL |
Example prompt: “Get metadata for LOC item 2014717546.”
3. fetch_page_ocr_text
Download raw OCR plain text from a URL (often found in item metadata).
| Parameter | Type | Required | Description |
|---|---|---|---|
ocrTextUrl |
string | yes | URL to the OCR text file |
Example prompt: “Fetch the OCR text from this URL: …”
Returns plain text. Errors are handled safely and reported back to the client.
4. search_prints_and_photographs
Search prints and photographs in the LOC collections.
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | yes | Search keywords |
limit |
number | no | Max results (1–100, default 20) |
Uses: https://www.loc.gov/photos/ with fo=json.
5. search_maps
Search map records in the LOC collections.
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | yes | Search keywords |
limit |
number | no | Max results (1–100, default 20) |
Uses: https://www.loc.gov/maps/ with fo=json.
6. search_manuscripts
Search manuscript records in the LOC collections.
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | yes | Search keywords |
limit |
number | no | Max results (1–25, default 10) |
Uses: https://www.loc.gov/manuscripts/ with fo=json.
Returns trimmed fields: title, date, contributor, description, subjects, and item link.
7. search_audio_recordings
Search audio recordings in the LOC collections.
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | yes | Search keywords |
limit |
number | no | Max results (1–25, default 10) |
Uses: https://www.loc.gov/audio/ with fo=json.
Returns trimmed fields: title, date, contributors, description, subjects, and item link.
8. search_film_and_video
Search film and video records in the LOC collections.
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | yes | Search keywords |
limit |
number | no | Max results (1–25, default 10) |
Uses: https://www.loc.gov/film-and-videos/ with fo=json.
Returns trimmed fields: title, date, contributors, description, subjects, and item link.
9. get_item_resources
Fetch a specific LOC item or resource and return digital files when available.
| Parameter | Type | Required | Description |
|---|---|---|---|
itemIdOrUrl |
string | yes | Item ID, resource path, or full loc.gov URL |
Returns title, date, item link, resources/files/images/OCR links when present. If nothing is digitized, returns a helpful message.
10. compare_historical_sources
Compare two LOC records side by side using metadata only (no AI summarization).
| Parameter | Type | Required | Description |
|---|---|---|---|
itemIdOrUrl1 |
string | yes | First item ID or full loc.gov URL |
itemIdOrUrl2 |
string | yes | Second item ID or full loc.gov URL |
Returns both records (title, date, location, contributors, subjects, description, link) plus a comparison object with same_year, shared_subjects, and source_types.
Project structure
historical-investigator-mcp/
├── src/
│ └── index.ts # MCP server and LOC API helpers
├── package.json
├── tsconfig.json
├── README.md
└── .gitignore
API notes
- All LOC requests use
fo=jsonfor JSON responses. - Newspaper searches use
q, optionalfa=location:..., and optionalstart_date/end_dateon the Chronicling America collection endpoint. - Photo and map searches use the
/photos/and/maps/format endpoints withqandc. - Manuscript, audio, and film searches use
/manuscripts/,/audio/, and/film-and-videos/with trimmed result fields. get_item_resourcesandcompare_historical_sourcesfetch item metadata withfo=json.- No API key is required for the public LOC JSON/YAML API.
- State values can be full names (
California) or abbreviations (CA); both are normalized to LOC location facets.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。