dspace-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
dspace-mcp
A remote MCP server for DSpace
7 and later. It runs next to your repository at https://<your-dspace>/mcp, and lets
AI assistants (Claude, Claude Code, and other MCP clients) search, read, edit and
deposit in DSpace as the person who is logged in, with that person's DSpace
permissions — nothing more.
Why
Repository staff and depositors already have DSpace accounts with the right permissions. With this server they connect their AI assistant once (OAuth, using their normal DSpace login) and can then say things like:
"Find everything by J. Smith from 2019–2021 that has no abstract."
"Normalise the author name 'Smith, J.' to 'Smith, John' in these 40 items."
Drop a PDF into the chat: "Add this to the repository, in the Theses collection." The assistant reads the document, fills in the submission form fields, shows you the result and submits only after you approve.
Every change is shown as a preview first, and every write is recorded in an audit log. Nothing can be deleted through this server.
Related MCP server: geonode-mcp
How it works
The server is its own OAuth 2.1 authorization server as the MCP specification requires: authorization server and protected resource metadata (RFC 8414 / RFC 9728), dynamic client registration, PKCE, refresh token rotation, revocation. MCP clients discover all of it from the URL alone.
Users log in with their DSpace account. If they are already logged in to the DSpace UI on the same host, the consent page recognises them; otherwise they use an e-mail/password form that is checked by DSpace (rate limited). They then choose read only (default) or read and write.
Every DSpace REST call uses that user's own DSpace token, kept alive by the server (renewed before it expires) and stored encrypted. DSpace decides what is visible and what may be changed.
Stateless Streamable HTTP transport; state (clients, grants, hashed tokens, audit log) lives in one SQLite file.
Install next to an existing DSpace (about 5 minutes)
You need: DSpace 7+ with its REST API, Docker, and a reverse proxy (nginx, Caddy, Apache…) that serves DSpace over HTTPS.
Run the container. Copy
docker-compose.example.ymland set at least the four required variables:curl -O https://raw.githubusercontent.com/iplweb/dspace-mcp/main/docker-compose.example.yml mv docker-compose.example.yml docker-compose.yml echo "MCP_SECRET_KEY=$(openssl rand -base64 32)" > .env $EDITOR docker-compose.yml # DSPACE_PUBLIC_URL, DSPACE_REST_URL, MCP_PUBLIC_URL docker compose up -dOr with plain Docker:
docker run -d --name dspace-mcp --restart unless-stopped \ -p 127.0.0.1:8000:8000 -v dspace-mcp-data:/data \ -e DSPACE_PUBLIC_URL=https://repository.example.org \ -e DSPACE_REST_URL=https://repository.example.org/server \ -e MCP_PUBLIC_URL=https://repository.example.org/mcp \ -e MCP_SECRET_KEY="$(openssl rand -base64 32)" \ ghcr.io/iplweb/dspace-mcp:0.2.0Route
/mcpin your reverse proxy —/mcp,/mcp/*,/.well-known/oauth-protected-resource/mcpand/.well-known/oauth-authorization-server/mcp, unbuffered, path unchanged. Ready-made snippets for Caddy and nginx: docs/reverse-proxy.md.Check it:
curl -s https://repository.example.org/mcp/healthz curl -s https://repository.example.org/.well-known/oauth-protected-resource/mcp
Same host for cookie login. Recognising a user who is already logged in to the DSpace UI works only when
/mcpis served on the same host name as the DSpace UI (browsers send the UI'sdsAuthInfocookie only there). On another host, users log in with the e-mail/password form. Users who log in to DSpace only through Shibboleth, ORCID or another external method need the same-host setup.
No DSpace configuration changes are needed. The REST API must be reachable from the container, and DSpace's CORS settings do not matter (the browser never calls DSpace from the MCP pages).
Connect an AI client
The URL to give any MCP client is https://<your-dspace>/mcp.
Claude.ai / Claude Desktop: Settings → Connectors → Add custom connector, paste the URL. Claude opens the consent page; log in, pick read only or read and write.
Claude Code:
claude mcp add --transport http dspace https://repository.example.org/mcpthen run
/mcpin Claude Code and choose Authenticate.Other clients that support remote MCP servers with OAuth (Streamable HTTP) work the same way.
Files: Claude Code can pass small files directly (file_base64, up to 10 MB). In
Claude.ai the model cannot hand over the raw bytes of an attachment, so the assistant
gives you a one-time upload link instead, where you drop the file in the browser.
Tools
Tool | Access | What it does |
| read | The DSpace user the connection acts as |
| read | Discovery search with filters, scope, sorting, facets |
| read | Metadata (all languages), owning collection, files |
| read | Communities and collections |
| read | Text extracted by DSpace (TEXT bundle), in parts |
| read | Collections the user may submit to |
| read | A collection's submission form: fields, required, hints, allowed values |
| read | Writes made through this server (admins: everyone's; others: their own) |
| write | Add / replace / remove values in up to 100 items; returns a diff and a |
| write | Applies a previewed edit; items changed meanwhile are skipped as conflicts |
| write | One-time browser upload page for a file (30 min) |
| write | Creates or updates a draft (workspace item) with metadata and file; returns DSpace's validation errors and a |
| write | Accepts the deposit license on the user's behalf and submits (workflow or archive) |
Write tools need the read and write choice on the consent page (scope
dspace.write). There is no tool to delete items or files; removing a single
metadata value is an edit. Provenance, accession dates, dc.identifier.uri,
relation.* and relationship-derived values cannot be edited. Edits add a
dc.description.provenance note ("Metadata edited via MCP by … using … on …")
unless MCP_PROVENANCE=false.
Security model
Please read this before enabling write access for your users.
The real boundary is DSpace. The server holds no privileges of its own; every call uses the user's DSpace token, so a user (or their assistant) can do exactly what that user can do in the DSpace UI — no more, but also no less. An administrator's assistant can edit anything an administrator can.
Scopes. Read-only connections cannot call write tools. The user picks the level per client on the consent page; read only is the default.
The client's tool approval. Write tools carry MCP annotations (
readOnlyHint,destructiveHint), so clients such as Claude ask the user before calling them, unless the user has turned that off.Preview → confirm_token → apply is a usability guardrail, not a security boundary. The token is returned to the model, which could in principle call the apply tool without showing you the preview. It makes sure that what is written is exactly what was previewed (and bound to the same connection, single use, 15 min), and it makes accidental writes unlikely. It does not protect against a model that is manipulated (e.g. by prompt injection in a document it reads) into writing; the client's tool approval and the scope do.
Prompt injection. Content read from the repository or from fetched files is untrusted input for the model. Grant write access to people who review what their assistant proposes.
Tokens. OAuth codes and tokens are stored as SHA-256 hashes. The DSpace tokens the server must use are stored encrypted (Fernet) with
MCP_SECRET_KEY. If that is unset, a key file is generated in the data volume: this protects a leaked copy of the database file, but not someone who can read the whole volume. Grants last at most 90 days and end when the user logs out of DSpace.Login form. Failed attempts are rate limited per client address and per e-mail with doubling lockouts (configurable). Locked-out attempts never reach DSpace.
OAuth endpoints. Dynamic client registration is open, as MCP clients expect.
/register,/authorizeand/tokenare rate limited per client address (HTTP 429 withRetry-After), the number of registered clients is capped, and unused or long-idle registrations are removed periodically. Hosted clients such as Claude.ai call/registerand/tokenfrom shared addresses, so keep those limits generous.File URLs (
file_url) are fetched only from public addresses: every resolved address is checked, the connection is pinned to the checked address, redirects are re-checked; size limits apply.Pages (consent, login, upload) use per-browser CSRF tokens, an Origin check, a strict Content-Security-Policy and
frame-ancestors 'none'.
Report vulnerabilities privately: see SECURITY.md.
History and audit
DSpace keeps no history of metadata edits, so the server records every write in its
SQLite database (table audit): time, DSpace user, OAuth client, tool, item, full
metadata before and after, the diff, the JSON Patch sent, and the result
(ok / conflict / error). Assistants can query it with get_history; for
reports export it:
docker compose exec mcp dspace-mcp-history --format csv --since 2026-01-01 > history.csv
docker compose exec mcp dspace-mcp-history --item <uuid> # JSON linesConfiguration
Variable | Default | Meaning |
| required | Public URL of the DSpace UI (login link, links in results) |
| required | DSpace REST API as reachable from the container, e.g. |
|
| Public URL of the MCP endpoint; also the OAuth issuer. Must have a path |
| key file in | Encryption key for stored DSpace tokens, also the source of the CSRF key ( |
| – | Comma-separated old keys; values are re-encrypted with the current key at startup |
|
| Proxies whose |
|
| Page language ( |
|
| OAuth access token lifetime (s) |
|
| Refresh token lifetime (s, 30 days) |
|
| Maximum age of a connection, whatever the refreshes (s, 90 days) |
|
| Validity of a preview's |
|
| Validity of a one-time upload link (s) |
|
| Limit for |
|
| Limit for |
|
| Add a |
|
| Failed logins per client address within the window (0 = off) |
|
| Failed logins per e-mail within the window (0 = off) |
|
| Window for counting failures (s) |
|
| First lockout (s); doubles with each further lockout |
|
| Longest lockout (s) |
|
| Client registrations per client address ( |
|
| Authorization requests per client address |
|
| Token requests (code exchange, refresh) per client address |
|
| Cap on registered OAuth clients ( |
|
| Registered clients never used for a login are removed after this (s) |
|
| Clients without an active connection are removed after this many idle days |
|
| SQLite database (uploads and the key file go next to it) |
|
| Listen address |
|
| Allow |
DSpace tokens expire after 30 minutes by default (jwt.login.token.expiration); the
server renews them in the background, also for idle connections. If the server is
down longer than that, affected users simply authorize again.
Back up the /data volume (it holds the audit log) and keep MCP_SECRET_KEY
separately. Losing the key only ends active connections: users log in again.
Compatibility
Tested with DSpace 10.1. Written against the DSpace 7+ REST API (Server API contract) and expected to work with DSpace 7.x, 8.x and 9.x; reports welcome. Submission uses the standard workspace item / workflow endpoints and the configured submission forms; entity relationships are not created.
Clients: any MCP client with Streamable HTTP and OAuth 2.1 (dynamic client registration) support; tested with Claude.ai and Claude Code.
Related projects
For a single-user, local assistant using your own DSpace credentials (stdio, no server to install) see mpasternak/dspace-mcp (read-only) and mpasternak/dspace-mcp-write. This project is the multi-user server installed alongside the repository.
Development
uv sync
uv run pytest
uvx ruff check .End-to-end checks against a running server and a DSpace with the demo data:
DSPACE_PUBLIC_URL=http://localhost:4000 DSPACE_REST_URL=http://localhost:8080/server \
MCP_PUBLIC_URL=http://localhost:8765/mcp MCP_PORT=8765 MCP_DB_PATH=./data/mcp.sqlite3 \
uv run dspace-mcp &
uv run python scripts/e2e.py --mcp http://localhost:8765/mcp \
--dspace http://localhost:8080/server --email admin@example.org --password admin --mode form
uv run python scripts/e2e_write.py --mcp http://localhost:8765/mcp \
--dspace http://localhost:8080/server --email admin@example.org --password admin --mode forme2e_write.py creates and submits test items and edits metadata: run it only against
a test instance. See CONTRIBUTING.md.
License
BSD 3-Clause, © 2026 IPLweb Michał Pasternak. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Enable Large Language Model clients to interact seamlessly with any MediaWiki wiki. Perform action…
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Connect AI to store orders, products and inventory with scoped access and human approvals.
Gives AI agents direct access to your Sanity projects and guidance for working with them
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to operate DSpace repositories through a typed interface, including SAF package building, metadata editing, scientometric harvesting, open-access PDF downloads, and repository administration.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to search and manage GeoNode resources via natural language, including metadata editing, permission changes, uploads, and ownership transfers, all under the acting user's own permissions.1Apache 2.0
- AlicenseBqualityBmaintenanceEnables AI assistants to manage a GBIF IPT from resource creation to publication, including metadata editing, data validation, Darwin Core mapping, and publishing, through plain language requests.32Apache 2.0
- AlicenseAqualityNot gradedmaintenanceEnables AI assistants to search, authenticate, and manage digital repository content through the REST API, including creating, updating, and deleting items, uploading file attachments, running workspace submissions, and browsing communities and collections. It can run either locally over stdio or on AWS Lambda via HTTP transport.141AGPL 3.0