NLB Singapore Library MCP Server

NLB Singapore Library MCP Server

Enables searching the National Library Board Singapore catalogue by title, author, ISBN, or subject, and checking real-time availability of books across library branches.

Category
Visit Server

README

nlb-mcp

Unofficial FastMCP server for NLB Singapore Library Catalogue (availability + title search), implemented in Python.

What’s inside

  • Language: Python 3.11+
  • Framework: FastMCP (Python), httpx (HTTP), pydantic-settings (env), tenacity (retry)
  • Tools (MCP):
    • health_check – validate env + startup readiness.
    • search_titles – keyword search over BRN/ISBN/Title/Author/Subject.
    • search_titles_advanced – fielded search with pagination/sorting.
    • availability_by_title – branch-level availability for a title/ISBN/BID.

Project layout

nlb_mcp/
  config.py          # env validation (API keys, base URL, timeout)
  http_client.py     # httpx helper with retry/timeout
  nlb_client.py      # thin NLB REST client wrappers
  models.py          # lightweight normalized response shapes
  server.py          # FastMCP server + tool registration (with basic logging)
help/
  nlb-swagger.json   # upstream API spec for reference

Setup

  1. Create a virtualenv and install deps:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
  1. Environment:
NLB_API_KEY=your_api_key
NLB_APP_CODE=your_app_code
# optional
NLB_API_BASE=https://openweb.nlb.gov.sg/api/v2/Catalogue
REQUEST_TIMEOUT_MS=10000
  1. Run locally:
fastmcp run nlb_mcp/server.py:create_server

FastMCP Cloud entrypoint

  • Preferred: nlb_mcp/server.py:create_server
  • Direct object exports: nlb_mcp/server.py:server (aliases mcp, app) FastMCP Cloud can point at nlb_mcp/server.py:create_server; it will handle OAuth2 for users. This server only uses NLB X-Api-Key/X-App-Code from env.

Auth model

  • Client/user auth is handled by FastMCP’s built-in OAuth2 provider; this server does not add another layer of user auth.
  • NLB API authentication uses env-provided keys only; never accept them from user input or log them.
  • For per-user quotas/auditing, rely on FastMCP identity context when available.

Notes / TODO

  • If you want stricter schemas, consider pydantic models for tool inputs/outputs.
  • Add caching/rate limits if upstream limits are tight; httpx + tenacity already retry transient errors.
  • Logging uses stdlib logging (logger name nlb_mcp) with secret redaction; extend as needed for metrics or structured logs.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured