Sandbox
@iosifache/annas-mcp

MCP server and CLI for Anna's Archive

This repo gives you a Go-based MCP server and CLI for Anna's Archive search and download tasks. The CLI and MCP tools expose book and article search and download commands, with optional mirror selection through SLUM and environment variables for the API key, download path, and base URL.

1,034 stars67 forksGoUpdated 2mo ago
Who it's for

Builders who want to search and download documents from Anna's Archive through an MCP client or the terminal.

What it delivers

You can look up books or articles and download them without switching out of your agent or shell.

What it does

Book search

Searches Anna's Archive by title, author, or topic through the `book_search` MCP tool or `book-search` CLI command.

Book download

Downloads a book by MD5 hash with `book_download` or `book-download`, using the API key and download path you configure.

Article search

Searches for articles by DOI or keywords with `article_search` or `article-search`.

Article download

Downloads an article by DOI with `article_download` or `article-download`.

Automatic mirror selection

Can discover and probe mirrors from SLUM when `ANNAS_AUTO_BASE_URL=true`, then fall back to `ANNAS_BASE_URL` or the default mirror.

How to get it

  1. 1HTTP requests default to a 1 hour timeout. For CLI usage, override this with --timeout,…
    annas-mcp --timeout 1h book-download abc123def456 "my-book.pdf"

README

Anna's Archive MCP Server (and CLI Tool)

An MCP server and CLI tool for searching and downloading documents (books and articles) from Anna's Archive, with optional automatic selection of a mirror reported as healthy by SLUM.

[!NOTE] Notwithstanding prevailing public sentiment regarding Anna's Archive, the platform serves as a comprehensive repository for automated retrieval of documents released under permissive licensing frameworks (including Creative Commons publications and public domain materials). This software does not endorse unauthorized acquisition of copyrighted content and should be regarded solely as a utility. Users are urged to respect the intellectual property rights of authors and acknowledge the considerable effort invested in document creation.

[!WARNING] Please refer to Mirror Selection if any of the links lead to a non-functional Anna's Archive server.

Requirements

Search works without any required environment variables.

Downloads require:

Setup

Download the appropriate binary from the GitHub Releases section.

If you plan to use the tool for its MCP server functionality, you need to integrate it into your MCP client. If you are using Claude Desktop, please consider the following example configuration:

"anna-mcp": {
    "command": "/Users/iosifache/Downloads/annas-mcp",
    "args": ["mcp"],
    "env": {
        "ANNAS_SECRET_KEY": "feedfacecafebeef",
        "ANNAS_DOWNLOAD_PATH": "/Users/iosifache/Downloads",
        "ANNAS_BASE_URL": "annas-archive.gl"
    }
}

Configuration

The tool can be configured with environment variables. These variables can also be stored in an .env file in the folder containing the binary.

Download Environment Variables

Downloads use:

  • ANNAS_SECRET_KEY: The Anna's Archive API key.
  • ANNAS_DOWNLOAD_PATH: The path where the documents should be downloaded.

Mirror Selection

Anna's Archive has multiple mirrors, and their availability can change over time. By default, this project uses ANNAS_BASE_URL, or annas-archive.gl when ANNAS_BASE_URL is not set.

Optionally, you can set:

  • ANNAS_BASE_URL: The Anna mirror to use (defaults to annas-archive.gl). When automatic mirror discovery is enabled, this becomes the fallback mirror.
  • ANNAS_AUTO_BASE_URL: Set to true to discover the best available Anna mirror automatically from SLUM.

Automatic discovery is opt-in: when ANNAS_AUTO_BASE_URL=true, the tool reads the public status page, ranks discovered Anna mirror candidates by recent health and latency, probes them locally, and uses the best reachable mirror. If discovery or probing fails, the tool falls back to ANNAS_BASE_URL, then to the built-in default mirror.

Timeouts

HTTP requests default to a 1 hour timeout. For CLI usage, override this with --timeout, for example:

annas-mcp --timeout 1h book-download abc123def456 "my-book.pdf"

For MCP usage, tools accept an optional timeout_seconds parameter, for example 3600 for 1 hour.

Demo

As an MCP Server

As a CLI Tool

Available Operations

OperationMCP ToolCLI CommandExample
Search for books by title, author, or topicbook_searchbook-searchbook-search "machine learning python"
Download a book by its MD5 hashbook_downloadbook-downloadbook-download abc123def456 "my-book.pdf"
Search for articles by DOI or keywordsarticle_searcharticle-searcharticle-search "10.1038/nature12345" or article-search "neural networks"
Download an article by its DOIarticle_downloadarticle-downloadarticle-download "10.1038/nature12345"

Files in the repo

Repository payload10 top-level entries
  • .github
  • cmd
  • internal
  • screenshots
  • scripts
  • .gitignore
  • .goreleaser
  • go.mod
  • go.sum
  • README.md

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

86k

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k
t8y2/dbxConnectors

20 MB lightweight cross-platform database client for 90+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 90+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP Server。

19k