Skip to main content

Uniwersalny serwer MCP dla protokołu OAI-PMH — odpytuj dowolne repozytorium (dLibra, DSpace, EPrints, PMC…) przez Model Context Protocol

Project description

oai-pmh-mcp

CI PyPI License: MIT Python 3.11+

Install in Claude Desktop Install in Cursor Install in VS Code

Nothing to configure — the repository address is passed at tool-call time, so a single installation handles any number of repositories.

A universal MCP server for the OAI-PMH protocol (Open Archives Initiative – Protocol for Metadata Harvesting).

It lets any MCP client (Claude, ChatGPT, Cursor…) query any public OAI-PMH repository — digital libraries built on dLibra (e.g. the Wielkopolska Digital Library), as well as DSpace, EPrints, PubMed Central and others — with no per-host configuration. The repository address (base_url) is supplied on every call.

Features

A faithful wrapper around the six OAI-PMH verbs plus a convenient layer for bulk harvesting:

Tool Role
identify repository identity (name, protocol version, granularity, deleted-record policy)
list_metadata_formats available metadata formats (oai_dc, mods, marc…)
list_sets collections / sets
list_identifiers record headers only (cheap overview)
list_records a page of full records + pagination token
get_record a single record by identifier
harvest_records auto-pagination: fetches multiple pages up to a limit, resumable

Output in three formats (format): text (default, token-efficient), json (machine-readable), xml (raw original).

Installation

uvx oai-pmh-mcp        # run without installing (stdio)
# or
uv tool install oai-pmh-mcp

MCP client configuration

Claude Code

claude mcp add oai-pmh -- uvx oai-pmh-mcp

mcp.json (Cursor / others)

{
  "mcpServers": {
    "oai-pmh": { "command": "uvx", "args": ["oai-pmh-mcp"] }
  }
}

Transport

Defaults to stdio. Remote mode uses streamable-HTTP:

oai-pmh-mcp --transport http --host 0.0.0.0 --port 8000

Example

"Check what collections https://www.wbc.poznan.pl/dlibra/oai-pmh-repository.xml has and show the 5 most recent records."

The model will call identifylist_setslist_records and assemble the answer.

Development

uv sync
uv run pytest            # unit tests (offline, fixtures)
uv run pytest -m integration   # network tests (optional)
uv run ruff check .

Scope

OAI-PMH is a metadata protocol — the server does not fetch object content (scans, PDFs). It is read-only, without authentication, without caching.

Security

  • XML parsing is hardened — the parser does not expand entities or reach out to the network/DTD (protection against XXE and "billion laughs" from untrusted repositories).
  • harvest_records has hard limits (max records, max pages, abort on lack of progress) — a malicious server cannot trap the client in a loop.
  • SSRF by design: the server fetches any base_url supplied by the client (that is the point). Only the http/https schemes are allowed. If you deploy the remote (HTTP) variant on a network with internal resources, run it in an environment with restricted outbound networking — the model could point at an internal address (e.g. a cloud metadata endpoint).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oai_pmh_mcp-0.1.1.tar.gz (89.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oai_pmh_mcp-0.1.1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file oai_pmh_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: oai_pmh_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 89.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for oai_pmh_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a86cdeaff10c0a66028874dc64d06bfa2edb176b83f38a736780a3e09e7e6c0c
MD5 35ab01a9fb2f95a4ba3d8377fdd8428b
BLAKE2b-256 e7727a22151e6d6e2f9e7bcc3a30ecb7bacc88272f68dbdc4189c3e64c6078a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for oai_pmh_mcp-0.1.1.tar.gz:

Publisher: publish.yml on mpasternak/oai-pmh-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oai_pmh_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: oai_pmh_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for oai_pmh_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7baebc908866fc2546d3bf72b92f66c6844f5aa8f36cbc3ec85bbab826ad9af8
MD5 492e5f9408519177e8657107f2e730a5
BLAKE2b-256 3ebb430eb4696357bd9a67368e242e3f401e935c539e932c67ed2eb0cc37c29d

See more details on using hashes here.

Provenance

The following attestation bundles were made for oai_pmh_mcp-0.1.1-py3-none-any.whl:

Publisher: publish.yml on mpasternak/oai-pmh-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page