Provides access to US public library locations, branch details, and collection data from the IMLS survey for AI agents.
Also known as library-api/libraryapi-mcp, libraryapi-mcp
- Stars
- 0
- Tools
- 6
- Downloads, 30 days
- 133
- Latest version
- 0.1.3
- Last commit
- Oct 4, 2026
- License
- —
What is LibraryAPI MCP?
LibraryAPI provides access to US public library locations, branch details, and collection data from the IMLS survey for AI agents. It exposes 6 tools, such as find_libraries_near_address, find_libraries_near_coordinates, get_outlet.
Summary generated from the project's README
About LibraryAPI MCP server
LibraryAPI provides AI assistants with access to United States public library data sourced from the federal IMLS Public Libraries Survey. Developers can integrate this server into MCP-compatible clients like Claude Desktop or Cursor to enable location-based searches and administrative data retrieval. The server functions by exposing specific tools that allow agents to distinguish between entire library systems and individual branch outlets.
Users can install the server via pip or run it directly using uvx. Access requires a LIBRARYAPI_KEY obtained from libraryapi.dev, which offers a free tier limited to 500 requests per month. The available toolset includes find_libraries_near_address for proximity searches, search_libraries for finding systems by name or city, and get_state_summary for statewide statistics. While the data includes annual and weekly hours-open totals, it does not provide specific daily opening times for branches.
What you can do with it
- 1Locate nearby library branchesFind the closest public library locations to a specific street address or set of coordinates.
- 2Analyze statewide library statisticsRetrieve total counts and collection sizes for all public libraries within a specific state.
- 3Retrieve detailed branch informationGet a complete record for a specific library outlet using its unique ID.
- 4Search for library systemsIdentify administrative library entities by searching for their name, city, or state.
Written from the project's README. Every use case is checked against a quote from it.
How to install LibraryAPI MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall LibraryAPI MCP in Claude Code
$ claude mcp add --env 'LIBRARYAPI_KEY=<YOUR_LIBRARYAPI_KEY>' libraryapi-mcp -- uvx libraryapi-mcpInstall LibraryAPI MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"libraryapi-mcp": {
"command": "uvx",
"args": [
"libraryapi-mcp"
],
"env": {
"LIBRARYAPI_KEY": "<YOUR_LIBRARYAPI_KEY>"
}
}
}
}Install LibraryAPI MCP in VS Code
.vscode/mcp.json
{
"servers": {
"libraryapi-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"libraryapi-mcp"
],
"env": {
"LIBRARYAPI_KEY": "<YOUR_LIBRARYAPI_KEY>"
}
}
}
}Install LibraryAPI MCP in VS Code CLI
$ code --add-mcp '{"name":"libraryapi-mcp","type":"stdio","command":"uvx","args":["libraryapi-mcp"],"env":{"LIBRARYAPI_KEY":"<YOUR_LIBRARYAPI_KEY>"}}'Install LibraryAPI MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"libraryapi-mcp": {
"command": "uvx",
"args": [
"libraryapi-mcp"
],
"env": {
"LIBRARYAPI_KEY": "<YOUR_LIBRARYAPI_KEY>"
}
}
}
}Install LibraryAPI MCP in Codex
$ codex mcp add libraryapi-mcp --env 'LIBRARYAPI_KEY=<YOUR_LIBRARYAPI_KEY>' -- uvx libraryapi-mcpInstall LibraryAPI MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.libraryapi-mcp] command = "uvx" args = ["libraryapi-mcp"] [mcp_servers.libraryapi-mcp.env] LIBRARYAPI_KEY = "<YOUR_LIBRARYAPI_KEY>"
Install LibraryAPI MCP in Gemini CLI
$ gemini mcp add -s user -e 'LIBRARYAPI_KEY=<YOUR_LIBRARYAPI_KEY>' libraryapi-mcp uvx -- libraryapi-mcpInstall LibraryAPI MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"libraryapi-mcp": {
"command": "uvx",
"args": [
"libraryapi-mcp"
],
"env": {
"LIBRARYAPI_KEY": "<YOUR_LIBRARYAPI_KEY>"
}
}
}
}LibraryAPI MCP tools 6
Detected from the READMEfind_libraries_near_addressfind_libraries_near_coordinatesget_outletsearch_librariesget_libraryget_state_summary
| find_libraries_near_address | — | |
| find_libraries_near_coordinates | — | |
| get_outlet | — | |
| search_libraries | — | |
| get_library | — | |
| get_state_summary | — |
Configuration
LIBRARYAPI_KEYRequiredSecretAPI key from https://libraryapi.dev (free tier: 500 requests/month)
| Name | Description | |
|---|---|---|
| LIBRARYAPI_KEY | API key from https://libraryapi.dev (free tier: 500 requests/month) | RequiredSecret |
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work · What to fix for more points
- Source repository linked and reachablelibrary-api/libraryapi-mcp is public and reachablegithub.com/library-api/libraryapi-mcp ↗Pass
- Package names this repository as its sourcelibraryapi-mcp names library-api/libraryapi-mcp as sourcepypi.org/project/libraryapi-mcp/ ↗Pass
- Build provenance (Sigstore attestation)No build attestation published for this releaseNot checked
- Open source license (OSI)No licenseFinding
- Commit or release in the last yearLast commit or release 2026-10-04github.com/library-api/libraryapi-mcp ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from libraryapi-mcpPass
- No critical advisory in the package or its dependencies30 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model6 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHublibraryapi-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
pip install libraryapi-mcp
Or run directly with uvx (no install needed):
uvx libraryapi-mcp
Configuration
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"libraryapi": {
"command": "uvx",
"args": ["libraryapi-mcp"],
"env": {
"LIBRARYAPI_KEY": "your_api_key_here"
}
}
}
}
Cursor / other MCP clients
{
"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
| Tool | Description |
|---|---|
find_libraries_near_address |
Find the nearest branches to a US street address |
find_libraries_near_coordinates |
Same, but from a lat/lng (skips geocoding) |
get_outlet |
Full record for one branch outlet by ID |
search_libraries |
Search library systems by name, state, or city |
get_library |
Full system profile by FSCS ID |
get_state_summary |
Statewide 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
- Website: libraryapi.dev
- PyPI: pypi.org/project/libraryapi-mcp
- REST API docs: libraryapi.dev/docs
License
MIT
LibraryAPI MCP questions
How do I add LibraryAPI MCP to Claude Code?
Run claude mcp add --env 'LIBRARYAPI_KEY=<YOUR_LIBRARYAPI_KEY>' libraryapi-mcp -- uvx libraryapi-mcp in your terminal. Add --scope user to make it available in every project.
How do I add LibraryAPI MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does LibraryAPI MCP provide?
It exposes 6 tools, including find_libraries_near_address, find_libraries_near_coordinates, get_outlet, search_libraries, get_library.
What kind of library data is available?
The data includes library locations, collections, staffing, visits, programs, and finances based on the IMLS survey.
Can I find the specific daily opening hours for a library branch?
No, the API provides annual or weekly hours-open totals but does not include specific daily opening times.