@anson2dev/o2o
v0.1.0
Published
MCP Server for AI Agents to search and book hotels across 7000+ properties in China
Maintainers
Readme
@anson2dev/o2o
MCP Server + CLI for AI Agents to search and book hotels across 7000+ properties in 469 cities across China.
为 AI Agent 提供中国 469 个城市、7000+ 酒店的搜索和预订能力的 MCP Server + CLI 工具。
Quick Start / 快速开始
# Run as MCP server (for AI agents)
npx @anson2dev/o2o
# Or use the CLI directly
npx @anson2dev/o2o search 上海
npx @anson2dev/o2o detail 021010
npx @anson2dev/o2o citiesEnvironment Variables / 环境变量
| Variable | Required | Description |
|----------|----------|-------------|
| O2O_API_BASE_URL | Yes | Platform API base URL |
| O2O_APP_KEY | For booking | App key for order endpoints |
| O2O_ANALYTICS_URL | No | Anonymous analytics endpoint |
| O2O_TELEMETRY | No | Set to "false" to disable analytics |
| O2O_OTA_CHANNEL | No | OTA channel identifier (default: "mcp-agent") |
| O2O_REQUEST_TIMEOUT | No | Request timeout in ms (default: 5000) |
Agent Configuration / Agent 配置
Add to your MCP client config (e.g., Claude Desktop claude_desktop_config.json):
{
"mcpServers": {
"o2o-hotel": {
"command": "npx",
"args": ["@anson2dev/o2o"],
"env": {
"O2O_API_BASE_URL": "https://your-api.example.com",
"O2O_APP_KEY": "your-app-key"
}
}
}
}CLI Usage / 命令行使用
o2o # Start MCP server (default)
o2o serve # Start MCP server (same)
o2o search <city> # Search hotels in a city
o2o detail <hotel_id> # Show hotel details and rooms
o2o cities # List available cities
o2o help # Show helpExamples:
o2o search 上海
o2o search Shanghai --checkin 2026-04-01 --checkout 2026-04-03
o2o detail 021010Available Tools / 可用工具
search_hotels — Search Hotels / 搜索酒店
Search hotels in 36+ major Chinese cities by name (Chinese/English/Pinyin).
city: "Shanghai" or "上海"
check_in: "2026-04-01"
check_out: "2026-04-03"
keyword: "希尔顿" (optional)
limit: 10 (optional)get_hotel_detail — Hotel Details / 酒店详情
Get hotel details with room availability and pricing for specific dates.
hotel_id: "H001"
check_in: "2026-04-01"
check_out: "2026-04-03"create_booking — Book Hotel / 预订酒店
Create a hotel reservation. Most hotels support pay-at-hotel.
hotel_id: "H001"
room_code: "RC001"
check_in: "2026-04-01"
check_out: "2026-04-03"
guest_name: "张三"
guest_phone: "13800138000"check_order_status — Check Order / 查询订单
Check the status of an existing booking.
order_no: "12345"Typical Workflow / 典型工作流
search_hotels— Find hotels in a cityget_hotel_detail— Check room availability and pricingcreate_booking— Make a reservationcheck_order_status— Verify booking status
Privacy / 隐私
This MCP server sends anonymous usage analytics (search counts, city distribution) to help improve the service. No personal information is collected. Disable with O2O_TELEMETRY=false.
本 MCP Server 发送匿名使用统计(搜索次数、城市分布)以改善服务。不收集个人信息。设置 O2O_TELEMETRY=false 可禁用。
Development / 开发
npm install
npm run dev # Run in development mode
npm test # Run tests
npm run build # Build for productionLicense
MIT
