Logo Northwestern Digital Collections API MCP

Northwestern Digital Collections API MCP

Tổ chức
nulib

API providing access to the rich collections of the Northwestern University Libraries

Nhà phát hànhnulib
Kho mãdc-api-v2
Ngôn ngữTypeScript
Bản fork
1
Sao
14
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Northwestern Digital Collections API MCP cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    14 sao và 1 bản fork từ kho mã được liên kết.

dc-api-v2

Main API Build Status Chat API Build Status

Local development setup

env.json

The env.json file contains environment variable values for the lambda functions defined in the API for use in local development. You can create an env.json file containing the values to run the API against your dev data by running:

shell
make env.json

If the file already exists, it will not be overwritten unless you include -B in the make command.

Running the API locally

To start the API in development mode, first make sure you have the correct version of the AWS SAM command line utility installed:

shell
asdf install aws-sam-cli

Then run the following command:

shell
make serve

The API will be available at:

  • https://USER_PREFIX.dev.rdc.library.northwestern.edu:3002

⚠️ Note the above URLs (which point to your local OpenSearch instance) need full endpoints to resolve. For example:

  • https://USER_PREFIX.dev.rdc.library.northwestern.edu:3002/search
  • https://USER_PREFIX.dev.rdc.library.northwestern.edu:3002/collections

View supported endpoints Questions? View the production API documentation

Chaos middleware

The API supports simulated network effects (errors and delays) for local testing via the CHAOS_CONFIG environment variable. If the variable is absent the middleware is disabled entirely.

Set it to an inline JSON array:

shell
export CHAOS_CONFIG='[
  { "pattern": "/works/:id", "effect": "error", "status": 500, "chance": 0.3 },
  { "pattern": "/auth/whoami", "effect": "delay", "ms": 500 },
  { "pattern": "/file-sets/*", "effect": "delay", "ms": [100, 800] }
]'

Or set it to the path of a JSON file containing the same array:

shell
export CHAOS_CONFIG=/path/to/chaos.json

Each rule has a pattern (matched against the request path) and an effect:

EffectFieldsBehavior
errorstatus (HTTP status code), chance (0–1)Returns {"error":"chaos"} with the given status; fires chance * 100% of the time
delayms (number or [min, max])Pauses for the given number of milliseconds (random within range if a tuple)

All matching rules are evaluated in order. Delay rules accumulate; an error rule short-circuits the request only when it fires — otherwise evaluation continues to the next rule.

Example workflows

Meadow

View and edit information about a specific Work in the Index.

  1. Open a local Meadow instance.
  2. Find an id of a Work you'd like to inspect in the API.
  3. View JSON response at https://USER_PREFIX.dev.rdc.library.northwestern.edu:3002/works/[WORK_ID]
  4. View IIIF Manifest JSON response at https://USER_PREFIX.dev.rdc.library.northwestern.edu:3002/works/[WORK_ID]?as=iiif

IIIF content search

IIIF Presentation responses expose IIIF Content Search 2.0 services for transcription annotations:

  • Work manifests include a SearchService2 entry for https://USER_PREFIX.dev.rdc.library.northwestern.edu:3002/works/[WORK_ID]/search?as=iiif
  • File set canvases include a SearchService2 entry for https://USER_PREFIX.dev.rdc.library.northwestern.edu:3002/file-sets/[FILE_SET_ID]/search?as=iiif

To search transcription text, include a non-empty q parameter:

shell
curl "https://USER_PREFIX.dev.rdc.library.northwestern.edu:3002/works/[WORK_ID]/search?as=iiif&q=[QUERY]"
curl "https://USER_PREFIX.dev.rdc.library.northwestern.edu:3002/file-sets/[FILE_SET_ID]/search?as=iiif&q=[QUERY]"

Both endpoints return a IIIF AnnotationPage whose items target the matching work canvas or file set canvas. Requests without as=iiif or a non-empty q return 400.

For help debugging/inspecting, JavaScript console messages are written to: dc-api-v2/dc-api.log

DC

Develop against changes to the API.

  1. Before starting the DC app, temporarily change the port number in dc-nextjs/server.js from default 3000 to something like 3003.
  2. Open the port so it can be accessed in the browser.
sgport open all 3003
  1. Point to the proxy URL and start DC app (in your /environment/dc-nextjs shell)
export NEXT_PUBLIC_DCAPI_ENDPOINT=https://USER_PREFIX.dev.rdc.library.northwestern.edu:3002
bun run dev

Access the app in a browser at: https://USER_PREFIX.dev.rdc.library.northwestern.edu:3003/

Running the API locally with state machine + lambdas (needed for AV download route)

shell
# From the repo root
cd dc-api-v2

# Start the API + step function and associated lambdas
make start-with-step

# Open a second terminal and create the state machine
make state-machine

Deploying a development branch

There are two ways to deploy a development branch: make deploy and make sync. The differences are:

  • Changes: deploy deploys a static stack, and requires another deploy to update it. sync watches for changes in realtime.
  • Dependencies: deploy uses the apiDependencies resource defined in the template for dependencies, while sync uses the AWS SAM CLI's built-in development dependency logic.

Either way, the resulting stack will be accessible at https://dcapi-USER_PREFIX.rdc-staging.library.northwestern.edu.

An existing sync stack can be reused by running make sync again, or by running make sync-code to only sync code changes (no infrastructure/template changes).

samconfig.*.yaml

Both methods involve a samconfig.USER_PREFIX.yaml file. This file, with default values, can be created by running (for example):

shell
make samconfig.mbk.yaml

This will create a configuration to stand up the default stacks in both deploy mode (API, AV Download, and Chat) and sync mode (Chat only). To deploy a different combination of features, specify them using the WITH option:

shell
make samconfig.mbk.yaml WITH=API,DOCS

Available features are: API, AV_DOWNLOAD, CHAT, and DOCS.

⚠️ Be very careful including the API in sync mode as every change within /api will take a long time to deploy.

As with the env.json file, make will not overwrite an existing file unless you include -B.

Tearing down a development stack

shell
sam delete --stack-name dc-api-USER_PREFIX

Writing Documentation

API documentation is automatically regenerated and deployed on pushes to the staging and production branches. The documentation is in two parts:

Regular Docs

The docs directory contains a standard mkdocs project, which can be edited using the same tools and format as the main Repository Documentation.

In a nutshell:

  1. Clone this project into a working directory (which you probably already have).
  2. Edit the Markdown files in the docs/docs directory.
  3. To run mkdocs locally and preview your work:
    shell
    sgport open all 8000
    make serve-docs
    Docs will be accessible at http://USER_PREFIX.dev.rdc.library.northwestern.edu:8000/

OpenAPI/Swagger Docs

We also maintain an OpenAPI Specification under the docs directory in spec/openapi.yaml. When mkdocs is running, the Swagger UI can be found at http://USER_PREFIX.dev.rdc.library.northwestern.edu:8000/spec/openapi.html. Like the rest of the documentation, changes to the YAML will be immediately visible in the browser.

The existing spec files (openapi.yaml, types.yaml, and data-types.yaml) are the best reference for understanding and updating the spec. It's especially important to understand how openapi.yaml uses the $ref keyword to refer to reusable elements defined in types.yaml, and how types.yaml pulls model schemas from data-types.yaml.

For an in-depth look, or to learn how to define things for which there aren't good examples in our spec, refer to the full OpenAPI documentation.

Build Artifacts

openapi.html renders the Swagger UI directly from the unmodified openapi.yaml. In addition, the build process generates a JSON copy of the spec using the OpenAPI Generator CLI. In order to make sure the spec is valid before checking it in, run:

shell
bun run validate-spec

This check is also part of the CI test workflow, so an invalid spec file will cause the branch to fail CI.

DC API Typescript NPM package

Typescript types for the schemas (Works, Collections, FileSets) are automatically published to the nulib/dcapi-types repo on deploys.

  • If a deploy to the deploy/staging branch contains changes to the docs/docs/spec/data-types.yaml file, new types are generated and a commit is made to the staging branch of nulib/dcapi. This is intended to be for local testing by NUL devs against the private staging API.
  • If a deploy to production (main branch) contains changes to the docs/docs/spec/data-types.yaml file, new types are generated and a PR is opened into the main branch of nulib/dcapi-types. Also, an issue is created in nulib/repodev_planning_and_docs to review the PR and publish the types package (manually).

Versioning

The current API version is maintained in several different project files. To increment the version, use

make version BUMP=<major|minor|patch>

If you don't specify a BUMP value, the command will simply print the current version.

Dùng MCP Northwestern Digital Collections API MCP với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Northwestern Digital Collections API MCP, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm Northwestern Digital Collections API MCP làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Northwestern Digital Collections API MCP.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "nulib-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Northwestern Digital Collections API MCP, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Northwestern Digital Collections API MCP.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Northwestern Digital Collections API MCP giúp tôi làm việc này không?
Northwestern Digital Collections API MCP
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Northwestern Digital Collections API MCP.

Câu hỏi thường gặp

Máy chủ MCP Northwestern Digital Collections API MCP dùng để làm gì?

Northwestern Digital Collections API MCP là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Northwestern Digital Collections API MCP với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Northwestern Digital Collections API MCP với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Northwestern Digital Collections API MCP với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Northwestern Digital Collections API MCP, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Northwestern Digital Collections API MCP với TypingMind?

Northwestern Digital Collections API MCP hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Northwestern Digital Collections API MCP cung cấp những công cụ nào trong TypingMind?

Northwestern Digital Collections API MCP cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Northwestern Digital Collections API MCP không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Northwestern Digital Collections API MCP yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇