
UK Bus Departures MCP Server
Enables users to get real-time UK bus departure information and validate bus stop ATCO codes by scraping bustimes.org. Provides structured data including service numbers, destinations, scheduled and expected departure times for any UK bus stop.
README
UK Bus Departures MCP Server
An MCP (Model Context Protocol) server that provides real-time UK bus departure information by scraping bustimes.org.
Features
- 🚌 Real-time bus departure information for UK stops
- 🔍 ATCO code validation
- ⚡ Built-in caching and rate limiting
- 🌐 Cloudflare Workers compatible
- 📊 Structured JSON responses
Usage
This MCP server provides the following tools:
get_bus_departures
Fetches real-time bus departures for a UK bus stop.
Parameters:
stop_code
(string): UK bus stop ATCO code (e.g., '0100BRP90023')
Example:
{
"tool": "get_bus_departures",
"arguments": {
"stop_code": "0100BRP90023"
}
}
Response:
{
"departures": [
{
"service_number": "75",
"destination": "Hengrove Park",
"scheduled_time": "15:02",
"expected_time": "15:14"
}
],
"stop_name": "Bishopston Sommerville Road (S-bound)",
"stop_code": "0100BRP90023",
"location": [-2.59102, 51.47324],
"last_updated": "2025-09-13T14:28:00.000Z"
}
validate_atco_code
Validates an ATCO code format and returns stop metadata if valid.
Parameters:
stop_code
(string): ATCO code to validate
Response:
{
"stop_code": "0100BRP90023",
"is_valid": true,
"metadata": {
"name": "Bishopston Sommerville Road",
"common_name": "Sommerville Road",
"long_name": "Bishopston Sommerville Road (S-bound)",
"location": [-2.59102, 51.47324],
"indicator": "S-bound",
"bearing": "S",
"active": true
}
}
ATCO Codes
UK bus stops use ATCO (Association of Transport Coordinating Officers) codes with the format:
- 13 characters:
NNNNAAANNNNN[A]
- 4 digits + 3 letters + 5 digits + optional letter
- Example:
0100BRP90023
Rate Limiting
The server implements:
- 2-second delay between requests to bustimes.org
- 5-minute caching for stop metadata (departures are always fresh)
- Respectful scraping practices
Development
Prerequisites
- Node.js 18+
- Wrangler CLI
Local Development
npm install
npm run dev
Deployment
npm run deploy
Type Checking
npm run type-check
API Endpoints
When deployed as a Cloudflare Worker:
GET /mcp
- MCP protocol endpointGET /sse
- Server-Sent Events endpoint
Connect to Claude Desktop
To connect this MCP server to Claude Desktop:
- Follow Anthropic's Quickstart
- In Claude Desktop go to Settings > Developer > Edit Config
- Update with this configuration:
{
"mcpServers": {
"uk-bus-departures": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8787/sse"
]
}
}
}
For deployed version, replace localhost URL with your Workers domain.
Technical Details
Data Sources
- bustimes.org API: Stop metadata (names, coordinates, etc.)
- bustimes.org HTML: Real-time departure information via scraping
Architecture
- Parser: Robust HTML parsing with multiple fallback strategies
- Service: HTTP client with rate limiting and caching
- Models: Type-safe data structures using Zod schemas
Error Handling
- Invalid ATCO codes (format validation)
- Missing bus stops (404 responses)
- Network timeouts and failures
- HTML structure changes
Limitations
- UK Only: Limited to UK bus stops with ATCO codes
- HTML Dependency: Fragile to website structure changes
- Rate Limited: 2-second delays between requests
- No Historical Data: Real-time and scheduled data only
License
MIT License
Disclaimer
This server scrapes public data from bustimes.org for informational purposes. Please use responsibly and respect the website's terms of service.
推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。