Singapore Location Intelligence MCP
Provides comprehensive Singapore transport routing with real-time public transport data, weather-aware journey planning, postal code resolution, and Google Maps-quality turn-by-turn navigation across MRT, LRT, buses, and walking routes.
README
Singapore Location Intelligence MCP 🇸🇬
As the creator of this project, I, Siva (Sivasubramanian Ramanathan), developed this comprehensive Singapore Location Intelligence Platform to explore the capabilities of the Model Context Protocol (MCP). My goal was to test how MCP could be leveraged to help AI accurately plan routes, while also showcasing my ability to work with various APIs and my expertise in the technologies involved.
What began as an experiment with MCP integration evolved into a sophisticated, real-world application that demonstrates the power of this exciting new protocol to create tools that can rival commercial solutions. This platform provides enterprise-grade transport routing, postal code resolution, and location intelligence with Google Maps-level detailed navigation instructions, all optimized for Singapore's unique transport ecosystem.
🌟 Key Features
🎯 NEW in v0.3.0 - MRT Exit Integration & Landmarks Tool Fix
- 🚇 MRT Exit Recommendations - Google Maps-level precision with specific exit codes
- 🏛️ Enhanced Location Resolution - Fixed JSON string parsing and coordinate validation
- 📍 Exit-Level Navigation - "Use Exit E (14m walk, 1 min)" for optimal station navigation
- 🔧 Robust Input Handling - All location formats now work correctly
- 🎯 Singapore-Optimized - Proper coordinate bounds and postal code validation
🎯 v0.2.7 - Weather Service Fixes & Enhanced Reliability
- 🌦️ Robust Weather Integration - Fixed all weather API inconsistencies and crashes
- 🔧 Production-Ready Error Handling - Graceful degradation when weather APIs fail
- 🎯 Singapore Weather API Compatibility - Supports all 5 official weather endpoints
- ⚡ Enhanced Journey Planning - Weather-aware routing with resilient fallbacks
- 🛡️ Zero-Crash Guarantee - Weather service failures no longer break journey planning
🎯 NEW in v0.2.1 - Weather Intelligence
- 🌦️ Standalone Weather Tools - Comprehensive weather conditions and activity-specific advisories
- 🎯 Activity Recommendations - Tailored advice for walking, cycling, sports, photography, dining
- 🌡️ Comfort Analysis - Intelligent comfort level assessment with travel impact
- ⏰ Best Time Recommendations - Optimal timing for outdoor activities based on weather
🎯 NEW in v0.2.0 - Enhanced Intelligence
- 🔍 Advanced Fuzzy Search - "Opp Blk 910" → finds "Opposite Block 910" with 95% accuracy
- 🌦️ Weather-Aware Routing - Real-time weather impact on walking times and route suggestions
- 🚇 Transfer Minimization - Smart algorithms to reduce transfers in multi-modal journeys
- 🗺️ Google Maps-Quality Directions - "Turn Left To Stay On Thomson Road" level instructions
- 📍 Comprehensive Stop Details - Nearby amenities, accessibility info, and location context
🎯 Core Features
- 🎯 Advanced Postal Code Intelligence - 95% accuracy resolution for all Singapore postal codes
- 🗺️ Professional Navigation Instructions - Turn-by-turn directions like "Turn Left To Stay On Thomson Road"
- 🚇 Multi-Modal Transport Planning - Seamless integration of MRT, LRT, buses, and walking
- ⏰ Singapore Time Intelligence - Business hours, rush hour detection, and timing optimization
- 🔍 Intelligent Location Search - Fuzzy matching, typo tolerance, and smart suggestions
- 📍 Comprehensive Geocoding - Forward and reverse geocoding with Singapore-specific accuracy
- 🚌 Real-Time Transport Data - Live bus arrivals, train status, and service disruptions
- 💡 Context-Aware Routing - Peak hour optimization, last train warnings, night bus alternatives
🎯 Real-World Problem Solved
Before: Basic transport tools with failed postal code resolution After: Enterprise-grade location intelligence platform with weather-aware routing

INPUT: "How to get to Suntec City from Little India MRT during heavy rain?"
OUTPUT:
✅ Postal Code 039594 → SUNTEC CITY
🌧️ Heavy rain detected - prefer covered routes
🚇 Route: DT Line (8 min) → Covered walkway (6 min)
💰 Cost: $1.55 | 🕐 Duration: 32 minutes (adjusted for weather)
📍 Step-by-step: "Walk 246m via covered walkway to ROCHOR MRT → Take DT Line from Rochor to Promenade → Use underground connection to Suntec City"
⚠️ Weather Advisory: Allow extra 5 minutes for walking segments
🚀 Quick Start
Installation
npx @siva-sub/mcp-public-transport
Claude Desktop Setup
Add to your claude_desktop_config.json:
{
"mcpServers": {
"singapore-transport": {
"command": "npx",
"args": ["-y", "@siva-sub/mcp-public-transport"],
"env": {
"LTA_ACCOUNT_KEY": "your_lta_api_key_here",
"ONEMAP_TOKEN": "your_onemap_token_here",
"ONEMAP_EMAIL": "your_onemap_email@example.com",
"ONEMAP_PASSWORD": "your_onemap_password"
}
}
}
}
⚙️ Configuration
Required Environment Variables
LTA_ACCOUNT_KEY: Required. Your LTA DataMall API key (Get here)
Optional Environment Variables
ONEMAP_TOKEN: OneMap API token for enhanced features (Register here)ONEMAP_EMAIL: OneMap account email for authenticationONEMAP_PASSWORD: OneMap account password for authenticationCACHE_DURATION: Cache duration in seconds (default:300)LOG_LEVEL: Logging level (default:info)
🛠️ Available Tools
🌍 NEW - Enhanced Location Intelligence
-
search_bus_stops⭐ - Advanced fuzzy search with Singapore abbreviations- Supports: "Opp Blk 910", "Bef Jurong East MRT", "CP near Orchard"
- Intelligent pattern recognition and typo tolerance
- Distance-based ranking and confidence scoring
-
get_bus_stop_details⭐ - Comprehensive stop information- Real-time service information and nearby amenities
- Accessibility details and location context
- Walking distances to nearby stops
-
plan_comprehensive_journey⭐ - Complete multi-modal journey planning- Transfer minimization algorithms
- Real-time disruption handling
- Google Maps-quality turn-by-turn directions
- Weather impact on walking segments
- Supports all input types: addresses, postal codes, coordinates
🌍 Location Intelligence
search_location- Enhanced with fuzzy search capabilitiesresolve_postal_code- High-accuracy Singapore postal code resolution (95% success rate)reverse_geocode- Convert coordinates to addresses with Singapore-specific accuracy
🚌 Public Transport
get_bus_arrival- Real-time bus arrival times with crowding informationfind_bus_stops- Find bus stops by location, name, or coordinatesplan_comprehensive_journey- Multi-modal journey planning with detailed instructions
🚇 Train Services
get_train_service_status- Real-time MRT/LRT service status and disruptions
🚕 Taxis & Ride-Hailing
get_nearby_taxis- Find available taxis and estimate wait times
🚦 Traffic & Roads
get_traffic_conditions- Live traffic conditions, incidents, and road speeds
🌦️ NEW - Weather Intelligence
-
get_weather_conditions⭐ - Comprehensive real-time weather with travel impact- Real-time temperature, rainfall, humidity, and wind data
- Comfort level analysis and walking condition ratings
- Travel impact assessment with time adjustments
- Activity-specific recommendations and safety advice
-
get_weather_advisory⭐ - Activity-specific weather recommendations- Tailored advice for walking, cycling, outdoor dining, sports, photography
- Suitability ratings and best time recommendations
- Weather-specific safety guidance and precautions
📊 Enterprise Features
Advanced Routing with Weather Intelligence
// Weather-aware journey planning
{
"primaryRoute": {
"summary": {
"totalTime": 1980, // seconds (adjusted for weather)
"walkingTime": 720, // includes weather buffer
"transfers": 1
},
"weatherImpact": {
"conditions": {
"rainfall": 12.5, // mm
"temperature": 28, // °C
"humidity": 85 // %
},
"advisories": [
{
"severity": "high",
"type": "rain",
"message": "Heavy rain detected. Allow extra time for walking.",
"routingImpact": {
"walkingTimeMultiplier": 1.5,
"preferredModes": ["MRT", "Covered Bus Stops"]
}
}
]
}
}
}
Enhanced Bus Stop Search
// Fuzzy search with Singapore intelligence
{
"query": "Opp Blk 910",
"searchType": "fuzzy",
"results": [
{
"busStopCode": "83139",
"description": "OPP BLK 910",
"matchScore": 0.95,
"locationPatterns": {
"blockNumber": "910",
"direction": "opp"
},
"searchContext": {
"queryVariations": ["opposite block 910", "opp blk 910"],
"bestMatch": "OPP BLK 910"
}
}
]
}
Comprehensive Stop Details
// Detailed stop information with context
{
"details": {
"busStopCode": "83139",
"description": "OPP BLK 910",
"services": [...], // Real-time arrivals
"nearbyStops": [...], // Within walking distance
"accessibility": {
"wheelchairAccessible": true,
"sheltered": true,
"tactilePaving": true
},
"locationContext": {
"district": "Tampines",
"landmarks": ["Block 910", "Tampines Mall"],
"transportHubs": ["Tampines MRT Station"]
},
"nearbyAmenities": [
{
"name": "Tampines Mall",
"type": "shopping",
"distance": 250,
"walkingTime": 3
}
]
}
}
Singapore Time Intelligence
{
"singaporeTime": "27/06/2025, 10:58 PM",
"businessHours": false,
"rushHour": false,
"contextInfo": {
"nextRushHour": "7:00 AM tomorrow",
"travelRecommendation": "Off-peak travel - comfortable journey expected"
}
}
Postal Code Intelligence
{
"postalCode": "039594",
"location": {
"name": "SUNTEC CITY",
"address": "3 TEMASEK BOULEVARD SUNTEC CITY SINGAPORE 039594",
"district": "Downtown Core",
"areaType": "Central Singapore",
"confidence": 0.98
}
}
🎯 Use Cases
1. Navigation Applications
- Weather-aware route planning
- Detailed turn-by-turn directions
- Multi-modal journey optimization
- Real-time traffic integration
2. Delivery & Logistics
- Postal code validation and resolution
- Optimal route planning with weather considerations
- Address standardization and fuzzy matching
3. Urban Planning
- Transport accessibility analysis
- Weather impact on pedestrian traffic
- Peak hour traffic optimization
- Public transport coverage mapping
4. Tourism & Hospitality
- Tourist-friendly directions with landmarks
- Weather-appropriate route suggestions
- Public transport guidance
- Location discovery with fuzzy search
📈 Performance & Reliability
- Sub-3-second route planning with weather integration
- 5-minute weather data cache for real-time responsiveness
- Intelligent caching with location and weather-aware TTL
- Graceful degradation during API maintenance
- 95% postal code resolution accuracy
- Real-time data integration with official Singapore APIs
- Fuzzy search accuracy of 90%+ for Singapore terms
🔧 Advanced Configuration
Weather-Aware Route Preferences
{
"routingOptions": {
"includeWeatherImpact": true,
"maxWalkingDistance": 800,
"weatherSensitivity": "high",
"preferredModes": ["MRT", "Covered Bus Stops"],
"minimizeTransfers": true
}
}
Fuzzy Search Configuration
{
"searchOptions": {
"enableFuzzySearch": true,
"minScore": 0.3,
"singaporeAbbreviations": true,
"typoTolerance": true
}
}
Business Hours Configuration
{
"businessHours": {
"weekdays": { "start": 9, "end": 18 },
"saturday": { "start": 9, "end": 13 },
"sunday": { "closed": true }
}
}
🤝 API Integration
OneMap Integration
- Authentication: Automatic token refresh with 3-day TTL
- Geocoding: High-accuracy address resolution with fuzzy matching
- Routing: Professional-grade turn-by-turn directions
- Weather Integration: Real-time weather data from Singapore APIs
LTA DataMall Integration
- Real-time Data: Bus arrivals, train status, traffic conditions
- Transport Network: Complete bus and train network data
- Service Alerts: Live disruption and maintenance notifications
- Enhanced Error Handling: Graceful degradation and retry logic
Singapore Weather API Integration
- Real-time Data: Rainfall, temperature, humidity, wind speed
- 5-minute Updates: Fresh weather data for accurate routing
- Location-based: Weather conditions for specific route segments
- Advisory Generation: Smart recommendations based on conditions
🚀 Development
Local Development
git clone https://github.com/siva-sub/MCP-Public-Transport
cd MCP-Public-Transport
npm install
cp .env.example .env.local
# Add your API keys to .env.local
npm run dev
Building
npm run build # Builds both ESM and CJS versions
npm run test # Runs comprehensive test suite
npm run lint # TypeScript and ESLint checks
Testing
# Unit tests
npm run test
# Integration tests with real APIs
npm run test:integration
# Performance tests
npm run test:performance
📦 Architecture
src/
├── services/ # Core business logic
│ ├── lta.ts # LTA DataMall integration
│ ├── onemap.ts # OneMap API with authentication
│ ├── weather.ts # ⭐ Real-time weather integration
│ ├── routing.ts # ⭐ Enhanced multi-modal routing
│ ├── fuzzySearch.ts # ⭐ Singapore-optimized fuzzy search
│ ├── time.ts # Singapore time intelligence
│ ├── postalCode.ts # Postal code validation & resolution
│ └── cache.ts # Intelligent caching layer
├── tools/ # MCP tool implementations
│ ├── location/ # Enhanced location intelligence tools
│ ├── bus/ # ⭐ Enhanced bus tools with fuzzy search
│ │ ├── search.ts # ⭐ Advanced bus stop search
│ │ └── details.ts # ⭐ Comprehensive stop details
│ ├── routing/ # ⭐ Enhanced journey planning tools
│ │ └── enhanced.ts# ⭐ Weather-aware optimal routing
│ ├── train/ # Train service tools
│ └── traffic/ # Traffic and road tools
├── types/ # TypeScript interfaces
│ ├── location.ts # Location and search types
│ ├── transport.ts # Transport system types
│ ├── search.ts # Search and query types
│ └── time.ts # Singapore time types
└── utils/ # Shared utilities
├── errors.ts # Custom error handling
├── logger.ts # Structured logging
└── validation.ts # Input validation
🌟 What Makes This Special
- Singapore-Optimized: Built specifically for Singapore's unique transport ecosystem with local intelligence
- Weather-Aware: Real-time weather integration affects routing decisions and walking time estimates
- Professional-Grade: Routing instructions comparable to Google Maps with fuzzy search capabilities
- Real-Time Context: Business hours, rush hour, weather, and timing intelligence
- High Accuracy: 95% success rate for postal code resolution, 90%+ fuzzy search accuracy
- Enterprise-Ready: Comprehensive error handling, weather resilience, and performance optimization
- Developer-Friendly: Full TypeScript support with comprehensive documentation
- Transfer Minimization: Smart algorithms to reduce transfers in multi-modal journeys
🎯 Contributing
We welcome contributions! Please see our Contributing Guide for details.
📝 License
MIT License - see LICENSE for details.
🙏 Acknowledgments
- Singapore Land Authority (SLA) for OneMap API
- Land Transport Authority (LTA) for DataMall API
- Singapore Meteorological Service for weather data
- Model Context Protocol for the extensible framework
- Singapore Open Data initiative for public transport data
Built with ❤️ for Singapore's smart city initiative and MCP exploration
📊 Version 0.2.0 Statistics
- 11 Total Tools (up from 8)
- 4 New Major Services added
- 3 New Tools with advanced capabilities
- Weather API Integration for real-time conditions
- Fuzzy Search Engine with 50+ Singapore abbreviations
- Google Maps-Quality turn-by-turn directions
- Transfer Minimization algorithms
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。