关于 Northwestern University Libraries Digital Collections API
面向探索 Northwestern University Libraries 数字馆藏的助手提供 MCP 服务,支持检索数字化资料、发现相似作品、浏览馆藏、获取元数据及 IIIF 清单。
主要功能
- 01字段与自然语言检索
- 02视觉与语义相似检索
- 03获取作品元数据
- 04查看作品与馆藏 IIIF 清单
- 05浏览数字馆藏
适用场景
- 01按查询查找数字化作品
- 02发现视觉或语义相似作品
- 03获取指定作品的元数据
- 04在 IIIF 查看器中浏览馆藏
MCP 相关
将数字馆藏的检索、浏览、元数据和 IIIF 操作作为 MCP 工具提供。可通过 Streamable HTTP 连接托管端点。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://api.dc.library.northwestern.edu/api/v2/mcpclaude mcp add --transport http nulib-dc-api https://api.dc.library.northwestern.edu/api/v2/mcp{"mcpServers":{"nulib-dc-api":{"type":"http","url":"https://api.dc.library.northwestern.edu/api/v2/mcp"}}}在 Cursor 中打开{"servers":{"nulib-dc-api":{"type":"http","url":"https://api.dc.library.northwestern.edu/api/v2/mcp"}}}在 VS Code 中打开{"mcpServers":{"nulib-dc-api":{"type":"http","url":"https://api.dc.library.northwestern.edu/api/v2/mcp"}}}{"mcpServers":{"nulib-dc-api":{"serverUrl":"https://api.dc.library.northwestern.edu/api/v2/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
8| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| page | number | 否 | 要返回的搜索结果页 |
| query | string | 否 | 自然语言查询。适用于探索性/概念性搜索。 |
| fields | object | 否 | 结构化字段搜索。适用于搜索已知的特定项目或值,或通过指定要搜索的字段来缩小搜索范围。 |
| fields.text | string | 否 | 与作品关联的全文 |
| fields.genre | string | 否 | 描述原始对象是什么,而非其主题内容 |
| fields.notes | string | 否 | 与作品关联的备注 |
| fields.title | string | 否 | 作品的标题 |
| fields.caption | string | 否 | 作品的说明文字 |
| fields.creator | string | 否 | 主要负责创作该作品的实体 |
| fields.license | enum | 否 | 作品的 Creative Commons 许可证All rights reserved | Attribution 3.0 United States | Attribution 4.0 International | Attribution-NoDerivatives 4.0 International | Attribution-NoDerivs 3.0 United States | Attribution-NonCommercial 3.0 United States | Attribution-NonCommercial 4.0 International | Attribution-NonCommercial-NoDerivatives 4.0 International | Attribution-NonCommercial-NoDerivs 3.0 United States | Attribution-NonCommercial-ShareAlike 3.0 United States | Attribution-NonCommercial-ShareAlike 4.0 International | Attribution-ShareAlike 3.0 United States | Attribution-ShareAlike 4.0 International | CC0 1.0 Universal | Public Domain Mark 1.0 |
| fields.subject | string | 否 | 作品的主题 |
| fields.abstract | string | 否 | 作品摘要 |
| fields.keywords | string | 否 | 用于描述此内容的关键词或标签 |
| fields.language | string | 否 | 作品所用语言 |
| fields.location | string | 否 | 出版地点 |
| fields.publisher | string | 否 | 负责提供该作品的实体 |
| fields.technique | string | 否 | 作品的创作技法 |
| fields.work_type | enum | 否 | 作品的类型Audio | Image | Video |
| fields.collection | string | 否 | 作品所属的父级合集 |
| fields.contributor | string | 否 | 负责对作品作出贡献的实体 |
| fields.description | string | 否 | 作品的说明 |
| fields.library_unit | enum | 否 | 负责该作品的图书馆部门Special Collections | Faculty Collections | Government and Geographic Information Collection | Herskovits Library | Music Library | Transportation Library | University Archives | University Main Library |
| fields.style_period | string | 否 | 作品中体现其特征的特定风格、历史时期、群体、流派、王朝、运动等。 |
| fields.alternate_title | string | 否 | 作品的其他标题 |
| fields.controlled_terms | string | 否 | 作品在所有字段中关联的全部受控词。可用于同时搜索所有受控字段,而无需指定字段。 |
| fields.rights_statement | enum | 否 | 作品的权利声明Copyright Not Evaluated | Copyright Undetermined | In Copyright | In Copyright - Educational Use Permitted | In Copyright - EU Orphan Work | In Copyright - Non-Commercial Use Permitted | In Copyright - Rights-holder(s) Unlocatable or Unidentifiable | No Copyright - Contractual Restrictions | No Copyright - Non-Commercial Use Only | No Copyright - Other Known Legal Restrictions | No Copyright - United States | No Known Copyright |
| fields.table_of_contents | string | 否 | 用于提供资源中独立作品或部分内容的标题。所提供的信息还可能包含责任说明或其他顺序标识。 |
| max_results | number | 否 | 每页返回的搜索结果数上限 |
| public_only | boolean | 否 | 搜索结果中仅包含公开可用的作品 |
详细介绍
dc-api-mcp
一个 Model Context Protocol (MCP) 服务,将西北大学图书馆的 Digital Collections 提供为 AI 助手可用的工具。它提供用于搜索、浏览以及获取数字化馆藏资料的元数据和 IIIF 清单的工具。
可用工具
| 工具 | 描述 |
|---|---|
search | 使用基于字段和/或自然语言的查询搜索作品 |
similarity-search | 查找在视觉或语义上与指定作品相似的作品 |
get-work | 按 ID 获取单件作品的完整元数据 |
view-work | 查看作品的 IIIF 清单,以便在兼容的查看器中显示 |
list-collections | 列出可用的数字馆藏 |
view-collection | 浏览指定馆藏的 IIIF 清单 |
view-search-results | 获取先前搜索的结果 |
view-similar-works | 获取先前相似性搜索的结果 |
使用远程端点
此服务可通过以下托管远程端点使用:
https://api.dc.library.northwestern.edu/api/v2/mcp
无需本地安装。配置 MCP 客户端,使用可流式 HTTP 传输连接到此 URL。
Claude Desktop
将以下内容添加到 Claude Desktop 配置文件中。
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"dc-api": {
"type": "http",
"url": "https://api.dc.library.northwestern.edu/api/v2/mcp"
}
}
}
Claude Code
claude mcp add --transport http dc-api https://api.dc.library.northwestern.edu/api/v2/mcp
开发
要求
- Node.js 24+(参见 .tool-versions)
- mise(
bin/run.sh用它来启用正确的运行时)
设置
npm install
配置
此服务读取以下环境变量:
| 变量 | 默认值 | 描述 |
|---|---|---|
DC_API_BASE | https://api.dc.library.northwestern.edu/api/v2 | Digital Collections API 的基础 URL |
DC_IIIF_BASE | https://iiif.dc.library.northwestern.edu/iiif/3 | IIIF 服务的基础 URL |
SECRETS_PATH | (none) | AWS Secrets Manager 配置的基础路径 |
在本地运行
stdio(适用于 Claude Desktop / Claude Code)
bun run stdio
也可以通过包装脚本运行(使用 mise 启用正确的 Node.js 版本):
bin/run.sh
HTTP(可流式 HTTP 传输,端口 3000)
bun run http
配置 Claude Desktop(本地构建)
{
"mcpServers": {
"dc-api": {
"command": "/path/to/dc-api-v2/mcp/bin/run.sh"
}
}
}
将 /path/to/dc-api-v2/mcp 替换为此目录的绝对路径。编辑后重启 Claude Desktop。
测试
| 命令 | 结果 |
|---|---|
bun run test | 运行测试套件 |
bun test:watch | 运行测试套件并监视更改 |
bun test:coverage | 运行测试套件并计算覆盖率 |
bun test:record | 使用实时数据运行测试套件并录制新的测试夹具 |
- 默认情况下,测试套件使用预先录制的 HTTP 测试夹具。设置
MSW_MODE=live可使用实时数据运行。 bun test:record会录制新的测试夹具(需要mitmproxy:pip install mitmproxy)。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。