Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

library_nudt_mcp-1.4.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

library_nudt_mcp-1.4.0-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file library_nudt_mcp-1.4.0.tar.gz.

File metadata

  • Download URL: library_nudt_mcp-1.4.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for library_nudt_mcp-1.4.0.tar.gz
Algorithm Hash digest
SHA256 707c2431737e6e67ca32aea03a590b7f543c830a28a0f69400efa9f7596e7c65
MD5 9d7fefe8537cf5287be7ba9a8164cdd2
BLAKE2b-256 8111d03df18b108f2cc4c7c2ae3155739afb5cf9dfd0be9bd723db22292a3ffb

See more details on using hashes here.

File details

Details for the file library_nudt_mcp-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for library_nudt_mcp-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6368db3097fc8a56bfc660d79daa428f247b409ff5e2a8544ca451df5f66a26
MD5 401c333e9b162cd9f23bda5f188c1e06
BLAKE2b-256 fc8bfb9a6840cee21aee54020b254d9030336a7a50e310c15b87ab8f78d2d31a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page