npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@yc-w-cn/arxiv-mcp-server

v1.2.0

Published

一个基于 arXiv 的论文搜索与下载工具,支持 MCP 协议

Downloads

24

Readme

ArXiv MCP Server

一个基于 arXiv 的论文搜索与下载工具。支持 Model Context Protocol (MCP) 标准,提供 arXiv 论文搜索、PDF 下载和文本提取功能,适合自用或自动化工具集成。

功能亮点

  • 🔍 arXiv 论文智能搜索:关键词检索,快速定位你关心的论文
  • 📥 一键下载 PDF:自动获取并保存原始论文
  • PDF 文本提取:从 PDF 文件中提取原始文本内容
  • 🗑️ 一键清理文件:支持一键清空所有历史处理文件,避免空间积压

每个文件处理工具都会返回实际保存的文件名,方便你集成到任何自动化流程!

安装使用

NPX 方式(推荐)

pnpx @yc-w-cn/arxiv-mcp-server

全局安装

pnpm install -g @yc-w-cn/arxiv-mcp-server
arxiv-mcp-server

配置要求

环境变量

在使用前,请设置工作目录环境变量:

# 必需:工作目录
export WORK_DIR="/path/to/your/data/directory"

或者使用默认工作目录 .data(无需设置环境变量)

MCP 客户端配置

Claude Desktop 配置

在 Claude Desktop 的配置文件中添加:

{
  "mcpServers": {
    "arxiv-mcp-server": {
      "command": "npx",
      "args": ["-y", "@yc-w-cn/arxiv-mcp-server@latest"],
      "env": {
        "WORK_DIR": "/path/to/your/data/directory"
      }
    }
  }
}

配置文件位置:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

其他 MCP 客户端

对于其他支持 MCP 的客户端,请参考其文档配置 stdio 传输方式。

可用工具与参数

每个工具处理后都会返回保存的文件名,便于后续追踪或下载。

1. 搜索论文

  • 工具名: search_arxiv

  • 参数:

    • query:关键词
    • maxResults:返回论文数(可选,默认 5)

2. 下载PDF

  • 工具名: download_arxiv_pdf

  • 参数:

    • input:arXiv 论文 URL 或 arXiv ID(如:2403.15137v1)

3. 解析PDF文本

  • 工具名: parse_pdf_to_text

  • 参数:

    • arxivId:arXiv 论文 ID

4. 完整流程处理

  • 工具名: process_arxiv_paper

  • 参数:

    • arxivId:arXiv 论文 ID

5. 清理所有历史文件

  • 工具名: clear_workdir
  • 参数: 无

文件输出规范

所有生成文件均保存至工作目录,文件名规则如下:

  • {arxivId}.pdf - 原始 PDF
  • {arxivId}_text.txt - 提取的文本内容
  • (你可以用工具返回值直接获取这些文件名)

执行 clear_workdir一键删除工作区全部文件,务必谨慎操作!

使用流程示例

  1. 搜索论文 使用 search_arxiv 工具搜索相关论文
  2. 下载 PDFdownload_arxiv_pdf 工具拉取 PDF
  3. 提取文本内容parse_pdf_to_text 工具从 PDF 中提取文本
  4. 完整处理流程process_arxiv_paper 工具一次性完成搜索、下载和文本提取
  5. 清理历史文件clear_workdir 工具一键清空所有产出文件

开发指南

本地开发

# 克隆项目
git clone https://github.com/yc-w-cn/arxiv-mcp-server.git
cd arxiv-mcp-server

# 安装依赖
pnpm install

# 开发模式运行
pnpm run dev

# 构建
pnpm run build

# 运行构建版本
pnpm start

项目结构

arxiv-mcp-server/
├── src/                  # 源代码目录
├── dist/                 # 编译输出目录
├── package.json          # 项目配置
├── tsconfig.json         # TypeScript 配置
├── README.md             # 项目说明
└── .data/                # 默认工作目录
    ├── {arxivId}.pdf     # 下载的PDF文件
    └── {arxivId}_text.txt # 提取的文本内容

自定义扩展

您可以根据需要扩展以下功能:

  1. PDF解析器:集成更强大的PDF解析库(如 pdf-parse)
  2. 更多格式:支持导出为其他格式(如HTML、Word等)
  3. 批量处理:支持批量处理多篇论文
  4. 缓存机制:添加智能缓存以提高性能

技术栈

  • Node.js >= 18.0.0
  • TypeScript - 类型安全的JavaScript
  • Model Context Protocol - 标准化的AI上下文协议
  • arXiv API - 学术论文数据源
  • PDF解析库 - 文本提取和处理

故障排除

常见问题

  1. 论文下载失败

    错误:下载失败: Request failed with status code 404
    解决:检查 arXiv ID 是否正确,确保网络连接正常
  2. 工作目录权限问题

    错误:EACCES: permission denied
    解决:确保工作目录有写入权限,或设置 WORK_DIR 到有权限的目录

日志调试

启用详细日志:

DEBUG=arxiv-mcp-server pnpx @yc-w-cn/arxiv-mcp-server

贡献指南

欢迎贡献代码!请遵循以下步骤:

  1. Fork 本项目
  2. 创建特性分支:git checkout -b feature/amazing-feature
  3. 提交更改:git commit -m 'Add amazing feature'
  4. 推送分支:git push origin feature/amazing-feature
  5. 创建 Pull Request

开发规范

  • 使用 TypeScript 进行类型安全开发
  • 遵循 ESLint 代码规范
  • 添加适当的错误处理
  • 编写清晰的注释和文档

许可证

本项目采用 MIT 许可证。详情请见 LICENSE 文件。

作者信息

更新日志

v1.2.0 (2025-11-22)

  • 🗑️ 移除不想要的功能
  • 📦 更新打包工具

v1.0.0 (2024-12-19) - 原作者

  • ✨ 初始版本发布
  • 🔍 支持 arXiv 论文搜索
  • 📥 支持 PDF 下载
  • � 支持 PDF 文本提取
  • � 支持完整处理流程

相关链接

支持

如果您觉得这个项目有用,请给它一个 ⭐!

如有问题或建议,请通过以下方式联系: