Uniwersalny serwer MCP dla protokołu OAI-PMH — odpytuj dowolne repozytorium (dLibra, DSpace, EPrints, PMC…) przez Model Context Protocol
Project description
oai-pmh-mcp
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.xmlhas and show the 5 most recent records."
The model will call identify → list_sets → list_records and assemble the answer.
One prompt, pointed at the Wielkopolska Digital Library.
identify confirms the endpoint — OAI-PMH 2.0, records back to 2003-12-01,
deletedRecord: persistent. list_sets returns all 116 sets and finds the
interesting ones under rootCollection:wbc:Mirabilium. list_records then reads
out Masonica (267 records): the Grand Lodge of Hamburg library, confiscated
during the war and now held in Poznań — including a 1782 exposé of Masonic
ritual and the by-laws of a London lodge that met in the Half-Moon Tavern on
Cheapside.
Nothing about that repository is hardcoded — the same tools answer the same way for any OAI-PMH endpoint you name.
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_recordshas 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_urlsupplied by the client (that is the point). Only thehttp/httpsschemes 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oai_pmh_mcp-0.1.2.tar.gz.
File metadata
- Download URL: oai_pmh_mcp-0.1.2.tar.gz
- Upload date:
- Size: 301.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
055862157aaec2ecd146b1c4cecf38ebdaff84df9202a99257cff62abbcd939b
|
|
| MD5 |
e94905ca301ef9c3b03b5d9c2251dc7a
|
|
| BLAKE2b-256 |
f4eba41c4a441c88f8351fe5dac2556992da8d1c76d7f7498c09ff3f15730fef
|
Provenance
The following attestation bundles were made for oai_pmh_mcp-0.1.2.tar.gz:
Publisher:
publish.yml on mpasternak/oai-pmh-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oai_pmh_mcp-0.1.2.tar.gz -
Subject digest:
055862157aaec2ecd146b1c4cecf38ebdaff84df9202a99257cff62abbcd939b - Sigstore transparency entry: 2238063801
- Sigstore integration time:
-
Permalink:
mpasternak/oai-pmh-mcp@bd253dbd01f9b0a2c0c1dc90c02ac251165f2967 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/mpasternak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bd253dbd01f9b0a2c0c1dc90c02ac251165f2967 -
Trigger Event:
release
-
Statement type:
File details
Details for the file oai_pmh_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: oai_pmh_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65c07eeda87816b00e079dff365e5015de1f5587229f68bee7e93dd176c35116
|
|
| MD5 |
7a481505c1baaaa856c292b73eaf23ab
|
|
| BLAKE2b-256 |
fb73835303867df94d9d8a7bdc23b1c4687b06d58c704900fccc8881554ec174
|
Provenance
The following attestation bundles were made for oai_pmh_mcp-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on mpasternak/oai-pmh-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oai_pmh_mcp-0.1.2-py3-none-any.whl -
Subject digest:
65c07eeda87816b00e079dff365e5015de1f5587229f68bee7e93dd176c35116 - Sigstore transparency entry: 2238064018
- Sigstore integration time:
-
Permalink:
mpasternak/oai-pmh-mcp@bd253dbd01f9b0a2c0c1dc90c02ac251165f2967 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/mpasternak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bd253dbd01f9b0a2c0c1dc90c02ac251165f2967 -
Trigger Event:
release
-
Statement type: