> ## Documentation Index
> Fetch the complete documentation index at: https://felimet-hub.jmcores.com/llms.txt
> Use this file to discover all available pages before exploring further.

# EndNote for Word 引用管理工具包

> Word 用的 AI 引用管理工具包：讓 AI Agent 查證 DOI、匯入 RIS 至 EndNote，並建立原生 CWYW IEEE 引用與參考文獻清單。

`EndNote` · `MCP` · `AI Agent` · `Windows` · `Microsoft Word`

## 專案概述

EndNote for Word 是給 Microsoft Word 用的 AI 引用管理工具包，由 skill/plugin 與 MCP server 組成，提供給 Claude Code、Claude Desktop、Codex 與 ChatGPT Desktop 使用。它引導 AI Agent 查找並核對具 DOI 的論文，把書目匯入 EndNote library，再於 DOCX 中建立真正的 EndNote Cite While You Write（CWYW）IEEE 引用與參考文獻清單。每一筆引用都是 EndNote 原生欄位，而非手打文字。

## 核心功能

* 引導 Agent 查找同儕審查論文、核對 metadata 與 DOI、匯出 EndNote 相容的 RIS，再透過 EndNote Direct Export 匯入書目庫
* 把 DOCX 中的 `{{CITE:id}}` 標記換成真正的 CWYW 欄位：引用是帶有 traveling library 的 `ADDIN EN.CITE`，參考文獻清單是 `ADDIN EN.REFLIST`
* 不手打引用文字、不在 OOXML 中偽造欄位碼，也不以純文字清單假冒參考文獻清單
* 預設採 IEEE；每筆被引用文獻都必須有 DOI，引用前先經 doi.org 驗證，並拒絕重複的 resolver 前綴
* 同時支援 IEEE Default Format 的 `[x]`，以及 Display as Author (Year) 產生的 `Author et al. [x]` 敘述式引用
* 以唯讀快照讀取 `.enl` 書目庫；RIS 匯入是唯一會寫入 library 的動作，且由 EndNote 自己執行
* 渲染前先對書目庫與已安裝的輸出樣式預先檢查 manifest，避免未知的紀錄編號或樣式名稱讓 EndNote 跳出對話框而卡住 automation
* Word 全程隱藏，由 bridge 啟動的 EndNote 也以隱藏視窗執行；完成後再對文件做結構性驗證

## 專案架構

Agent 處理一份稿件的流程分成七個階段。文獻查找與預先檢查都在 Word 開啟你的文件之前完成，真正改動文件的只有渲染這一步，之後再以唯讀方式驗證。

manifest 是第四階段的產物。每筆引用的 `id` 與 `marker` 都必須全域唯一，marker 在文件中要恰好出現一次；`pages` 與 `suffix` 只作用於最後一個 target，因此限定用於單一 target 的引用。

```jsonc theme={null}
{
  "schema_version": 1,
  "library": { "path": "C:\\EndNoteLibraries\\ExampleLibrary.enl" },
  "style": "IEEE",
  "citations": [
    {
      "id": "thomsen2023",
      "marker": "{{CITE:thomsen2023}}",
      "targets": [ { "rec_number": 1, "author": "Thomsen", "year": 2023, "doi": "10.0000/fixture.0001" } ],
      "display": "default",
      "pages": "45-46"
    }
  ],
  "bibliography": { "expected": true }
}
```

範例中的 `library.path` 只是佔位路徑，使用前要改成自己的 `.enl`，否則會在 `library.path` 存在性檢查失敗。repository 的主要目錄如下。

**endnote-for-word**

**skills/endnote-for-word · 跨 Agent skill、參考資料及 launcher**

**SKILL.md**

**references/installation-matrix.md · 各平台 skill 位置與 MCP 設定**

**references/styles-and-formatting.md · 輸出樣式與 DOI 範本規格**

**scripts/invoke-bridge.ps1**

**scripts · Word 與 EndNote automation bridge、書目庫讀取器、MCP server、封裝程式**

**endnote-word.ps1 · PowerShell bridge**

**run-mcp.ps1 · 啟動 MCP server**

**mcp\_server.py**

**endnote\_library.py**

**package\_plugin.py · 封裝成 plugin 與 skill 套件**

**config/defaults.json · 預設輸出樣式、空白 library 模板、暫時引用分隔符號與驗證閘門**

**examples/example-manifest.json · 範例 manifest**

**tests · 靜態、MCP 協定、離線結構、書目庫與即時整合測試**

**run-tests.ps1**

**evals · 評測案例**

**evals.json**

## 快速開始

依使用的 Agent 擇一安裝，步驟 1 到 3 互為替代。

**1. Claude Code：安裝 plugin**

```console theme={null}
claude plugin marketplace add felimet/endnote-for-word
claude plugin install endnote-for-word@endnote-for-word
```

升級時執行 `claude plugin marketplace update endnote-for-word` 與 `claude plugin update endnote-for-word@endnote-for-word`。安裝或升級後重新啟動 Claude Code。

**2. Codex：安裝 plugin**

```console theme={null}
codex plugin marketplace add felimet/endnote-for-word
codex plugin add endnote-for-word@endnote-for-word
```

plugin 同時帶有 skill 與 MCP server。升級時執行 `codex plugin marketplace upgrade endnote-for-word`，再執行一次 `codex plugin add`。安裝或升級後重新啟動 Codex。

**3. Claude Desktop：上傳 skill 並設定 MCP**

於 **Customize > Skills** 上傳 `dist/endnote-for-word.skill`。此檔不在 repository 內，先在 repository 根目錄執行 `python scripts/package_plugin.py` 產生。再把下列 server 合併至 `%APPDATA%\Claude\claude_desktop_config.json`（保留其他既有 server），並將 `<REPO_ROOT>` 換成 repository 的本機絕對路徑，完成後重新啟動 Claude Desktop。

```json theme={null}
{
  "mcpServers": {
    "endnote-for-word": {
      "command": "powershell.exe",
      "args": ["-NoLogo", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", "<REPO_ROOT>\\scripts\\run-mcp.ps1"]
    }
  }
}
```

**4. 驗證安裝**

在 repository 根目錄執行：

```console theme={null}
pwsh.exe -NoProfile -ExecutionPolicy Bypass -File scripts/endnote-word.ps1 -Action probe
pwsh.exe -NoProfile -ExecutionPolicy Bypass -File scripts/endnote-word.ps1 -Action list-styles -Style IEEE
pwsh.exe -NoProfile -ExecutionPolicy Bypass -File tests/run-tests.ps1
```

probe 須回報 `cwyw_macro_callable` 為 true，之後的文件驗證須回傳 `ok: true`，才算安裝完成。文件驗證指先以小型 fixture 文件 render 一次，再對輸出執行 validate（`-Action validate` 或 `validate_endnote_word_document`）。

**5. 在 DOCX 放入 marker 並交給 Agent**

先在 DOCX 中放好 marker：

```text theme={null}
自動化跛行評分已成為常規做法 {{CITE:thomsen2023}}。
兩組獨立試驗結論一致 {{CITE:merged}}。
```

再把 DOCX 與目標 `.enl` 路徑交給 Agent，並告訴它偏好的輸出樣式，例如 `IEEE` 或 `APA 7th`。未指定時使用 IEEE；Agent 必須先確認該樣式已安裝，不得擅自改用其他樣式。

## 安裝方式比較

**點選 Agent 比較安裝方式**

各平台的 skill 位置與 MCP 設定見 repository 內的安裝矩陣（`skills/endnote-for-word/references/installation-matrix.md`）。

## 注意事項

> [!WARNING]
>
> 僅支援 Windows 10 或 11，需要 Microsoft Word 桌面版，以及已安裝並啟用 Cite While You Write 增益集的桌面版 EndNote，另需 Python 3、PowerShell（`pwsh.exe` 或 `powershell.exe`）與可連到 `doi.org` 的 HTTPS。CWYW 增益集是硬性前提：沒有它就沒有可支援的方式產生原生引用欄位，本工具也不會偽造。EndNote web 或 online 外掛不能取代它。專案以 EndNote 21 開發與驗證；EndNote 與 Microsoft Office 為專有產品，repository 不包含。從 WSL Bash 須呼叫 Windows 側的執行檔，Linux 的 `pwsh` 無法操作 Word COM。

> [!WARNING]
>
> 有幾種操作會讓 EndNote 或 Word 跳出對話框，automation 會卡住直到 process 被強制結束：傳入不存在的紀錄編號或樣式名稱、使用引用前綴（如 `{see \Thomsen, 2023 #1}`）、排除作者或年份（如 `{\Thomsen, 2023 #1}`）。第一版因此直接拒絕 `prefix`。轉為純文字（`ENRemoveFieldCodes`）也有同樣問題，沒有對應的自動化動作，需自行在 Word 功能區以 **EndNote > Convert Citations and Bibliography > Convert to Plain Text** 執行；它會另存新檔，且結果不可逆，EndNote 無法再更新該複本中的引用。

> [!WARNING]
>
> 來源 DOCX 與 EndNote 書目庫都視為使用者資料。Bridge 預設另存新檔，除非明確指定 `-Overwrite`，否則不覆寫既有輸出；書目庫只讀取暫存快照，工具不直接修改 `sdb.eni`，RIS 匯入交由 EndNote Direct Export 執行。新的目標 library 只能在 EndNote 完全關閉時，由 0 筆的空白 library 複製建立。

## 實際應用面

適合已經用 Word 與桌面版 EndNote 撰寫論文的人：先在稿件中以 `{{CITE:id}}` 標出要引用的位置，再讓 AI Agent 查找文獻、核對 DOI、把書目匯入 library，並照 manifest 把標記換成 IEEE 格式的原生引用與參考文獻清單。

## 相關連結

* GitHub：[felimet/endnote-for-word](https://github.com/felimet/endnote-for-word)
* 收錄於：[hashgraph-online/awesome-ai-plugins](https://github.com/hashgraph-online/awesome-ai-plugins)
* 收錄於：[hol.org/plugins](https://hol.org/plugins)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.