quotecheck

io.github.feenmile由 GitHub 帳號 feenmile 發布v0.1.1更新於 Oct 31, 2026

Check that a quoted passage appears word for word in its cited source (URL, DOI or PubMed ID).

概覽

AI 產生的概覽

透過一個 MCP 工具檢查引文是否逐字出現在其引用來源(URL、DOI 或 PubMed ID)中,並指出出現位置。

可以做什麼
  • 用 http/https 網址、doi: 識別碼或 pmid: 識別碼核對引文是否出現在來源中
  • 回傳 EXACT、NEAR、NOT_FOUND 或 SOURCE_UNAVAILABLE 判定,並附相似度與原因
  • 近似符合時給出字元位置和來源中的實際措辭片段
  • 擷取並回傳來源抽出的純文字,供助理直接檢視
適用情境
適合在助理撰寫含直接引語或引用的文稿時,於發布前確認措辭確實出現在所引來源中。它能找出「引用真實、措辭有誤」的情況,但不判斷論點是否成立。
執行需求
以 Python 套件(quotecheck-mcp,指令 quotecheck-mcp)透過 stdio 在本機執行,需要 Python 3.10 或更新版本;MCP 伺服器另需選用的 mcp SDK。未宣告帳號、API 金鑰或環境變數。擷取來源需要網路存取。
安裝前請注意
它會擷取來自模型輸出的網址,因此自帶防護:僅限 http/https、拒絕內嵌憑證的網址、每次重新導向都拒絕私有與回送位址、15 秒總時限、內文上限 5 MB。擷取的頁面內容與識別碼會送往被引網站,DOI 與 PubMed 查詢還會經過 doi.org 和 NCBI。EXACT 只表示文字存在,不代表論點受到支持;PDF、依賴 JavaScript 渲染的頁面、付費牆或需登入的內容以及 PubMed 全文都不在涵蓋範圍內。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 quotecheck,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

quotecheck

Does the quoted passage actually appear in the source?

AI agents (and people) often cite real sources but misstate what those sources say: real references, wrong claims. quotecheck fetches the cited source and checks that the quoted text is really there, word for word, and tells you where.

console
$ quotecheck "Mulberry trees" "https://en.wikipedia.org/wiki/Morus_(plant)"{  "status": "EXACT",  "char_start": 9271,  "char_end": 9285,  "similarity": 1.0,  "snippet": "Mulberry trees",  "source_final_url": "https://en.wikipedia.org/wiki/Morus_(plant)",  "reason": null}

Built by Feenmile.

Verdicts

statusmeaning
EXACTThe quote appears in the source text after normalizing whitespace, curly quotes and dash styles. Matching is case-sensitive.
NEARNo exact match, but a passage with similarity >= 0.90 exists (difflib SequenceMatcher ratio). snippet holds the source's actual wording.
NOT_FOUNDNothing in the retrievable text is close enough. similarity shows the best score found.
SOURCE_UNAVAILABLEThe source could not be fetched or read; reason says why.

char_start / char_end are Python string indices (end exclusive) into the plain text quotecheck extracted from the source, which you can get with quotecheck.fetch_source(source).text.

Read NEAR carefully. A NEAR result means the wording differs. A changed number ("43,548" vs "43,549") or a dropped "not" can still score above 0.90. Use the returned snippet as the quotation, or rephrase as a paraphrase.

Sources

  • https://... or http://... URLs
  • doi:10.xxxx/... (resolved through https://doi.org, following the publisher redirect)
  • pmid:12345 (the PubMed abstract, via NCBI E-utilities efetch, plain text)

Install

The PyPI distribution is named quotecheck-mcp; the import package and the command are still quotecheck.

console
pip install quotecheck-mcp            # library + CLI, no dependenciespip install "quotecheck-mcp[mcp]"     # also the MCP server (needs the official mcp SDK)

Python 3.10 or newer.

Quick start: CLI

console
quotecheck "<quote>" <source>quotecheck "the exact words" doi:10.1371/journal.pone.0000308quotecheck --strict "the exact words" pmid:33301246   # exit 1 unless EXACTecho "a long passage" | quotecheck - https://example.org/articlepython -m quotecheck --help

Output is always JSON on stdout. Exit status is 0 when a verdict was printed (1 with --strict unless EXACT) and 2 for usage errors such as an empty quote.

Quick start: library

python
import quotecheck
result = quotecheck.check("pmid:33301246", "A total of 43,548 participants underwent randomization")print(result.status, result.char_start, result.char_end, result.similarity)print(result.to_dict())
# Already have the text? Skip the fetch.quotecheck.check_text(text, quote, near_threshold=0.90)

The core library uses only the Python standard library.

Quick start: MCP server

The server speaks MCP over stdio and exposes one tool, check_quote(quote, source).

json
{  "mcpServers": {    "quotecheck": {      "command": "quotecheck-mcp"    }  }}

If the script is not on your PATH, use "command": "python", "args": ["-m", "quotecheck.mcp_server"].

The tool description tells the agent to call it before presenting text as a direct quotation, and how to act on each verdict.

Safe fetching

quotecheck fetches URLs that came from model output, so it treats them as untrusted:

  • only http and https; URLs with embedded credentials are refused;
  • the host is resolved and every resolved address must be public: private, loopback, link-local, multicast, reserved and unspecified addresses (including IPv4-mapped IPv6 forms) are refused; the connection then goes to the checked address, so a second DNS answer cannot swap in an internal one;
  • the same checks run again on every redirect, with at most 5 redirects;
  • one 15 second deadline covers the whole fetch, and the body is capped at 5 MB (declared, streamed and after decompression);
  • requests identify as quotecheck/0.1 (+https://feenmile.com);
  • proxy environment variables are not used.

Limits (v0.1)

  • EXACT means the text appears, not that the claim is true. quotecheck does not judge context, meaning, or whether the source is reliable. A quote can be verbatim and still be used to support something the source does not say.
  • No PDFs. PDF responses return SOURCE_UNAVAILABLE with the reason pdf not supported in v0.1. Many DOIs resolve to a landing page whose abstract is HTML; the full text may only be in a PDF.
  • No JavaScript rendering. Pages that build their text in the browser come back empty (SOURCE_UNAVAILABLE) or incomplete (NOT_FOUND).
  • Paywalls, logins, cookie walls and bot blocks. quotecheck sees what an anonymous client sees. Text behind them reads as NOT_FOUND or SOURCE_UNAVAILABLE, which does not mean the quote is wrong.
  • PubMed is abstract-only. pmid: checks the abstract text, not the full paper.
  • Ellipses are literal. A quote that skips words with "..." will not match exactly; check each fragment separately.
  • HTML extraction is simple. Text is taken from the standard-library HTML parser with script, style and template removed. Navigation, footers and hidden elements are included; text split across unusual markup may not join the way it reads on screen.
  • Unicode. Characters are NFKC-normalized one at a time; the same accented letter written in composed and decomposed forms will not match exactly.
  • Fuzzy search is anchored on words shared with the quote. Quotes longer than 20,000 characters are checked for exact matches only.
  • Pages larger than 5 MB are refused rather than truncated.

Development

console
python -m unittest discover -s tests -t .python scripts/mutation_check.py

The tests are offline. They run a local http.server fixture. Because the SSRF guard blocks loopback, tests exempt specific fixture (ip, port) pairs with quotecheck._testing.allow_loopback_endpoints, a test-only switch that is off unless a test turns it on. A second fixture server is never exempted, so the tests can prove that a redirect into loopback is refused.

scripts/mutation_check.py copies the project to a temporary directory, disables the address check, and confirms the suite fails.

License

MIT. See LICENSE.

來源:README.md,提交 8569f6e

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:伺服器未能啟動。

版本歷史

1
  1. v0.1.1最新Oct 31, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分