LibraryAPI

Official registry Other

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

Install

Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).

PYPI package libraryapi-mcp
Claude Code
claude mcp add libraryapi -e 'LIBRARYAPI_KEY=<your libraryapi_key>' -- uvx libraryapi-mcp==0.1.3
JSON configuration (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "libraryapi": {
            "command": "uvx",
            "args": [
                "libraryapi-mcp==0.1.3"
            ],
            "env": {
                "LIBRARYAPI_KEY": "<your libraryapi_key>"
            }
        }
    }
}

Environment variables

  • LIBRARYAPI_KEY required secret API key from https://libraryapi.dev (free tier: 500 requests/month)

Documentation

From the project's README on GitHub, refreshed weekly. Links open on GitHub.

Contents
  1. libraryapi-mcp
  2. Installation
  3. Configuration
  4. Available Tools
  5. Examples
  6. Data note
  7. Links
  8. License

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

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

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.

License

MIT

Frequently asked questions

What is LibraryAPI?

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

How do I install LibraryAPI?

It runs on your machine. In Claude Code: claude mcp add libraryapi -e 'LIBRARYAPI_KEY=<your libraryapi_key>' -- uvx libraryapi-mcp==0.1.3. For other clients, paste the JSON configuration from this page into their MCP settings.

Does LibraryAPI need an API key?

Yes. It expects LIBRARYAPI_KEY, which you set in its configuration.

Is LibraryAPI open source?

Its code is public on GitHub, but the repository does not declare a standard license.

Who maintains LibraryAPI?

It is published by library-api. AI.tn lists it but does not maintain or endorse it.

From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.