A Model Context Protocol (MCP) server that provides real-time Singapore bus information using the LTA DataMall API.
This MCP server exposes 4 tools:
| Tool | Description |
|---|---|
get_bus_arrivals |
Get real-time bus arrival times for a specific bus stop |
get_bus_routes |
Get the full route information for a specific bus service |
search_bus_stops |
Search for bus stops by name, road name, or landmark |
get_bus_stop_info |
Get detailed information about a specific bus stop |
-
Push to GitHub:
git init git add . git commit -m "Initial commit" git remote add origin https://github.com/YOUR_USERNAME/sg-bus-mcp-server.git git push -u origin main
-
Connect to Vercel:
- Go to vercel.com
- Click "Add New Project"
- Import your GitHub repository
- Add the environment variable:
- Name:
LTA_DATAMALL_KEY - Value: Your LTA DataMall API key
- Name:
- Click "Deploy"
-
Install Vercel CLI:
npm i -g vercel
-
Deploy:
vercel
-
Add environment variable:
vercel env add LTA_DATAMALL_KEY
-
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env.local # Edit .env.local with your API key -
Run the development server:
npm run dev
-
Test with MCP Inspector:
npx @modelcontextprotocol/inspector@latest http://localhost:3000
After deployment, add this to your MCP client configuration (e.g., Claude Desktop, Cursor):
{
"mcpServers": {
"sg-bus": {
"url": "https://your-deployment-url.vercel.app/api/mcp"
}
}
}Once connected, you can ask your AI assistant questions like:
- "What buses are arriving at bus stop 83139?"
- "Search for bus stops near Orchard"
- "What's the route for bus 15?"
- "Tell me about bus stop 01012"
Bus data is provided by the LTA DataMall API.
MIT