Skip to main content
Glama
libraryapi-mcp

libraryapi-mcp

Official
by library-api

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

Related MCP server: Library of Congress MCP Server

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.

License

MIT

Available Tools

6 tools
find_libraries_near_addressA

Find the public library branches nearest to a US street address, sorted by distance.

Args: address: Full US street address, e.g. "350 Fifth Ave, New York, NY" radius_miles: Search radius in miles (0.1–50, default 10) limit: Maximum branches to return (1–100, default 10) include_closed: Include temporarily-closed branches (default False)

Inputs: address (required), limit, radius_miles, include_closed.

find_libraries_near_coordinatesA

Find the public library branches nearest to a latitude/longitude, sorted by distance. Use this when you already have coordinates; it skips geocoding and is faster than find_libraries_near_address.

Args: lat: Latitude (WGS84) lng: Longitude (WGS84) radius_miles: Search radius in miles (0.1–50, default 10) limit: Maximum branches to return (1–100, default 10) include_closed: Include temporarily-closed branches (default False)

Inputs: lat (required), lng (required), limit, radius_miles, +1 more.

get_libraryA

Get the full profile for a library system by its FSCS ID, including collections, staffing, visits, programs, and finances.

Args: fscs_id: IMLS FSCS ID for the library system, e.g. "IL0021"

Inputs: fscs_id (required).

get_outletA

Get the full record for one library branch (outlet) by its ID, including address, phone, coordinates, and service details.

Args: outlet_id: IMLS outlet ID

Inputs: outlet_id (required).

get_state_summaryA

Get statewide public library totals — systems, branch outlets, collections, and usage — for one state.

Args: state_code: Two-letter state abbreviation, e.g. "IL"

Inputs: state_code (required).

search_librariesA

Search public library systems by name, state, and/or city. A system is the administrative entity (e.g. "Chicago Public Library") that operates one or more branch outlets. Provide at least one of name, state, or city.

Args: name: Library system name (full-text search) state: Two-letter state code, e.g. "IL" city: City name (substring match) limit: Results per page (1–100, default 20) offset: Pagination offset (default 0)

Inputs: city, name, limit, state, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a distinct purpose: get_library fetches system-level data by ID, get_outlet fetches branch-level data, search_libraries finds systems by criteria, find_libraries_near_address/coordinates handle geolocation, and get_state_summary provides aggregates. No two tools overlap in a way that would confuse an agent.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun snake_case pattern (get_, find_, search_). The naming is predictable and clearly indicates the action and target resource.

    Tool Count5/5

    Six tools is well-scoped for a library data API. Each tool covers a distinct query pattern (lookup by ID, search, geospatial, summary) without unnecessary redundancy or bloat.

    Completeness5/5

    The tool surface covers the core domain tasks: retrieving individual records (library, outlet), searching for systems, finding nearby branches by address or coordinates, and getting statewide summaries. This is a complete set for the apparent purpose of accessing public library statistics and locations.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to query U.S. public-health datasets such as disease surveillance, mortality, behavioral risk factors, and flu activity through the Socrata API, using natural language or direct tool calls.
      296 npm
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to access official Census Bureau statistics through the Census Data API and other official sources, supporting dataset discovery, geography resolution, FIPS lookup, and aggregate data retrieval.
      -