LibraryAPI

dev.libraryapi由 libraryapi.dev 发布v0.1.3更新于 Oct 24, 2026

US public libraries and branches near any address, with collections from the IMLS survey

已验证STDIO仅桌面位置与生活数据与分析

概览

AI 生成的概览

LibraryAPI 让助手按地址、坐标、名称、州或城市查询美国公共图书馆及其分馆,数据来自联邦 IMLS 调查。

可以做什么
  • 根据美国街道地址或经纬度坐标查找附近的图书馆分馆
  • 按名称、州或城市搜索图书馆系统,并用 FSCS ID 获取完整系统档案
  • 按 ID 获取单个分馆的完整记录
  • 获取全州图书馆汇总数据,如分馆数量和馆藏规模
适用场景
适合需要美国公共图书馆位置、分馆详情或全州图书馆统计的场景,例如公民类或本地应用、社区调研,或回答某地址附近最近的分馆是哪几家。
运行要求
以 Python 包形式在本地通过 stdio 运行(pip install libraryapi-mcp 或 uvx libraryapi-mcp)。需要设置环境变量 LIBRARYAPI_KEY,免费密钥每月 500 次请求。需要访问 libraryapi.dev 服务的网络连接。
安装前请注意
API 密钥通过环境变量 LIBRARYAPI_KEY 传入,属于机密信息,不应外泄或提交到代码库。请求会消耗每月配额,地址或坐标查询会发送给第三方服务 libraryapi.dev。数据来自 IMLS 调查,只提供每周/每年开放总时长,不含每日具体开门时间。

安装

在 SourceWeft 中

  1. 打开 控制台中的 LibraryAPI,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

libraryapi-mcp

mcp-name: dev.libraryapi/libraryapi-mcp

MCP server for libraryapi.dev — US public library data for AI agents.

Expose library lookups as tools to any MCP-compatible AI assistant (Claude, Cursor, Copilot, etc.). Built on the federal IMLS Public Libraries Survey — public domain, commercially usable.

Installation

bash
pip install libraryapi-mcp

Or run directly with uvx (no install needed):

bash
uvx libraryapi-mcp

Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "libraryapi": {      "command": "uvx",      "args": ["libraryapi-mcp"],      "env": {        "LIBRARYAPI_KEY": "your_api_key_here"      }    }  }}

Cursor / other MCP clients

json
{  "mcpServers": {    "libraryapi": {      "command": "uvx",      "args": ["libraryapi-mcp"],      "env": {        "LIBRARYAPI_KEY": "your_api_key_here"      }    }  }}

Get a free API key at libraryapi.dev — 500 requests/month, no credit card.

Available Tools

ToolDescription
find_libraries_near_addressFind the nearest branches to a US street address
find_libraries_near_coordinatesSame, but from a lat/lng (skips geocoding)
get_outletFull record for one branch outlet by ID
search_librariesSearch library systems by name, state, or city
get_libraryFull system profile by FSCS ID
get_state_summaryStatewide library totals

Systems vs. outlets: a system is the administrative entity (e.g. "Chicago Public Library"); an outlet is an individual branch. Proximity searches return outlets.

Examples

Once configured, you can ask your AI assistant:

"What are the three closest public libraries to 350 Fifth Ave, New York?"

"How many public library branches are there in Vermont, and what's the total collection size?"

"I'm building a civic app — give me every library branch within 5 miles of downtown Chicago as JSON."

Data note

The IMLS survey covers locations, collections, staffing, visits, programs, and finances. It reports hours-open totals (annual, and per week) but not daily opening times — so this API can tell you a branch is open ~45 hours/week, not that it opens at 9am.

Links

License

MIT

来源:README.md,提交 4f38f01

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v0.1.3最新Oct 4, 2026
  2. v0.1.2Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。