Skip to main content
Glama
OpenArchiver MCP Server

OpenArchiver MCP Server

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. Set includeRaw: true to 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 by search_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 in missing or full mode.

  • 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 test

Run the package directly with npx from GitHub Packages:

npx --yes --registry=https://npm.pkg.github.com --package=@imrasalghul/openarchiver-mcp@1.0.2 openarchiver-mcp

For 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=@imrasalghul

Configuration

  • OPENARCHIVER_API_KEY — required API key.

  • OPENARCHIVER_API_URL — required instance base URL, e.g. https://archiver.example.com; no default host.

  • OPENARCHIVER_TOOLSET — core or full; defaults to core. Invalid values stop startup with an error.

  • OPENARCHIVER_TIMEOUT_MS — positive request timeout in milliseconds; defaults to 30000.

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 check

The 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:live

The 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 tools
get_archive_healthB
Read-onlyIdempotent

Get global index health and, optionally, source health; full mode also includes the admin search-engine overview

Inputs: sourceId.

get_archive_statsB
Read-onlyIdempotent

Get overall dashboard statistics and detailed statistics for one ingestion source

Inputs: sourceId (required).

get_emailA
Read-onlyIdempotent

Get one archived email by ID, including attachments and thread details

Inputs: id (required).

list_archived_emails_for_sourceA
Read-onlyIdempotent

List archived emails for one ingestion source

Inputs: ingestionSourceId (required), page, limit.

list_ingestion_sourcesA
Read-onlyIdempotent

List ingestion sources accessible to the current API key

Inputs: no named parameters.

search_emailsB
Read-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

    A3.9/5.0

    Scored across 6 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables 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
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables 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.
      -
    • A
      license
      A
      quality
      B
      maintenance
      Provides 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.
      6
      MIT