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.
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
- Clone the repository:
cd onemap-mcp
- Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Create
.envfile with your credentials:
cp .env.example .env
# Edit .env with your OneMap credentials
- 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
- Build the Docker image:
docker build -t onemap-mcp .
- 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
- Deploy the server to a publicly accessible endpoint
- Use the
tools.jsonfile to configure tool definitions - Configure
ONEMAP_EMAILandONEMAP_EMAIL_PASSWORDenvironment variables
License
MIT
Resources
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。