Skip to main content
Glama

Alexandria MCP

License: MIT Node: >=22 MCP Compatible

Alexandria 是一个 MCP 服务器,它让 Claude(或任何兼容 MCP 的 AI)能够通过单一统一界面访问 61 个公共数字图书馆——包括学术论文、经典书籍、法律记录、历史档案、政府数据库和软件文档。

你可以询问诸如:

“帮我查找关于 Transformer 模型中注意力机制的最新论文” “搜索关于美德本质的古希腊文本” “查找二战期间的美国军事记录” “获取 fastify Web 框架的文档”

它会自动确定要搜索的图书馆,并行运行查询,并返回统一的结果。


开始之前:你真正需要什么?

实话实说:

46 个来源无需任何 API 密钥即可工作。 如果你只想搜索 arXiv、古腾堡计划 (Project Gutenberg)、牛津大学存储库、剑桥大学存储库、Europe PMC、PLOS、OpenAlex、美国国家档案馆、英国立法以及其他数十个来源——你现在就可以直接使用,无需注册任何内容。

唯一能显著提升体验的密钥是你的 OpenAI API 密钥,它支持自然语言搜索 (library_ask)。没有它,你仍然可以直接搜索特定来源——只是你需要自己指定来源名称。

其他一切都是可选的。 每个额外的密钥都会解锁一个特定的来源。选择与你研究相关的那些即可,其余的可以跳过。


Related MCP server: Academic MCP

第 1 步:确保你拥有 Node.js 22 或更高版本

打开你的终端并检查:

node --version

如果显示 v22.x.x 或更高版本,就可以了。如果没有,请从 nodejs.org 下载最新的 LTS 版本。


第 2 步:克隆并构建 Alexandria

git clone https://github.com/suavecito585/alexandria-mcp.git
cd alexandria-mcp
npm install
npm run build

这大约需要 30 秒。完成后,你会看到一个 dist/ 文件夹出现。这就是编译后的服务器。

记下该文件夹的完整路径——下一步中会用到。在 Mac/Linux 上,你可以运行 pwd 来打印它。在 Windows 上,单独运行 cd 即可打印当前路径。


第 3 步:将 Alexandria 添加到 Claude Desktop

找到你的 Claude Desktop 配置文件:

  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

用任何文本编辑器打开它。如果已经配置了其他 MCP 服务器,请将 Alexandria 添加到它们旁边。如果它是空的或新的,请以此作为起点:

{
  "mcpServers": {
    "alexandria": {
      "command": "node",
      "args": ["/full/path/to/alexandria-mcp/dist/index.js"],
      "env": {
        "TRANSPORT": "stdio"
      }
    }
  }
}

将 /full/path/to/alexandria-mcp 替换为第 2 步中的实际路径。

保存文件后重启 Claude Desktop。

要验证它是否有效,请询问 Claude:“使用 library_list_sources 显示所有可用来源。” 你应该能看到列出的所有 61 个来源。


第 4 步:添加你的 OpenAI 密钥(推荐)

没有它,你每次搜索时都必须指定来源——例如,“在 arxiv 中搜索 transformer 论文”。有了它,你只需说“帮我查找关于 transformer 模型的论文”,Alexandria 就会自动确定要检查哪些来源。

在 platform.openai.com/api-keys 获取你的密钥。每次搜索的成本仅为几分之一美分(路由调用使用 gpt-4o-mini,每次查询约 $0.0002)。

将其添加到配置中的 env 块:

"env": {
  "TRANSPORT": "stdio",
  "OPENAI_API_KEY": "sk-..."
}

再次重启 Claude Desktop。


第 5 步:可选——设置向量存储(用于保存已摄入的文本)

library_ingest 允许你对全文内容进行分块、嵌入并存储在向量数据库中,以便日后检索。这仅在你构建研究 RAG 管道时有用。如果你只是想搜索和阅读,请完全跳过此步骤。

如果你确实需要它:

  1. 在 supabase.com 创建一个免费项目

  2. 进入 SQL 编辑器并运行此代码:

create extension if not exists vector;

create table if not exists source_docs (
  id text primary key,
  mcp_name text not null,
  ingested_at timestamptz default now()
);

create table if not exists knowledge_chunks (
  id uuid primary key default gen_random_uuid(),
  mcp_name text not null,
  source_id text not null,
  title text,
  authors text[],
  year int,
  language text,
  section text,
  chunk_index int,
  total_chunks int,
  quality_score float,
  content text not null,
  embedding vector(1536),
  created_at timestamptz default now()
);

create index if not exists knowledge_chunks_embedding_idx
  on knowledge_chunks
  using ivfflat (embedding vector_cosine_ops)
  with (lists = 100);
  1. 添加到你的配置 env 块中:

"SUPABASE_URL": "https://your-project.supabase.co",
"SUPABASE_SERVICE_ROLE_KEY": "eyJ..."

你可以在 Supabase 项目的 Settings → API 下找到这两个值。


第 6 步:获取你真正想要的 API 密钥

以下是所有可选密钥,按获取难度和获取内容分类。

即时(耗时 2 分钟,填表即可完成)

这些都是免费的。注册是即时或近乎即时的。

获取内容

注册地址

配置中的密钥名称

CORE — 5700 万+ 全文 OA 论文,目前最大的馆藏

core.ac.uk/services/api

CORE_API_KEY

Semantic Scholar — 2 亿+ 论文,提供 AI 驱动的推荐和引文图谱

semanticscholar.org/product/api

SEMANTIC_SCHOLAR_API_KEY

NASA ADS — 天文学、天体物理学和物理学文献的首要门户

ui.adsabs.harvard.edu/user/settings/token

NASA_ADS_API_KEY

Smithsonian — 史密森尼博物馆的 1400 万条记录(同一密钥适用于 GovInfo)

api.data.gov/signup

SMITHSONIAN_API_KEY

Springer Nature — Springer 和 BioMed Central 的 1600 万+ 文章

dev.springernature.com

SPRINGER_OA_API_KEY 和 SPRINGER_META_API_KEY

Zenodo — CERN 的开放研究存储库,更高的速率限制

zenodo.org/account/settings/applications

ZENODO_API_KEY

BHL — 生物多样性遗产图书馆,数百年的自然历史文献

biodiversitylibrary.org/getapikey.aspx

BHL_API_KEY

DigitalNZ — 新西兰的国家数字馆藏

digitalnz.org/developers

DIGITALNZ_API_KEY

DPLA — 美国数字公共图书馆

pro.dp.la/developers/api-codex

DPLA_API_KEY

Europeana — 来自欧洲博物馆和档案馆的 5000 万+ 项目

apis.europeana.eu

EUROPEANA_API_KEY

GitHub Token — OpenITI(1 万+ 伊斯兰文本)所需。无需特殊范围。

github.com/settings/tokens

GITHUB_TOKEN

需要几天时间(电子邮件批准或人工审核)

获取内容

注册地址

配置中的密钥名称

CourtListener — 美国联邦和州法院全文判例法

courtlistener.com/sign-in

COURTLISTENER_API_KEY

Trove — 澳大利亚国家图书馆,数字化报纸和书籍

trove.nla.gov.au/about/create-something/using-api

TROVE_API_KEY

特殊情况:BASE(需要 IP 白名单)

BASE 为你提供来自 11,000 多个学术提供商的 4 亿+ 记录——这是我们支持的最大索引。它是免费的,但需要通过电子邮件联系他们的团队将你的 IP 地址列入白名单。通常需要 2-3 个工作日。

  1. 前往 base-search.net/about/en/contact.php

  2. 从主题下拉菜单中选择 "Access BASE's HTTP API"

  3. 包含你的 IP 地址(在 whatismyip.com 查找)以及对你用例的简要描述(例如,“非商业研究聚合”)

  4. 等待他们的回复——他们会将你的 IP 列入白名单

批准后,添加到你的配置中:"BASE_API_KEY": ""(如果他们使用仅 IP 验证,该值可以为空,或者他们会给你一个令牌)。

控制台设置(稍微复杂一些)

获取内容

注意事项

配置中的密钥名称

Google Books — 4000 万+ 书籍,公共领域标题的全文

在 Google Cloud Console 中创建一个项目,启用 Books API,创建一个 API 密钥

GOOGLE_BOOKS_API_KEY

GovInfo — 美国国会记录,联邦公报

在 api.govinfo.gov/docs 注册——同一密钥也适用于 Smithsonian

GOVINFO_API_KEY


将密钥添加到你的配置中

每个密钥都放在 env 块中。你的最终配置可能如下所示(仅包含你实际获取的密钥):

{
  "mcpServers": {
    "alexandria": {
      "command": "node",
      "args": ["/full/path/to/alexandria-mcp/dist/index.js"],
      "env": {
        "TRANSPORT": "stdio",
        "OPENAI_API_KEY": "sk-...",
        "CONTACT_EMAIL": "you@example.com",
        "CORE_API_KEY": "your-core-key",
        "SEMANTIC_SCHOLAR_API_KEY": "your-s2-key",
        "NASA_ADS_API_KEY": "your-ads-key",
        "SMITHSONIAN_API_KEY": "your-data-gov-key",
        "GOVINFO_API_KEY": "your-data-gov-key",
        "SPRINGER_OA_API_KEY": "your-springer-oa-key",
        "SPRINGER_META_API_KEY": "your-springer-meta-key",
        "ZENODO_API_KEY": "your-zenodo-key",
        "BHL_API_KEY": "your-bhl-key",
        "DPLA_API_KEY": "your-dpla-key",
        "EUROPEANA_API_KEY": "your-europeana-key",
        "DIGITALNZ_API_KEY": "your-digitalnz-key",
        "GITHUB_TOKEN": "ghp_...",
        "COURTLISTENER_API_KEY": "your-cl-key",
        "TROVE_API_KEY": "your-trove-key",
        "GOOGLE_BOOKS_API_KEY": "your-books-key",
        "SUPABASE_URL": "https://your-project.supabase.co",
        "SUPABASE_SERVICE_ROLE_KEY": "eyJ..."
      }
    }
  }
}

每次更改配置时,请务必重启 Claude Desktop。


我现在能做什么?

设置完成后,可以尝试以下操作:

Use library_ask to find recent papers on CRISPR gene editing
Use library_search to search gutenberg for "Marcus Aurelius"
Use library_read to get the full text of arxiv paper 2401.12345
Use library_ask to find ancient Greek philosophical texts about justice
Use library_ask to find the Code Wiki documentation for the fastify/fastify GitHub repo

来源一览

46 个来源无需 API 密钥。 这些在安装后即可立即使用:

arXiv, Europe PMC, NASA NTRS, OSTI, ERIC, NSF, NIH, bioRxiv, PLOS, OpenAlex, Crossref, DOAJ, NARA, GovInfo, UK Legislation, Scottish Legislation, Norwegian National Library, OSF (PsyArXiv/SocArXiv), EarlyPrint, Harvard LibraryCloud, Cambridge Apollo, Oxford ORA, Google Code Wiki, Gutenberg, Open Library, Standard Ebooks, Wikisource, Internet Classics Archive, Sacred Texts, Marxists Internet Archive, CCEL, Project Runeberg, Cervantes Virtual, Classical Chinese Texts, Gallica, HathiTrust, Library of Congress, DOAB, OAPEN, Feedbooks, World Digital Library, Data.gov, Chronicling America, NDL (Japan)

15 个来源需要免费 API 密钥:

CORE, Semantic Scholar, NASA ADS, Smithsonian, Springer Nature, Zenodo, BHL, DigitalNZ, DPLA, Europeana, GitHub (OpenITI), CourtListener, Trove, Google Books, BASE (IP whitelist)


许可证

MIT — 随你使用。

Available Tools

11 tools
library_answerAnswer With Cited SourcesA
Read-only

Ask a question in plain English and get a synthesized answer with inline [n] citations, fused across sources with reciprocal rank fusion. Use this instead of library_ask when you want a cited answer rather than raw results. Every factual sentence is cited or dropped; an uncited or all-dropped answer is flagged in warnings[]. Requires OPENAI_API_KEY (or ALEXANDRIA_SYNTH_API_KEY). Set response_format: "detailed" for the full result set, routing, citation grades, and resolvability.

Inputs: query (required), read_top, max_sources, response_format, +1 more. Returns: answer, results, routing, warnings, +1 more

library_askNatural Language Library SearchA
Read-only

Ask for content in plain English; automatically selects the best sources from all 152 libraries, generates optimized per-source queries, and searches in parallel. Use this as the default entry point for any natural-language request. Use library_search instead when you already know which source to query. Requires OPENAI_API_KEY (already set for embeddings). Set response_format: "detailed" for routing reasons and per-stage diagnostics.

Inputs: query (required), max_sources, response_format, results_per_source. Returns: query, errors, intent, stage1, +5 more

library_citationsGet References or Citations (with Bibliography Export)A
Read-onlyIdempotent

List the works a scholarly item cites (direction: "references") or the works that cite it (direction: "citations"), resolved through OpenAlex's citation graph with OpenCitations as a fallback when OpenAlex has no record. Accepts an id/source from library_search or library_ask, or a bare DOI/arXiv id. Set format: "bibtex" | "ris" | "apa" to also return a formatted bibliography string; BibTeX prefers Crossref's own citation when a DOI is resolvable, for the first 20 results only (a paced, one-at-a-time doi.org lookup per item), with later results using a locally generated entry instead. Set response_format: "detailed" for full result fields.

Inputs: id (required), source (required), direction (required), limit, +2 more. Returns: seed, results, direction, formatted

library_health_checkCheck Source HealthA
Read-onlyIdempotent

Report per-source health: 'ok', 'degraded', 'down', 'key_missing', or 'unknown', merging this process's live error rate and latency with the last off-process probe run. The probe layer reads eval/probe-latest.json, which published installs do not ship, so on a published install a source's status stays 'unknown' until this process itself calls it. Use before relying on a source that has been erroring, or to check whether a key is configured. Optionally filter by source or cluster. Set response_format: "detailed" for error rate, latency, and quota usage.

Inputs: source, cluster, response_format. Returns: probeAt, sources, generatedAt

library_indexPreview Chunking (Dry Run)A
Read-onlyIdempotent

Dry run: fetch text, chunk semantically, score OCR quality. No writes. Full-text sources only.

Inputs: id (required), source (required). Returns: title, source, sourceId, totalChunks, +5 more

library_ingestIngest Into Vector DatabaseA
Idempotent

Chunk, embed, and store a text. Idempotent. Full-text sources only. Requires OPENAI_API_KEY + SUPABASE_URL + SUPABASE_SERVICE_ROLE_KEY.

Inputs: id (required), source (required). Returns: title, source, sourceId, chunksDropped, +2 more

library_list_sourcesList Available Library SourcesA
Read-onlyIdempotent

List all 152 library sources (count computed from the live registry at startup) with descriptions and capabilities.

Inputs: no named parameters. Returns: sources

library_readRead Full Text or MetadataA
Read-onlyIdempotent

Fetch text from a library source. Full-text sources return cleaned text (truncated at 200k chars). Metadata sources return item details and an external URL.

Inputs: id (required), source (required). Returns: doi, note, text, year, +10 more

library_recommendGet Similar Papers (Semantic Scholar)A
Read-onlyIdempotent

Get papers similar to a given paper using Semantic Scholar's recommendation engine. Pass a paperId from a semanticscholar search result. Returns up to 500 similar papers.

Inputs: id (required), limit. Returns: results

library_researchRecursive Cited ResearchA
Read-only

Deep research on a topic: outlines 3 to 7 coverage objectives, generates search queries, answers each with library_answer, extracts learnings and follow-up questions, then recurses with half the breadth. Stops once every objective is covered by a learning, at the given depth, at the time budget, or once a round finds no new sources. Requires OPENAI_API_KEY (or ALEXANDRIA_RESEARCH_API_KEY / ALEXANDRIA_SYNTH_API_KEY). Set response_format: "detailed" for the per-round breakdown, elapsed time, citation grades, resolvability, and the objectives/coverage outline.

Inputs: query (required), depth, breadth, max_minutes, +1 more. Returns: report, rounds, coverage, warnings, +3 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool targets a distinct operation—listing, health, natural-language search, specific search, read, dry-run indexing, ingest, recommend, answer, deep research, citations. Overlaps like ask vs. answer are clearly differentiated by descriptions.

    Naming Consistency5/5

    All tools follow the library_<verb> pattern with consistent snake_case naming. Verbs are clear and predictable (list, search, read, ingest, etc.), with minor noun-based exceptions like 'health_check' and 'citations' that still fit the pattern.

    Tool Count5/5

    11 tools is well within the ideal 3-15 range and each serves a distinct purpose, covering the full lifecycle from discovery to ingestion to synthesis without redundancy.

    Completeness5/5

    The tool set covers discovery (list_sources), health (health_check), search (ask, search), retrieval (read), ingestion (index, ingest), recommendation, synthesis (answer, research), and citations. No obvious gaps exist for a library server's expected operations.

    Maintenance

    ActivityNo data
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables searching and downloading academic papers from 14 platforms including arXiv, PubMed, Google Scholar, Web of Science, Springer, and Sci-Hub with unified data format and intelligent rate limiting.
      21
      330 npm
      192
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Search across a billion+ documents including academic papers, books, code, legal cases, forums, and Wikipedia. Provides search and detail tools for various content types.
      2
      55 npm
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Searches and retrieves academic papers from open access sources like arXiv, Semantic Scholar, and PubMed, with full text access via arXiv PDFs, PubMed Central, and Unpaywall.
      2
      MIT