mcp-library-search
This server lets you search, locate, and inspect library books via three tools, with the server schema currently supporting Shanghai only.
search_books: Search by keyword (title, ISBN, author) and get paginated results withbook_idand availability summaries.find_book_availability: Check which branches hold a book, optionally only available copies, with due dates for borrowed items.get_book_detail: Retrieve full book metadata including ISBN, call number, and summary.All tools accept a
cityparameter (defaultshanghai); the schema lists no other integrated cities.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-library-search帮我查下《三体》在上海哪个图书馆能借到,要现在可借的"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp_library_search
MCP server:查询城市图书馆的馆藏与可借状态——回答"这本书在哪些馆能借到"。
支持情况
城市 | 标识 | 状态 | 数据源 |
上海 |
| ✅ 已接入 | 上海中心图书馆"一卡通"总分馆体系(900+ 网点,含地铁站 24 小时自助机) |
广州 |
| ✅ 已接入 | 广州图书馆(图创 Interlib) |
杭州 |
| ✅ 已接入 | 杭州图书馆+浙江图书馆双源合并(同一本书跨馆归并成一条结果) |
深圳 |
| ✅ 已接入 | 深圳图书馆之城统一平台(自研 JSON API,167 馆) |
天津 |
| ✅ 已接入 | 天津图书馆等三源合并(主馆+少儿馆+中新友好图书馆,同一本书跨馆归并成一条结果) |
重庆 |
| ✅ 已接入 | 重庆 InDigLib 集群数字图书馆 |
合肥 |
| ✅ 已接入 | 安徽省图书馆+合肥市图书馆双源合并(同一本书跨馆归并成一条结果) |
南京 |
| ✅ 已接入 | 金陵图书馆+12 区馆联合目录 + 南京图书馆(江苏省图)双源合并,馆藏到单册级;南图源走 Ex Libris ALEPH,有验证码墙 |
成都 |
| ✅ 已接入 | 成都平原经济区联合目录(图创 Interlib pro2018) |
宁波 |
| ✅ 已接入 | 宁波市图书馆全市联合目录(图创 tcc-opac) |
绍兴 |
| ✅ 已接入 | 绍兴市公共图书馆联合目录(图创 Interlib pro2018) |
大连 |
| ✅ 已接入 | 大连地区网上联合目录(SirsiDynix iLink) |
金华 |
| ✅ 已接入 | 金华市图书馆(UILAS HTML OPAC) |
江阴 |
| ✅ 已接入 | 江阴市图书馆(图创 Interlib,含农家书屋等 24H 网点) |
温州 |
| ✅ 已接入 | 温州市图书馆(图创 Interlib,全市总分馆体系) |
台州 |
| ✅ 已接入 | 台州市图书馆(图创 Interlib pro2018,含地铁站点通借) |
青岛 |
| ✅ 已接入 | 青岛市公共图书馆联合目录(图创 Interlib,26 馆联合,检索走站点 Solr 通道) |
无锡 |
| ✅ 已接入 | 无锡市新吴区图书馆(图星 LibStar Find;市图书馆源预留未接入) |
扬州 |
| ✅ 已接入 | 扬州市图书馆联盟联合目录(汇文 uopac,与南京金陵源同系统;站点 securitycam 反爬按静态挑战处理) |
苏州 |
| ✅ 已接入 | 苏州图书馆+苏州工业园区图书馆双源合并(图创 Interlib,馆藏到单册级) |
徐州 |
| ✅ 已接入 | 徐州市图书馆全市联合目录(图星 LibStar Find,含鼓楼区馆等) |
淮安 |
| ✅ 已接入 | 淮安市图书馆全市联合目录(图星 LibStar Find,含少儿馆、清江浦区馆等) |
盐城 |
| ✅ 已接入 | 盐城市图书馆(图星 LibStar Find,单实例) |
丽水 |
| ✅ 已接入 | 丽水市公共图书馆联合目录(图创 Interlib pro2018,含景宁/庆元/缙云等县馆) |
舟山 |
| ✅ 已接入 | 舟山市图书馆(UILAS 知识检索平台) |
陕西省图书馆 |
| ✅ 已接入 | 陕西省图书馆(新版 UILAS REST 平台,省级馆馆址西安) |
西安 |
| ✅ 已接入 | 西安市公共图书馆集群平台(图创 Interlib pro2018,上下文 |
咸阳 |
| ✅ 已接入 | 咸阳市公共图书馆联盟(图创 Interlib) |
宝鸡 |
| ✅ 已接入 | 宝鸡市公共图书馆集群平台(图创 Interlib) |
安康 |
| ✅ 已接入 | 安康市图书馆(图创 Interlib pro2018) |
汉中 |
| ✅ 已接入 | 汉中市图书馆全市联合目录(图星 LibStar Find,含洋县等县馆) |
榆林 |
| ✅ 已接入 | 榆林市图书馆(新版 UILAS REST 平台) |
海口 |
| ✅ 已接入 | 海口市图书馆(图创 Interlib;海口图书馆为同一实例) |
株洲 |
| ✅ 已接入 | 株洲市图书馆(图创 Interlib) |
孝感 |
| ✅ 已接入 | 孝感市图书馆(图创 Interlib) |
荆门 |
| ✅ 已接入 | 荆门市图书馆(图创 Interlib) |
湖南图书馆 |
| ✅ 已接入 | 湖南图书馆省级馆(图创 Interlib) |
福建省图书馆 |
| ✅ 已接入 | 福建省图书馆(图创 Interlib) |
阳江 |
| ✅ 已接入 | 阳江市图书馆(图创 Interlib) |
淄博 |
| ✅ 已接入 | 淄博市图书馆(图创 Interlib) |
德州 |
| ✅ 已接入 | 德州市图书馆(图创 Interlib) |
周口 |
| ✅ 已接入 | 周口市图书馆(图创 Interlib) |
泉州 |
| ✅ 已接入 | 泉州市图书馆(图创 Interlib) |
通辽 |
| ✅ 已接入 | 通辽市图书馆(图创 Interlib) |
河源 |
| ✅ 已接入 | 河源市图书馆(图创 Interlib) |
黑龙江省图书馆 |
| ✅ 已接入 | 黑龙江省图书馆(图创 Interlib,检索走内嵌 Solr) |
长春 |
| ✅ 已接入 | 长春市图书馆(图创 Interlib,检索走内嵌 Solr) |
唐山 |
| ✅ 已接入 | 唐山市图书馆(图创 Interlib,检索走内嵌 Solr) |
包头 |
| ✅ 已接入 | 包头市图书馆(图创 Interlib,检索走内嵌 Solr) |
乌海 |
| ✅ 已接入 | 乌海市图书馆(图创 Interlib,检索走内嵌 Solr) |
呼和浩特 |
| ✅ 已接入 | 呼和浩特市图书馆(图创 Interlib,检索走内嵌 Solr) |
潮州 |
| ✅ 已接入 | 潮州市图书馆(图创 Interlib,检索走内嵌 Solr) |
兰州 |
| ✅ 已接入 | 兰州市图书馆(新版 UILAS REST 平台) |
江门 |
| ✅ 已接入 | 江门市图书馆(新版 UILAS REST 平台) |
河南省图书馆 |
| ✅ 已接入 | 河南省图书馆(老版 UILAS HTML OPAC) |
济南 |
| ✅ 已接入 | 济南市图书馆(图创 tcc-opac 全市联合目录) |
鄂尔多斯 |
| ✅ 已接入 | 鄂尔多斯市图书馆(图创 tcc-opac) |
丽江 |
| ✅ 已接入 | 丽江市图书馆全市联合目录(图创 Interlib,含古城区/玉龙/宁蒗/华坪等分馆) |
来宾 |
| ✅ 已接入 | 来宾市图书馆全市联合目录(图创 Interlib,含各镇/县分馆) |
黄石 |
| ✅ 已接入 | 黄石市图书馆(图创 Interlib) |
遵义 |
| ✅ 已接入 | 遵义市图书馆(图创 Interlib) |
黔东南 |
| ✅ 已接入 | 黔东南州图书馆(图创 Interlib,含乡镇分馆与城市书房) |
黔南 |
| ✅ 已接入 | 黔南州图书馆(图创 Interlib) |
曲靖 |
| ✅ 已接入 | 曲靖市图书馆(图创 Interlib) |
临沧 |
| ✅ 已接入 | 临沧市图书馆(图创 Interlib,含区县馆与乡镇分馆) |
楚雄 |
| ✅ 已接入 | 楚雄州图书馆(图创 Interlib) |
红河 |
| ✅ 已接入 | 红河州图书馆(图创 Interlib) |
德宏 |
| ✅ 已接入 | 德宏州图书馆(图创 Interlib) |
怒江 |
| ✅ 已接入 | 怒江州图书馆(图创 Interlib) |
德清 |
| ✅ 已接入 | 德清县图书馆(图创 Interlib,检索走内嵌 Solr) |
西双版纳 |
| ✅ 已接入 | 西双版纳州图书馆(图创 Interlib,检索走内嵌 Solr) |
太原 |
| ✅ 已接入 | 太原市图书馆(图创 Interlib,检索走内嵌 Solr) |
武汉 |
| ✅ 已接入 | 武汉图书馆(图创 Interlib) |
大庆 |
| ✅ 已接入 | 大庆市图书馆(图创 Interlib,应用上下文为根路径) |
枣庄 |
| ✅ 已接入 | 枣庄市图书馆(新版 UILAS REST 平台) |
乐山 |
| ✅ 已接入 | 乐山市图书馆(借四川省图书馆联合目录过滤;检索页为验证码墙,未过码时提示在浏览器手动解封) |
郑州 |
| ✅ 已接入 | 郑州图书馆(SirsiDynix Enterprise/VSE,服务端渲染;每页固定 12 条) |
更多城市 | — | 欢迎提需求或贡献适配器 | 北京等因站点侧限制暂未接入,详见 docs/data-sources/README.md |
Related MCP server: NLB Singapore Library MCP Server
安装
Claude Code
claude mcp add mcp-library-search -- uvx mcp_library_searchClaude Desktop
在 claude_desktop_config.json 里加:
"mcpServers": {
"mcp-library-search": {
"command": "uvx",
"args": ["mcp_library_search"]
}
}改完重启桌面版。
使用
接入后提供 3 个 tool,查询链路为:先 search_books 按关键字找到 book_id,再用它查馆藏或详情。都带 region 与 city 两个定位参数:region 是地区标识(取域名后缀),默认 cn(中国);city 默认 shanghai。未接入的地区或城市会返回明确提示:
tool | 作用 |
| 按关键字(书名、ISBN、作者等)搜书,返回分页列表,每条带 |
| 查这本书在哪些馆有、是否可借,可借的馆排前面; |
| 查这本书的完整介绍(ISBN、索书号、内容简介) |
典型用法:对 Claude 说"帮我查《三体》在哪个馆能借到" → 搜书拿到 book_id → 查各馆可借状态 → 就近推荐。
赞赏
如果这个项目帮到了你,欢迎打赏支持:
致谢
shanghai-library-book-search-python——上海图书馆检索能力的来源(Apache-2.0)。
完整的第三方组件列表、归属与变更说明见 NOTICE。
Available Tools
3 toolsfind_book_availabilityFind Book AvailabilityA
查询指定图书在各分馆的馆藏与可借状态,可借的馆排前面。
已借出的馆藏可能带 due_date(预计归还时间,YYYY-MM-DD),仅在 only_available=False 时出现;数据源查不到时为空串。
参数: book_id:search_books 返回的图书 ID,需与 search_books 使用同一 city city:城市标识,默认 "shanghai" only_available:True(默认)只返回当前可借的馆;False 返回全部馆藏
| Name | Required | Description | Default |
|---|---|---|---|
| city | No | shanghai | |
| book_id | Yes | ||
| only_available | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and does so well: it discloses ordering (available branches first), the conditional due_date field and its format, that due_date only appears when only_available=False, and the empty-string fallback when the data source misses. It omits error handling and any permission/latency context, which keeps it from a 5.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The body is front-loaded with the core behavior and then a compact parameter list, so it reads efficiently. The due_date explanation is worth its space, though the parameter block partly restates names and defaults already visible in the schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return structure need not be re-explained, and the description still adds useful field-level nuance (due_date, ordering, empty string). For a 3-parameter read tool with no annotations, this is nearly complete; only failure/edge-case behavior is unaddressed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0% and the description fully compensates: book_id is tied to search_books output and constrained to the same city, city carries its default value, and only_available is explained as a true/false filter with distinct result sets. This adds meaning well beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource — querying a book's holdings and borrowable status across branches — and immediately differentiates itself by noting the relationship to search_books (book_id must come from there and share the same city). An agent can distinguish it from search_books and get_book_detail without opening any schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It clearly establishes the context in which this tool applies (called after search_books, with matching city) and explains the only_available switch as the main usage decision. It stops short of explicitly stating when to prefer get_book_detail or what to do on a failed lookup, so it is strong but not exhaustive.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_book_detailGet Book DetailA
查询指定图书的完整介绍:书名、作者、出版社、出版年、ISBN、索书号、内容简介。
上海数据源没有独立简介区块,内容简介取自书目"附注"字段,可能带有 "新版本册内容:"之类的原生前缀。
参数: book_id:search_books 返回的图书 ID,需与 search_books 使用同一 city city:城市标识,默认 "shanghai"
| Name | Required | Description | Default |
|---|---|---|---|
| city | No | shanghai | |
| book_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| isbn | Yes | |
| title | Yes | |
| author | Yes | |
| book_id | Yes | |
| summary | Yes | |
| publisher | Yes | |
| call_number | Yes | |
| publish_year | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does disclose a non-obvious data trait: the Shanghai source has no dedicated summary block, so 内容简介 is pulled from the '附注' field and may carry native prefixes. That is genuinely useful behavioral context. It does not cover permissions, error behavior, or rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the return contents, then the data-source caveat, then the parameters – a sensible order with no filler. It is somewhat long for two parameters, but every clause adds information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return shape needn't be explained, and both parameters plus the cross-tool coupling are covered. The remaining gap is the absence of any safety/permission statement for a tool with zero annotations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate entirely, and it does: book_id is defined as 'the book ID returned by search_books' with a same-city coupling constraint, and city is defined with its default. Both parameters gain semantics that the bare schema lacks.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource ('查询指定图书的完整介绍') and enumerates the fields returned (书名、作者、出版社、ISBN、索书号、内容简介), so the agent knows exactly what it gets. It references search_books as the ID source but never states how it differs from find_book_availability, so sibling differentiation is only partial.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives a real prerequisite: book_id must come from search_books and must be paired with the same city used in that search, which is actionable context an agent would otherwise get wrong. It stops short of any when-not-to-use or explicit alternative routing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_booksSearch BooksA
按关键字搜索城市图书馆的馆藏图书,返回分页列表。
已接入城市:shanghai(上海,全市 900+ 网点,含地铁站 24 小时自助机);其他城市待接入。 keyword 可以是书名、ISBN、作者名等。每条结果带 book_id,是后续查询的凭据。 total_results 为 null 表示数据源不提供总数:用 page 继续翻页, 直到 has_next 为 false 或 books 为空。
参数: keyword:书名、ISBN、作者等检索词 city:城市标识,默认 "shanghai" page:页码,默认 1 limit:每页条数,默认 20
| Name | Required | Description | Default |
|---|---|---|---|
| city | No | shanghai | |
| page | No | ||
| limit | No | ||
| keyword | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| page | Yes | |
| books | Yes | |
| has_next | Yes | |
| total_pages | Yes | |
| total_results | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses the pagination contract (null total_results, iterate page until has_next is false or books is empty), states the actual data-source coverage limit (only shanghai, other cities pending), and explains the role of book_id as a follow-up credential. No auth, permission, or rate-limit details are given.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the core purpose, then operational notes (city coverage, paging), then parameters. Every sentence earns its place and the parameter block is justified given 0% schema coverage.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return fields needn't be explained, yet the description helpfully explains the semantics of total_results/has_next/books that the agent needs for paging. Combined with the parameter and coverage notes, the definition is essentially complete for calling this tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, and it does: keyword is defined semantically (title/ISBN/author), city is given its default and its only valid value, and page/limit are named with defaults. The page/limit descriptions add no behavior beyond the schema defaults, keeping it short of a 5.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('按关键字搜索...馆藏图书') plus scope (paginated list, city coverage). It hints at downstream use of book_id but never names the sibling tools (get_book_detail, find_book_availability), so an agent must infer the routing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives clear context for use: keyword matching on title/ISBN/author, default city shanghai with only shanghai currently supported. It also explains the paging protocol when total_results is null, which is genuine when-to-continue guidance, though it offers no explicit when-not-to-use-this-tool statement.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
find_book_availability - First observed
get_book_detail - First observed
search_books
TDQS
Scored across 3 tools
The three tools have clearly distinct purposes: search_books for keyword search, find_book_availability for branch-level availability, and get_book_detail for bibliographic details. Despite overlap in parameters (book_id, city), the descriptions and return types make the boundaries unambiguous.
All tool names use snake_case with a verb_noun pattern (search_books, find_book_availability, get_book_detail). The slight variation in verbs (search/find/get) is natural and consistent, not confusing.
Three tools is slightly lean but well-scoped for a library search server. Each tool earns its place, and there is no bloat. A few more tools (e.g., branch listing) could add value without being excessive.
The surface covers the core search lifecycle: search, availability, and detail. Minor gaps exist (e.g., no way to list supported cities or browse branches), but these are workaroundable and not critical for the stated purpose.
Maintenance
Related MCP Connectors
- LeafleOAuthnet.nanosheep
Personalised book recommendations, filtered to what's on your public library's shelf right now.
Search Chinese books with Douban ratings, AI book guides and curated toplists. Free, no API key.
Federated search of books and papers, BibTeX/RIS citations, open-access retrieval and reading.
Search 7,400+ libraries across Japan, find which one holds a book, and browse NDC classification.
Related MCP Servers
- AlicenseCqualityBmaintenanceProvides comprehensive access to South Korea's National Library information system, enabling searches across 1,000+ public libraries, real-time book availability checks, borrowing trends, and location-based library discovery.2711 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables searching the National Library Board Singapore catalogue by title, author, ISBN, or subject, and checking real-time availability of books across library branches.Apache 2.0
- AlicenseBqualityDmaintenanceEnables AI clients to search Aspen Discovery library catalogs and check real-time book availability by keyword, author, or ISBN. This server allows users to verify local library inventory and filter book recommendations accordingly.23 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables searching books, generating APA 7 citations, reserving available copies, and finding alternative books from a MySQL-backed library catalog through MCP.-