OneMap MCP Server

OneMap MCP Server

Provides comprehensive access to Singapore's OneMap APIs, enabling AI assistants to perform location searches, routing, and coordinate conversions. It features over 35 tools for accessing thematic layers, population statistics, and public transport data.

Category
Visit Server

README

OneMap MCP Server v2

A Python-based MCP (Model Context Protocol) server that provides comprehensive access to Singapore's OneMap APIs. Built with FastMCP for easy integration with AI assistants and Microsoft AI Foundry.

Features

This server exposes 35+ tools across 10 API categories:

  • Search - Address and location search
  • Reverse Geocode - Convert coordinates to addresses (WGS84 and SVY21)
  • Routing - Public transport, driving, walking, cycling, barrier-free routes
  • Coordinate Converters - EPSG 4326 (WGS84), EPSG 3414 (SVY21), EPSG 3857
  • Themes - Access 100+ thematic layers for locations, amenities, boundaries
  • Planning Area - Singapore's 55 planning area information
  • Population Query - Demographics and statistics by planning area
  • Nearby Transport - Find nearby MRT/LRT stations and bus stops
  • Static Map - Generate static map images with optional overlays

Prerequisites

  • Python 3.11+
  • OneMap Account (register at OneMap API)

Installation

Local Development

  1. Clone the repository:
cd onemap-mcp
  1. Create a virtual environment:
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create .env file with your credentials:
cp .env.example .env
# Edit .env with your OneMap credentials
  1. Run the server:
python server.py

Environment Variables

Create a .env file with:

ONEMAP_EMAIL=your_email@example.com
ONEMAP_EMAIL_PASSWORD=your_password

Docker Deployment

  1. Build the Docker image:
docker build -t onemap-mcp .
  1. Run the container:
docker run -d \
  -e ONEMAP_EMAIL="your_email@example.com" \
  -e ONEMAP_EMAIL_PASSWORD="your_password" \
  --name onemap-mcp \
  onemap-mcp

Available Tools

Search & Geocoding

Tool Description
search Search for addresses, buildings, postal codes
reverse_geocode_wgs84 Get address from WGS84 coordinates
reverse_geocode_svy21 Get address from SVY21 coordinates

Routing

Tool Description
route_walk_drive_cycle Walking, driving, cycling, barrier-free routes
route_public_transport Bus and MRT routes with fare info

Coordinate Conversion

Tool Description
convert_4326_to_3857 WGS84 → Web Mercator
convert_4326_to_3414 WGS84 → SVY21
convert_3414_to_4326 SVY21 → WGS84
convert_3414_to_3857 SVY21 → Web Mercator
convert_3857_to_4326 Web Mercator → WGS84
convert_3857_to_3414 Web Mercator → SVY21

Themes

Tool Description
get_all_themes_info List all 100+ thematic layers
get_theme_info Get info about a specific theme
check_theme_status Check if theme was updated
retrieve_theme Retrieve theme data

Planning Areas

Tool Description
get_all_planning_areas Get all 55 planning area polygons
get_planning_area_names List planning area names
get_planning_area_by_location Get planning area for a location

Population Data

Tool Description
get_population_age_group Population by age
get_ethnic_distribution Ethnic group distribution
get_economic_status Employment statistics
get_household_monthly_income Income distribution
get_education_status Education levels
... and more

Transport

Tool Description
get_nearby_mrt_stations Find nearby MRT/LRT stations
get_nearby_bus_stops Find nearby bus stops

Static Maps

Tool Description
get_static_map Generate map images with overlays

Usage Examples

Search for a location

# Search for Marina Bay Sands
result = await search(search_value="Marina Bay Sands")

Get route directions

# Driving route from Changi to Orchard
result = await route_walk_drive_cycle(
    start_lat=1.3644,
    start_lon=103.9915,
    end_lat=1.3048,
    end_lon=103.8318,
    route_type="drive"
)

Find nearby MRT stations

result = await get_nearby_mrt_stations(
    latitude=1.3521,
    longitude=103.8198,
    radius_in_meters=1000
)

Project Structure

onemap-mcp/
├── server.py          # FastMCP server with all tools
├── mcp.json           # MCP manifest
├── tools.json         # Tool definitions for AI Foundry
├── onemap/
│   ├── __init__.py
│   └── utils.py       # HTTP client and utility functions
├── .env               # Your credentials (not in git)
├── .env.example       # Template for credentials
├── Dockerfile
├── requirements.txt
└── README.md

Deployment to Azure

Azure Container Apps

# Build and push to Azure Container Registry
az acr build --registry <registry-name> --image onemap-mcp:latest .

# Deploy to Container Apps
az containerapp create \
  --name onemap-mcp \
  --resource-group <resource-group> \
  --image <registry-name>.azurecr.io/onemap-mcp:latest \
  --env-vars ONEMAP_EMAIL=<email> ONEMAP_EMAIL_PASSWORD=<password>

Microsoft AI Foundry Integration

  1. Deploy the server to a publicly accessible endpoint
  2. Use the tools.json file to configure tool definitions
  3. Configure ONEMAP_EMAIL and ONEMAP_EMAIL_PASSWORD environment variables

License

MIT

Resources

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
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
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
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
E2B

E2B

Using MCP to run code via e2b.

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
Qdrant Server

Qdrant Server

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

Official
Featured