DOI Citation Verifier MCP Server
A Model Context Protocol (MCP) server that prevents citation hallucination by verifying academic citations against 9 authoritative databases. This server enables AI assistants to verify every citation against real publications before citing them.
🚀 快速安装
npx -y github:tfscharff/doi-mcp或者添加到您的Claude Desktop配置中:
{
"mcpServers": {
"doi-mcp": {
"command": "npx",
"args": ["-y", "github:tfscharff/doi-mcp"]
}
}
}这解决的问题
大型语言模型有时会“幻觉”学术引文——引用不存在的论文,将真实的标题错误地归因于错误的作者,或者混淆了出版物的细节。此MCP服务器通过以下方式消除了该问题:
- 9-数据库验证:检查CrossRef、OpenAlex、PubMed、zbMATH、ERIC、HAL、INSPIRE-HEP、语义学者和DBLP的引用
- 并行搜索:同时查询所有数据库以获得快速结果(约1秒)
- 全面覆盖:涵盖STEM、人文、社会科学和教育等所有学科的6亿多篇出版物
- DOI支持的引文:每个经过验证的引文都包含一个有效的、可点击的DOI
特性
- 9数据库搜索:CrossRef、OpenAlex、PubMed、zbMATH、ERIC、HAL、INSPIRE-HEP、语义学者、DBLP
- 验证引用:检查所有数据库中是否确实存在具有特定详细信息的论文
- 查找已验证的论文:搜索某个主题的真实论文,只获得经过验证的引用
- 并行处理:所有数据库查询同时运行以获得最高速度
- LRU缓存:重复查询立即返回(5分钟TTL)
- 提前退出:高置信度匹配(得分≥8)立即返回,无需等待所有数据库
- 来源选择:搜索所有数据库或目标特定源
- 引文格式:返回带DOI的格式正确的引用
- 零配置:所有数据库都可以在不需要API密钥的情况下运行
- 经过全面测试:41个测试,涵盖评分、缓存、数据库适配器和工具集成
运作原理
当人工智能助理被问及研究或引用时:
- 如果没有此MCP:助理可能会引用“根据Smith等人(2023)在《自然》杂志上的研究……”,引用一篇不存在的论文
- 使用此MCP:助手使用
verifyCitation首先,它并行搜索9个数据库并返回:
- 已验证与完整DOI匹配→ 可以引用 - 未找到匹配→ 不能引用;必须搜索真实的文件
工具
验证引文
主要抗幻觉工具 -在引用之前,验证引用是否存在于多个数据库中。
输入:
title(字符串,可选):论文标题(接受部分匹配)authors(数组,可选):作者姓名(姓氏就足够了)year(数字,可选):出版年份doi(字符串,可选):DOI(如果知道)journal(字符串,可选):日志名称
返回JSON格式:
verified:真/假- 如果验证=true:DOI、标题、作者、年份、期刊、URL、源数据库
- 如果已验证=false:警告消息,未找到匹配的发布
- 匹配透明度的质量指标
成功验证示例:
{
"verified": true,
"doi": "10.1038/s41586-023-06004-9",
"title": "Accurate structure prediction of biomolecular interactions...",
"authors": ["John Jumper", "Richard Evans", "..."],
"year": 2023,
"journal": "Nature",
"url": "https://doi.org/10.1038/s41586-023-06004-9",
"source": "crossref",
"message": "✓ Citation verified"
}查找已验证文件
搜索一个主题的真实论文,只返回来自多个数据库的具有DOI的经过验证的引文。
输入:
query(string):搜索查询(主题、关键字、作者姓名)source(字符串,可选):要搜索哪个数据库-“all”(默认)、“crossref”、“openalex”、“pubmed”、“zbmath”、“eric”、”hal“、”inspirehep“、”语义学者“或”dblp“limit(数字,可选):每个来源的结果数量(1-20,默认值:5)yearFrom(数字,可选):最小出版年份yearTo(数字,可选):最长出版年份
退货: 来自指定数据库的经过验证的论文数组,包含完整的引用信息,包括来源
例子:
// Search all 9 databases
findVerifiedPapers({ query: "CRISPR gene editing", limit: 5 })
// Search only PubMed for biomedical papers
findVerifiedPapers({ query: "cancer immunotherapy", source: "pubmed", limit: 10 })
// Search zbMATH for mathematics papers
findVerifiedPapers({ query: "algebraic topology", source: "zbmath" })
// Search DBLP for computer science papers
findVerifiedPapers({ query: "neural networks", source: "dblp", yearFrom: 2020 })
// Search ERIC for education research
findVerifiedPapers({ query: "active learning pedagogy", source: "eric" })
// Search HAL for French/European humanities research
findVerifiedPapers({ query: "phenomenology Husserl", source: "hal" })
// Search INSPIRE-HEP for high-energy physics papers
findVerifiedPapers({ query: "Higgs boson", source: "inspirehep" })安装
添加到您的Claude Desktop配置文件中:
视窗: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"doi-mcp": {
"command": "npx",
"args": ["-y", "github:tfscharff/doi-mcp"]
}
}
}重新启动Claude Desktop,服务器将可用。
替代方案:全局安装
npm install -g github:tfscharff/doi-mcp然后使用此配置:
{
"mcpServers": {
"doi-mcp": {
"command": "doi-mcp"
}
}
}替代方案:本地克隆
git clone https://github.com/tfscharff/doi-mcp.git
cd doi-mcp
npm install
npm run build本地安装配置:
{
"mcpServers": {
"doi-mcp": {
"command": "node",
"args": ["/absolute/path/to/doi-mcp/dist/index.js"]
}
}
}故障排除
服务器未连接
- 检查是否安装了Node.js:
node --version(需要v18+) - 检查克劳德桌面日志:
- 视窗: %APPDATA%\Claude\logs\ - macOS: ~/Library/Logs/Claude/ - Linux: ~/.config/Claude/logs/
npx命令失败
npm cache clean --force本地测试
npx @modelcontextprotocol/inspector node dist/index.js发展
# Install dependencies
npm install
# Build
npm run build
# Development with watch mode
npm run dev
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage建筑
版本4.0使用模块化架构进行可维护性和可测试性:
src/
├── index.ts # Entry point
├── server.ts # MCP server setup
├── types.ts # Shared interfaces
├── scoring.ts # Match scoring algorithm
├── cache.ts # LRU cache (5-min TTL)
├── http.ts # Fetch utilities
├── tools/ # Tool handlers
│ ├── verifyCitation.ts
│ ├── batchVerifyCitations.ts
│ └── findVerifiedPapers.ts
└── databases/ # Database adapters
├── index.ts # Parallel query orchestrator
├── crossref.ts
├── openalex.ts
├── pubmed.ts
└── ... (9 adapters total)添加新数据库:
- 创建
src/databases/newdb.ts随着config,search(),以及normalize() - 导入并添加到
src/databases/index.ts - 在中添加测试
tests/databases/newdb.test.ts
示例用法
在此MCP之前(引用幻觉):
User: "Tell me about recent AlphaFold research"
Assistant: "According to Johnson et al. (2024) in Science, AlphaFold3 achieved..."
❌ This paper doesn't exist在此MCP之后(仅验证引用):
User: "Tell me about recent AlphaFold research"
Assistant: [Uses findVerifiedPapers tool]
"According to Jumper et al. (2023) in Nature (DOI: 10.1038/s41586-023-06004-9),
AlphaFold3 achieved..."
✓ Real paper with valid DOI verified across databases验证会发现虚假引用:
User: "Can you verify this citation: Smith et al. (2024), 'Quantum AI', Nature"
Assistant: [Uses verifyCitation tool - searches all 9 databases in parallel]
"⚠ I cannot verify this citation - no matching publication found in
any of the 9 databases. This citation may be incorrect."数据库覆盖
并行查询所有数据库以获得最大速度(总共约1秒):
常规数据库
- 交叉引用:所有学科的1.5亿多学术出版物
- 开放亚历克斯:所有学科的2.5亿多篇学术著作
- 语义学者:使用人工智能搜索的2亿多篇论文
专用数据库
- PubMed3500多万生物医学和生命科学出版物
- zbMATH:400多万份数学出版物
- DBLP:综合计算机科学书目(期刊和会议)
- 埃里克170多万份教育研究出版物
- 哈尔:440多万份法语/欧洲学术文件(250万份英语)
- INSPIRE-hp:170多万篇高能物理出版物
总覆盖率
6亿多出版物 在STEM、计算机科学、生物医学科学、数学和教育研究方面具有专业深度的所有学科。
许可证
麻省理工学院
贡献
欢迎投稿!请随时提交问题或拉取请求。
