Skip to main content

library-nudt-mcp

国防科技大学图书馆 MCP 服务器 - 提供学术资源检索功能

功能特性

  • 🔍 专业的学术资源检索(期刊、图书、专利、标准、学位论文等)
  • 📚 支持复杂的检索表达式(布尔逻辑、字段限定、年份范围)
  • 🎯 精确的检索表达式验证器
  • 🔐 Cookie 管理与自动续期
  • 🚀 基于 FastMCP 框架,支持 stdio 模式
  • 🔄 搜索失败自动重试(最多 2 次)
  • 🤖 Cookie 失效时自动尝试 headless 登录
  • ⚡ MCP 服务器启动不阻塞(Cookie 检测异步化)

安装

pip install library-nudt-mcp

快速开始

1. 作为 MCP 服务器使用

在 VS Code 的 MCP 配置中添加:

{
  "servers": {
    "libnudt": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "library-nudt-mcp",
        "library-nudt-mcp"
      ]
    }
  }
}

2. 作为 Python 库使用

from library_nudt_mcp import nudt_search

# 执行检索
result = nudt_search(expression="K='导航|制导|控制'", page=1, size=20)
print(result)

检索表达式语法

字段代码

字段 含义 字段 含义
T 标题 A 作者
K 关键词 S 摘要
O 作者单位 Y 年份
Z 全字段 Su 主题词

文献类型限定

前缀 类型 前缀 类型
JN 期刊 BK 图书
DT 学位论文 CP 会议论文
PT 专利 ST 标准

逻辑运算符

  • AND - 与
  • OR - 或
  • NOT - 非

示例

# 简单检索
nudt_search("A='张三'")

# 多条件检索
nudt_search("A='张三' AND K='水资源'")

# 年份范围
nudt_search("A='张三' AND 2000<Y<2020")

# 限定期刊
nudt_search("JN(A='杨振宁|周培源' AND O='清华大学')")

# 复杂组合
nudt_search("JN((A='杨振宁|周培源' AND O='清华大学') OR A='钱学森' AND 2000<Y<2016 NOT K='断层')")

可靠性

  • 搜索请求失败时自动重试(指数退避)
  • Cookie 失效时自动尝试 headless 登录恢复
  • MCP 服务器启动不阻塞,首次工具调用时按需登录
  • Cookie 文件损坏/缺失时优雅降级

开发

git clone https://github.com/connor/library-nudt-mcp.git
cd library-nudt-mcp
pip install -e ".[dev]"
pytest

许可证

MIT License

Metadata

Release files for library-nudt-mcp 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for library-nudt-mcp 1.4.0
File Size Uploaded Provenance
library_nudt_mcp-1.4.0.tar.gz 22.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for library-nudt-mcp 1.4.0
File Interpreter ABI Platform
library_nudt_mcp-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 43.3 kB

Release files / library_nudt_mcp-1.4.0.tar.gz

Download URL library_nudt_mcp-1.4.0.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
707c2431737e6e67ca32aea03a590b7f543c830a28a0f69400efa9f7596e7c65
BLAKE2b-256 checksum
How to use checksums
8111d03df18b108f2cc4c7c2ae3155739afb5cf9dfd0be9bd723db22292a3ffb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / library_nudt_mcp-1.4.0-py3-none-any.whl

Download URL library_nudt_mcp-1.4.0-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6368db3097fc8a56bfc660d79daa428f247b409ff5e2a8544ca451df5f66a26
BLAKE2b-256 checksum
How to use checksums
fc8bfb9a6840cee21aee54020b254d9030336a7a50e310c15b87ab8f78d2d31a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for library-nudt-mcp 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page