OpenArchiver MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenArchiver MCP Server search archived emails for the Q3 board meeting notes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenArchiver MCP Server
An MCP (Model Context Protocol) server for searching and administering an OpenArchiver instance.
Toolsets
Set OPENARCHIVER_TOOLSET to choose which tools MCP clients can discover. The default is core.
Core
Core is read-only and intended for everyday archive access:
search_emails— search email text and structured fields.get_email— retrieve one archived email with decoded MIME text/HTML, attachment metadata, and thread details. SetincludeRaw: trueto also return the original API raw payload.get_archive_stats— return dashboard and per-source statistics together.get_archive_health— return global index health and optional per-source health.list_ingestion_sources— list accessible sources.list_archived_emails_for_source— browse a source with pagination.search_attachments— find a specific attachment by filename or indexed attachment text, with optional extension filtering.download_attachment— retrieve attachment bytes inline or save them to a local file, using the email and filename returned bysearch_attachments.
Full
Full includes every core tool plus administrative tools:
list_users,get_user,create_user,update_user,delete_user— user management.list_roles— discover IAM role IDs for user assignment.reindex_archive— reindex the entire archive or one source inmissingorfullmode.get_queues— inspect background queue counts.
In full mode, get_archive_health also requests the Super-Admin search-engine overview. Health sections are returned independently, so a permission failure in one section does not discard the others.
The API does not currently expose audit-log, retention-policy, retention-label, or legal-hold routes, so this MCP does not advertise nonfunctional tools for those features.
Related MCP server: MailBridge MCP
Requirements
Node.js 18 or newer
A reachable OpenArchiver instance
An OpenArchiver API key with permissions appropriate for the selected tools
Typical permissions include search:archive and read:archive for core access, read:dashboard and read:ingestion for statistics and health, manage:all for users, roles, queues, and index overview, manage:ingestion for a global reindex, and sync:ingestion for a source reindex.
Installation
npm install
npm run build
npm testRun the package directly with npx from GitHub Packages:
npx --yes --registry=https://npm.pkg.github.com --package=@imrasalghul/openarchiver-mcp@1.0.2 openarchiver-mcpFor GitHub Packages authentication, create a GitHub personal access token with read:packages (installation) or write:packages (publishing), then configure npm:
npm login --registry=https://npm.pkg.github.com --scope=@imrasalghulConfiguration
OPENARCHIVER_API_KEY— required API key.OPENARCHIVER_API_URL— required instance base URL, e.g.https://archiver.example.com; no default host.OPENARCHIVER_TOOLSET—coreorfull; defaults tocore. Invalid values stop startup with an error.OPENARCHIVER_TIMEOUT_MS— positive request timeout in milliseconds; defaults to30000.
Example MCP configuration:
{
"mcpServers": {
"openarchiver": {
"command": "npx",
"args": [
"--yes",
"--registry=https://npm.pkg.github.com",
"--package=@imrasalghul/openarchiver-mcp@1.0.2",
"openarchiver-mcp"
],
"env": {
"OPENARCHIVER_API_KEY": "your-api-key",
"OPENARCHIVER_API_URL": "https://archiver.example.com",
"OPENARCHIVER_TOOLSET": "core",
"OPENARCHIVER_TIMEOUT_MS": "30000"
}
}
}
}Use "OPENARCHIVER_TOOLSET": "full" only for API keys intended to perform administrative operations.
The package is published to GitHub Packages, not npmjs.org.
Development
npm run build
npm test
npm run checkThe tests start a local mock API and verify MCP discovery, tool annotations, input validation, reindex routing, partial health responses, and successful handling of 204 No Content deletions. They do not modify a live OpenArchiver instance.
Email response format
OpenArchiver returns raw MIME as a serialized Node Buffer. get_email decodes it locally and returns a parsed object containing text, html, addresses, message headers, and attachment metadata (filename, MIME type, size, and SHA-256). Existing archive metadata and thread details are retained. Attachment bytes and the large raw byte array are omitted by default. includeRaw: true retains the original API payload alongside the decoded result.
HTML is returned as data and is not sanitized for browser rendering. MIME parsing uses MailParser, including charset and transfer-encoding decoding. Parsing buffers the message and attachments in memory; very large messages require corresponding available memory.
Live API validation
The live suite is separate from the mock tests and requires both an explicit target and API key. It prints check names and timings, without email contents, account details, passwords, or credentials. Use an environment variable or your secret manager for the API key.
export OPENARCHIVER_API_URL=https://archiver.example.com
read -rsp 'OpenArchiver API key: ' OPENARCHIVER_API_KEY
export OPENARCHIVER_API_KEY
npm run test:liveThe read-only suite checks core/full discovery, authentication, every read tool, MIME decoding, attachment metadata, search filters/scopes/strategies/sorting, pagination, and missing-resource errors. It needs a populated archive and an administrative API key for full coverage.
Explicitly enable live writes when testing administrative operations:
npm run test:live -- --mutations --reindex-missing--mutations creates one uniquely named temporary user with the end_user role, verifies changes, then deletes it and verifies absence in a finally block. It never changes existing users. --reindex-missing exercises both source and global missing-only reindex requests. --reindex-full additionally rebuilds both scopes and waits for indexing completion between requests. These operations create audit records and queue history. OPENARCHIVER_TEST_REPORT optionally names a JSON report file; it contains only test metadata.
Package creation runs the TypeScript build automatically (npm pack). The package includes the compiled modules and README, and the CLI has a Node interpreter line for Unix systems.
Available Tools
6 toolsget_archive_healthBRead-onlyIdempotent
Get global index health and, optionally, source health; full mode also includes the admin search-engine overview
Inputs: sourceId.
get_archive_statsBRead-onlyIdempotent
Get overall dashboard statistics and detailed statistics for one ingestion source
Inputs: sourceId (required).
get_emailARead-onlyIdempotent
Get one archived email by ID, including attachments and thread details
Inputs: id (required).
list_archived_emails_for_sourceARead-onlyIdempotent
List archived emails for one ingestion source
Inputs: ingestionSourceId (required), page, limit.
list_ingestion_sourcesARead-onlyIdempotent
List ingestion sources accessible to the current API key
Inputs: no named parameters.
search_emailsBRead-onlyIdempotent
Search archived emails with full-text search and structured filters
Inputs: to, from, page, sort, +12 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a distinct purpose: get_email retrieves a single record, search_emails and list_archived_emails_for_source provide different listing/search paths, and the stats/health/source tools cover separate operational concerns. There is no meaningful overlap that would confuse an agent selecting a tool.
Tool names consistently follow a get_/list_/search_ verb prefixed pattern with clear noun targets. Longer names like list_archived_emails_for_source remain readable and predictable, and no naming style mixing occurs.
Six tools is a well-scoped count for an archive email server covering retrieval, search, source listing, and monitoring. Each tool earns its place without redundancy or bloat.
The read-only archive surface is well covered: emails can be searched, listed by source, and fetched individually, while stats and health provide operational visibility. There are no tools for managing ingestion sources or email lifecycle operations, but those appear outside the intended scope of an archiver query/monitoring server.
Maintenance
Related MCP Connectors
Search, read and export your uploaded PST, OST, MBOX, EML and Google Takeout email archives.
Search your private marketing email archive and organize collections with optional write access.
Ask about your email delivery: stats, bounces, complaints, message lookup and DNS health. Read-only.
Read-only Amazon SES observability: search events, inspect bounces, pull delivery stats.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables read-only search and export of Outlook emails and attachments with a chain-of-custody manifest for evidence collection.7MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP-compatible AI assistants to securely search multiple mailboxes, reconstruct email threads, and inspect attachments through read-only tools without altering mailbox state.Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables querying enterprise records and retention policies from any MCP client over stdio, with read-only tools for searching records, fetching retention verdicts, identifying archival candidates, summarizing departments, forecasting retentions, and viewing audit history.-
- AlicenseAqualityBmaintenanceProvides read-only access to Postmark across all servers of one or more accounts, letting users list servers and message streams, search outbound messages and bounces, fetch per-message event timelines, review suppressions, and pull delivery stats without any send, create, update, or delete operations. Account API tokens are auto-discovered per server so newly added servers and accounts are picked up without reconfiguration.6MIT