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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file libraryapi_mcp-0.1.0.tar.gz.
File metadata
- Download URL: libraryapi_mcp-0.1.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b4909590d39f426ca922bcdad2818614d01c9932337d6cfa16bb2c35bdd0bd2
|
|
| MD5 |
c753fc65e1e42f602f46115e7e1c068a
|
|
| BLAKE2b-256 |
98839ae0428cb41c18de55b8aad965ea477d5e79a375a2fb2758b20f6f341b00
|
File details
Details for the file libraryapi_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: libraryapi_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d500772c0714bf4264e272aed475e5a2e78002422f1ebccf7a95b817c42596e
|
|
| MD5 |
be8a2f7b0c8732e16a1e9ce20176dab2
|
|
| BLAKE2b-256 |
700aff4a1689f3493e372c1b2d26e5040c046cedb17e3917b000e634792d35f4
|