mcp_library_search
MCP server:查询城市图书馆的馆藏与可借状态——回答"这本书在哪些馆能借到"。
支持情况
| 城市 | 标识 | 状态 | 数据源 |
|---|---|---|---|
| 上海 | shanghai |
✅ 已接入 | 上海中心图书馆"一卡通"总分馆体系(900+ 网点,含地铁站 24 小时自助机) |
| 广州 | guangzhou |
✅ 已接入 | 广州图书馆(图创 Interlib) |
| 杭州 | hangzhou |
✅ 已接入 | 杭州图书馆(图创 Interlib) |
| 深圳 | shenzhen |
✅ 已接入 | 深圳图书馆之城统一平台(自研 JSON API,167 馆) |
| 更多城市 | — | 欢迎提需求或贡献适配器 | — |
安装
Claude Code
claude mcp add mcp-library-search -- uvx mcp_library_search
Claude Desktop
在 claude_desktop_config.json 里加:
"mcpServers": {
"mcp-library-search": {
"command": "uvx",
"args": ["mcp_library_search"]
}
}
改完重启桌面版。
使用
接入后提供 3 个 tool,查询链路为:先 search_books 按关键字找到 book_id,再用它查馆藏或详情。都带 city 参数(默认 shanghai,未接入的城市会返回明确提示):
| tool | 作用 |
|---|---|
search_books(keyword, city, page, limit) |
按关键字(书名、ISBN、作者等)搜书,返回分页列表,每条带 book_id 和可借概况 |
find_book_availability(book_id, city, only_available) |
查这本书在哪些馆有、是否可借,可借的馆排前面;only_available=False 时已借出的馆藏带预计归还时间(due_date) |
get_book_detail(book_id, city) |
查这本书的完整介绍(ISBN、索书号、内容简介) |
典型用法:对 Claude 说"帮我查《三体》在哪个馆能借到" → 搜书拿到 book_id → 查各馆可借状态 → 就近推荐。
赞赏
如果这个项目帮到了你,欢迎打赏支持:
致谢
- shanghai-library-book-search-python——上海图书馆检索能力的来源(Apache-2.0)。
完整的第三方组件列表、归属与变更说明见 NOTICE。
Metadata
Release files for mcp-library-search 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mcp_library_search-0.2.0.tar.gz | 762.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_library_search-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 808.3 kB
Release files / mcp_library_search-0.2.0.tar.gz
| Download URL | mcp_library_search-0.2.0.tar.gz |
|---|---|
| Size | 762.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cab1ccf6cdaabbf19908e5da4e676a3cda9c3af08cbfcbab625d58822ea6af2c
|
|
BLAKE2b-256 checksum How to use checksums |
cf02fcdf90422b011003cac09f33426c04af3c36351ee64bcd9b044e9b6ae9f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / mcp_library_search-0.2.0-py3-none-any.whl
| Download URL | mcp_library_search-0.2.0-py3-none-any.whl |
|---|---|
| Size | 46.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e148e77ec2a20070d8865b9f7e2042fc1a0424a047a5f26b54735170a4d7f69
|
|
BLAKE2b-256 checksum How to use checksums |
57e3419e3cc41925cf0ca6548aadfdd3d3b66d4dea654e1c30f3ddb7a9c02be7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency log