Data4Library MCP is a comprehensive MCP (Model Context Protocol) server developed to fully leverage the Data4Library API provided by the National Library of Korea. It enables AI models to easily access and utilize information about all Korean public libraries, book searches, loan status, reading statistics, and more.
π°π· Korean Documentation: README-ko.md
Data4Library is a national public library integrated information service operated by the National Library of Korea. It integrates and provides real-time data from over 1,000 public libraries nationwide, including:
- π Nationwide public library locations and operational information (1,000+ libraries)
- π Book holdings and loan status (real-time)
- π Loan statistics and trend analysis
- π₯ Popular books and trending titles
- π Regional/age-based reading quantity statistics
- π New arrival information
- ποΈ Nationwide Public Library Search (
search_libraries): Search by region, library name - π Comprehensive Book Search (
search_books): Search by title, author, publisher, subject - π Library Holdings Search (
search_libraries_by_book): Find libraries that hold specific books - π Book Details (
get_book_detail): Detailed information lookup by ISBN - β
Loan Availability (
check_book_availability): Real-time loan availability status
- π₯ Popular Loan Books (
search_popular_books): National/regional bestsellers - π Library-specific Popular Books (
search_popular_books_by_library): Popular books at specific libraries - π Trending Books (
get_hot_trend): Real-time trending book queries - π New Arrivals (
get_new_arrival_books): Latest acquisitions by library - π·οΈ Monthly Keywords (
get_monthly_keywords): Reading trend keywords
- π Loan/Return Trends (
get_usage_trend): Library usage statistics graphs - π Regional Reading Volume (
get_reading_quantity): Reading rate and volume comparison - π Collection/Loan Data (
search_items): Detailed library statistics - π Book Usage Analysis (
get_book_usage_analysis): Usage patterns for specific books
- π Expert Recommendations (
get_mania_recommendations): Advanced books for specialists - π Avid Reader Recommendations (
get_reader_recommendations): Books for continuous reading - π·οΈ Book Keyword Analysis (
get_book_keywords): Core keywords for each book
- π Nearby Library Search (
search_nearby_libraries): GPS-based automatic nearby library search- Distance Sorting: Real-time distance calculation and nearest-first sorting
- Detailed Distance Information: Precise distance (km) to each library
- ποΈ Library Code Search (
search_library_codes): Find libCode by library name - π Region Code Lookup (
get_region_codes,get_detailed_region_codes): National/detailed region codes - π Subject Classification Codes (
get_subject_codes,get_detailed_subject_codes): KDC major/sub-classifications - π Integrated Information Lookup (
get_library_info,get_popular_books_by_library): Comprehensive library information
- π Usage Statistics (
session_stats): Real-time tool call statistics and session information
- "Where are libraries near me?" β Use
search_nearby_libraries - "Find libraries in Gangnam-gu, Seoul" β Sequential use of
search_detailed_region_codes+search_libraries
- "Where can I borrow Harry Potter books?" β Link
search_books+search_libraries_by_book - "Find novels by Kim Young-ha" β
search_books(author name search)
- "What books are popular these days?" β
search_popular_booksorget_hot_trend - "Popular books at Gangnam Library" β
search_library_codes+search_popular_books_by_library
- "How much do people in Seoul read?" β
get_reading_quantity - "Show me library usage graphs" β
get_usage_trend
-
"New book status at nearby libraries"
search_nearby_libraries(location-based library search)get_new_arrival_books(new arrivals for each library)
-
"Show popular economics books ranking in Gangnam-gu libraries"
search_detailed_region_codes(lookup Gangnam-gu code)get_subject_codes(lookup economics field code)search_popular_books_by_library(search with filters applied)
- β Complete API Wrapping: Full support for all 25 Data4Library API endpoints
- π Smart Chaining: Automatic tool linking for complex query processing
- β‘ Real-time Data: Real-time synchronization with Data4Library
- πΊοΈ Location-based Algorithm: Custom implementation using Haversine formula for distance calculation and sorting
- π‘οΈ Zod Schema Validation: Type safety assurance for all input values
- π Session Statistics: Real-time tool usage monitoring
- π§ Error Handling: Detailed logging and debugging information
- π― Scenario-based Descriptions: Specific usage scenarios to help LLMs easily select appropriate tools
- Neighborhood library status and operational information chatbots
- New/popular book notification services
- KDC subject-based reading trend analysis
- Age/regional reading statistics reports
- Popular genre/book discovery (by age/gender/region)
- Trend change monitoring
- ISBN-based real-time holdings/loan availability UX
- Location-based library recommendations
- Node.js 18+
- Data4Library API key
- Sign up at Data4Library
- Log in and click [MyPage] in the top right
- Select Authentication Key from the MyPage menu
- Check appropriate usage purpose and agree to personal information collection terms
- Click Complete Modification button
- Status will show Pending Approval - approval takes time
- After approval, copy the issued API key and store it in environment variables
π‘ Note: Approval processing may take time. Usually approved the next morning after application.
- Default: 500 calls per day limit
- After IP Registration: 30,000 calls per day limit
IP Registration Method: In MyPage β Authentication Key Management, enter your computer's IP address in the Server IP field where the MCP server will run. This expands the call limit from 500 to 30,000 per day.
- LIBRARY_API_KEY (required): API key issued from Data4Library
Windows PowerShell (current session):
$env:LIBRARY_API_KEY="your-api-key"macOS/Linux:
export LIBRARY_API_KEY="your-api-key"The easiest way to use this MCP server is through NPX installation. For detailed package information, see the NPM package page.
Add the following to your Claude Desktop config file (Windows: %APPDATA%\Claude\claude_desktop_config.json, macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"data4library-mcp": {
"command": "npx",
"args": ["-y", "@isnow890/data4library-mcp"],
"env": {
"LIBRARY_API_KEY": "your-api-key"
}
}
}
}Add to mcp.json:
{
"mcpServers": {
"data4library-mcp": {
"command": "npx",
"args": ["-y", "@isnow890/data4library-mcp"],
"env": {
"LIBRARY_API_KEY": "your-api-key"
}
}
}
}For local development or custom modifications:
git clone https://github.com/isnow890/data4library-mcp.git
cd data4library-mcp
npm install
npm run build- Download the latest version from GitHub Releases page
- Extract the ZIP file to your desired location
- Navigate to the extracted folder in terminal:
cd /path/to/data4library-mcp
npm install
npm run buildnpm run build to generate the compiled JavaScript files in the dist folder.
After build completion, you'll need:
- LIBRARY_API_KEY: API key issued from Data4Library
- Installation path: Absolute path to the downloaded folder
Add the following to Claude Desktop config file (%APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"data4library-mcp": {
"type": "stdio",
"command": "cmd",
"args": [
"/c",
"node",
"C:\\path\\to\\data4library-mcp\\dist\\src\\index.js"
],
"cwd": "C:\\path\\to\\data4library-mcp",
"env": {
"LIBRARY_API_KEY": "your-api-key"
}
}
}
}Add the following to Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"data4library-mcp": {
"type": "stdio",
"command": "node",
"args": ["/path/to/data4library-mcp/dist/src/index.js"],
"cwd": "/path/to/data4library-mcp",
"env": {
"LIBRARY_API_KEY": "your-api-key"
}
}
}
}- Windows: Change
C:\\path\\to\\data4library-mcpto your actual downloaded folder path - macOS/Linux: Change
/path/to/data4library-mcpto your actual downloaded folder path - Build path: Make sure the path points to
dist/src/index.js(not justindex.js)
Finding the path:
# Check current location
pwd
# Absolute path examples
# Windows: C:\Users\YourName\Downloads\data4library-mcp
# macOS: /Users/YourName/Downloads/data4library-mcp
# Linux: /home/YourName/Downloads/data4library-mcpAfter completing the configuration, completely close and restart Claude Desktop to activate the Data4Library MCP server.
To run directly without Claude Desktop integration:
npm start
# or
node dist/src/index.jsDocker (optional):
docker build -t data4library-mcp .
docker run -i --rm -e LIBRARY_API_KEY=$LIBRARY_API_KEY data4library-mcpMCP client integration (.mcp.json example, local run):
{
"mcpServers": {
"data4library-mcp": {
"type": "stdio",
"command": "node",
"args": ["dist/src/index.js"],
"env": {
"LIBRARY_API_KEY": "your-api-key"
}
}
}
}- Fuzzy search: Use
search_library_codesto find libraries by partial name/address - Code helpers:
get_subject_codes,search_detailed_kdc_codes,search_detailed_region_codesfor required parameter code lookup - Session monitoring:
session_statsshows per-session tool usage/limits - Tool chaining: Complex queries can be solved by using multiple tools sequentially
- License: MIT (see LICENSE file)
- Data source: Data4Library public API
- Usage: Follow public API policies/quotas. Do not store/expose personal data.
π¬ Questions or feedback? Please open a GitHub issue!

