Skip to main content
Glama
amiro-lab

Naver Booking MCP

by amiro-lab
README.md
# Naver Booking MCP

국내 네이버 예약 가능 장소를 조회하는 MCP 서버입니다. 현재는 네이버 지도 검색을 자동 수집하지 않고, `data/places.json`에 seed로 등록한 네이버 예약 업체의 실시간 예약 가능 시간을 조회합니다. 미용실에 한정하지 않고 네이버 예약 `businessId`가 있는 장소라면 카테고리와 관계없이 등록할 수 있습니다.

## Run as MCP

```bash
npm run mcp
```

MCP 클라이언트 설정 예시:

```json
{
  "mcpServers": {
    "naver-booking": {
      "command": "node",
      "args": [
        "/Users/a1101417/Workshop/laboratory/naver-booking-mcp/src/mcp-server.js"
      ]
    }
  }
}
```

Available tools:

- `find_available_naver_bookings`: 국내 지역/카테고리/날짜 기준 예약 가능 장소 조회
- `get_naver_booking_availability`: `businessId` 1개 예약 가능 시간 조회
- `list_seeded_naver_booking_places`: 현재 seed로 등록된 조회 가능 장소 목록
- `search`: ChatGPT connector compatibility search tool
- `fetch`: ChatGPT connector compatibility detail fetch tool

## Run as Remote MCP

ChatGPT custom connectors need a remote MCP endpoint over HTTPS. This server exposes both HTTP/SSE and plain JSON-RPC HTTP endpoints:

```bash
PORT=8788 npm run remote
```

Local endpoints:

```text
http://localhost:8788/sse
http://localhost:8788/mcp
```

AWS endpoint before TLS:

```text
http://13.236.119.240:8788/sse
```

For ChatGPT, put this behind HTTPS with a domain, then use:

```text
https://YOUR_DOMAIN/sse
```

## Run locally

REST API도 같이 남겨두었습니다. 단순 HTTP 테스트가 필요할 때 사용합니다.

```bash
npm run dev
```

Health check:

```bash
curl http://localhost:8787/health
```

Search availability:

```bash
curl 'http://localhost:8787/availability?query=강남&limit=3'
```

List registered places:

```bash
curl 'http://localhost:8787/places?query=강남'
```

Check one place:

```bash
curl 'http://localhost:8787/places/992240/availability'
```

## GPT Action setup

GPT Actions require an externally reachable HTTPS URL and an OpenAPI schema. For local testing, expose this server with a tunnel such as ngrok or Cloudflare Tunnel, then import:

```text
https://YOUR_PUBLIC_HOST/openapi.yaml
```

In the GPT editor:

1. Create or edit a GPT.
2. Open **Actions** and choose **Create new action**.
3. Authentication: **None** for local/private testing, or add API key auth at your gateway if exposing publicly.
4. Import the schema from `/openapi.yaml` or paste `openapi.yaml`.
5. Use instructions like:

```text
When the user asks for Naver reservations near a domestic Korea location, call findAvailableNaverBookings.
Return only places with available=true. Include the earliest few available times and the bookingUrl.
Say that availability can change in real time.
If the user specifies a category such as hair salon, restaurant, hospital, activity, class, or accommodation, pass it as category. Otherwise use category=all.
```

OpenAI's GPT Actions docs state that actions connect a GPT to external APIs through authentication plus an OpenAPI schema.

## Seed data

Edit `data/places.json` to add more places:

```json
{
  "businessId": "992240",
  "name": "디온드헤어 강남역점",
  "country": "KR",
  "region": "서울 강남구",
  "area": "강남역",
  "category": "beauty",
  "keywords": ["강남", "강남역", "미용실", "헤어"],
  "bookingUrl": "https://m.booking.naver.com/booking/13/bizes/992240"
}
```

## Limitations

- Naver Map search returned `ncaptcha` for automated place-list collection in testing.
- This API does not bypass captcha or login.
- It checks known Naver Booking `businessId` values only. Add restaurants, clinics, classes, activities, and other reservable places to `data/places.json` as you collect IDs.
- Booking availability is real-time and can change before the user opens the Naver page.