使用说明
arXiv MCP服务器客户端
一个全面的模型上下文协议(MCP)实现,用于与arXiv.org交互,使AI助手能够无缝搜索、检索、分析和导出学术论文。
🚀 特性
核心功能
- 论文搜索:使用关键字、作者、标题和类别进行高级搜索
- 论文检索:获取特定arXiv论文的详细元数据
- 智能摘要:生成包含关键信息的格式化纸质摘要
高级工具
- 作者搜索:查找特定研究人员的所有论文
- 类别浏览:探索特定arXiv类别的论文(cs.AI、cs.LG等)
- 近期论文:获取具有可定制时间范围的最新出版物
- 纸张比较:对多篇论文进行并排分析
- 相关论文:使用智能匹配发现与给定作品相关的论文
- 引文分析:估计引用指标和影响分析
- 趋势分析:研究趋势分析,包括出版物数量、顶级作者和关键字频率
- 多格式导出:以BibTeX、JSON、CSV和Markdown格式导出论文
📦 安装
使用诗歌(推荐)
# Clone the repository
git clone https://github.com/yourusername/arxiv-mcp-client.git
cd arxiv-mcp-client
# Install dependencies
poetry install
# Activate virtual environment
poetry shell
使用pip
# Install dependencies
pip install mcp httpx
# Run the client
python arxiv_mcp_client.py
🛠️ 用法
基本设置
import asyncio
from arxiv_mcp_client import ArxivMCPClient
async def main():
# Initialize client
client = ArxivMCPClient()
# Connect to MCP server
await client.connect("arxiv_mcp_server.py")
# Your code here...
# Close connection
await client.close()
asyncio.run(main())
搜索示例
# General search
results = await client.search_papers("transformer neural networks", max_results=10)
# Search by author
papers = await client.search_by_author("Geoffrey Hinton", max_results=20)
# Search by category
ai_papers = await client.search_by_category("cs.AI", max_results=15)
# Get recent papers
recent = await client.get_recent_papers("cs.LG", days_back=7, max_results=10)
试卷分析
# Get paper details
paper = await client.get_paper_details("2301.07041")
# Get formatted summary
summary = await client.get_paper_summary("2301.07041")
# Compare papers
comparison = await client.compare_papers(
["2301.07041", "2302.13971"],
comparison_fields=["authors", "abstract", "categories"]
)
# Find related papers
related = await client.find_related_papers("2301.07041", max_results=10)
出口与分析
# Export to BibTeX
bibtex = await client.export_papers(
["2301.07041", "2302.13971"],
format="bibtex",
include_abstract=True
)
# Analyze research trends
trends = await client.analyze_trends(
category="cs.AI",
time_period="3_months",
analysis_type="top_authors"
)
🔧 可用工具
| 工具 | 说明 | 关键参数 |
|---|---|---|
search_arxiv |
一般论文搜索 | query, max_results, sort_by |
get_paper |
获取特定的纸张详细信息 | arxiv_id |
summarize_paper |
生成格式化摘要 | arxiv_id |
search_by_author |
按作者查找论文 | author_name, max_results |
search_by_category |
浏览类别论文 | category, max_results, sort_by |
get_recent_papers |
获取最新出版物 | category, days_back, max_results |
compare_papers |
比较多篇论文 | arxiv_ids, comparison_fields |
find_related_papers |
发现相关工作 | arxiv_id, max_results |
get_paper_citations |
引文分析 | arxiv_id |
analyze_trends |
研究趋势分析 | category, time_period, analysis_type |
export_papers |
多格式导出 | arxiv_ids, format, include_abstract |
📊 支持的类别
计算机科学
cs.AI-人工智能cs.LG-机器学习cs.CV-计算机视觉cs.CL-计算与语言cs.CR-密码学与安全cs.DB-数据库cs.DS-数据结构和算法
数学
math.CO-组合学math.ST-统计学理论math.PR-概率math.OC-优化与控制
物理学
physics.comp-ph-计算物理学physics.data-an-数据分析quant-ph-量子物理学
📄 导出格式
BibTeX
@article{2301_07041,
title={Title of the Paper},
author={Author One and Author Two},
journal={arXiv preprint arXiv:2301.07041},
year={2023},
url={https://arxiv.org/abs/2301.07041}
}
对象符号
{
"id": "2301.07041",
"title": "Title of the Paper",
"authors": ["Author One", "Author Two"],
"abstract": "Paper abstract...",
"published": "2023-01-17",
"categories": ["cs.AI", "cs.LG"]
}
CSV文件
id,title,authors,published,categories,url
2301.07041,Title of the Paper,"Author One; Author Two",2023-01-17,"cs.AI; cs.LG",https://arxiv.org/abs/2301.07041
🔍 搜索查询示例
基本搜索
# Keyword search
await client.search_papers("neural networks")
# Multiple keywords
await client.search_papers("transformer attention mechanism")
# Exact phrase
await client.search_papers('"large language models"')
高级搜索
# Author search
await client.search_by_author("Yoshua Bengio")
# Category search
await client.search_by_category("cs.AI")
# Recent papers in category
await client.get_recent_papers("cs.LG", days_back=14)
📈 趋势分析类型
出版物计数分析
跟踪特定类别中随时间推移发表的论文数量。
trends = await client.analyze_trends("cs.AI", "6_months", "publication_count")
# Returns: monthly publication counts
顶级作者分析
确定特定时期内某一领域最多产的作者。
trends = await client.analyze_trends("cs.LG", "1_year", "top_authors")
# Returns: authors ranked by paper count
关键词频率分析
分析某一类别中论文标题中最常见的关键字。
trends = await client.analyze_trends("cs.CV", "3_months", "keyword_frequency")
# Returns: keywords ranked by frequency
🚨 错误处理
客户端包括全面的错误处理:
try:
results = await client.search_papers("machine learning")
if "error" in results:
print(f"Search failed: {results['error']}")
else:
print(f"Found {len(results['papers'])} papers")
except Exception as e:
print(f"Connection error: {e}")
🔧 配置
速率限制
客户端遵守arXiv的API指南,内置速率限制和超时处理。
定制
# Custom timeout
client = ArxivMCPClient()
client.http_client = httpx.AsyncClient(timeout=60.0)
# Custom result limits
results = await client.search_papers("AI", max_results=50) # Max: 100
🤝 贡献
- 分叉存储库
- 创建要素分支(
git checkout -b feature/amazing-feature) - 提交您的更改(
git commit -m 'Add amazing feature') - 推到分支(
git push origin feature/amazing-feature) - 打开拉取请求
📝 许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
🙏 致谢
📞 支持
由以下材料制成❤️ 对于研究界