mcp-citation-checker
An MCP server that verifies whether a claim is actually supported by the source text at a given citation — independent of what the calling LLM asserts.
README
mcp-citation-checker
An MCP server that verifies whether a claim is actually supported by the source text at a given citation — independent of what the calling LLM asserts.
Why this exists
LLM agents that cite sources can still get the citation wrong: paraphrasing loosely, citing the wrong page, or asserting a source says something it doesn't. check_citation closes that gap by independently fetching the real text at the claimed citation and asking a separate LLM call to judge, strictly from that text, whether the claim holds up. The agent's own paraphrase is never trusted as evidence — only the independently-fetched source is.
Design: pluggable backends
Looking up "the real text at citation X" depends entirely on where your documents actually live — Weaviate, Postgres, a flat file, something else. Rather than hardcoding one storage system, this package defines a small interface any backend can implement:
class SourceLookup(Protocol):
def fetch(self, pdf_name: str, page_number: int) -> list[dict]:
...
weaviate is included out of the box as a working, tested implementation (bundled as an optional extra, so installing the base package doesn't force a Weaviate dependency on anyone who doesn't need it). Writing your own backend for another storage system just means implementing that one fetch method — see Writing your own backend below.
Install
pip install "mcp-citation-checker[weaviate]"
(Omit [weaviate] if you're supplying your own backend instead.)
Configuration
Set via environment variables when the server starts:
| Variable | Default | Purpose |
|---|---|---|
CITATION_BACKEND |
weaviate |
Which backend to use (currently only weaviate ships built-in). |
ANTHROPIC_API_KEY |
— | Required. Used for the verification LLM call. |
WEAVIATE_MODE |
local |
local (self-hosted) or cloud (Weaviate Cloud). |
WEAVIATE_HOST / WEAVIATE_PORT |
localhost / 8081 |
Used when WEAVIATE_MODE=local. |
WEAVIATE_CLOUD_URL / WEAVIATE_API_KEY |
— | Required when WEAVIATE_MODE=cloud. |
Usage
Run directly:
mcp-citation-checker
Or wire it into an MCP client config (e.g. Claude Desktop, or your own agent) like any other stdio MCP server:
{
"mcpServers": {
"citation-checker": {
"command": "mcp-citation-checker",
"env": {
"ANTHROPIC_API_KEY": "...",
"WEAVIATE_MODE": "cloud",
"WEAVIATE_CLOUD_URL": "...",
"WEAVIATE_API_KEY": "..."
}
}
}
}
The server exposes one tool, check_citation(claim, pdf_name, pdf_page), returning "<label>: <one-sentence reasoning>" where <label> is one of supported, contradicted, or not_mentioned.
Writing your own backend
The verification logic (mcp_citation_checker.checker.check_citation) has no storage-specific coupling at all — it only needs claim and a list of chunk dicts (pdf_name/page_number/text). Any backend just needs to implement the SourceLookup shape:
class MyBackend:
def fetch(self, pdf_name: str, page_number: int) -> list[dict]:
# return [{"pdf_name": ..., "page_number": ..., "text": ...}, ...]
...
No inheritance required — SourceLookup is a typing.Protocol, so any object with a matching fetch method satisfies it.
Two ways to actually use a custom backend:
- Bypass the bundled server entirely: call
checker.check_citation(claim, my_backend.fetch(pdf_name, page))directly from your own code/MCP server — this works today, no changes to this package needed. - Wire it into this package's own server: the current version only registers a
weaviatebackend in_get_backend()(src/mcp_citation_checker/__init__.py) — using a different backend through the bundledmcp-citation-checkercommand currently means adding a branch there yourself (a small, welcome PR).
Development
pip install -e ".[weaviate,dev]"
pytest
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。