# mcp.zzo.kr — MCP gateway for agents

This host serves agents, not end users. A human only sees it by connecting an MCP client to the
endpoint below; every HTTP resource here is a machine-readable catalog.

- MCP endpoint (Streamable HTTP): https://mcp.zzo.kr/mcp
- Machine catalog (JSON): https://mcp.zzo.kr/catalog.json
- This document: https://mcp.zzo.kr/llms.txt
- Health: https://mcp.zzo.kr/health
- Services: 1 (call list_services for the live registry)

## Rules for agents

1. Discover before acting: tools/list for tools, list_services for services and their status.
2. Anonymous creation needs no key. Account-scoped calls require the caller's own API key in the
   per-request header; this gateway never substitutes a shared key.
3. Never put API keys or passwords in tool arguments, prompts, or logs. Passwords only travel through
   the secure input windows, which return a one-use credential_ref (5 min).
4. Destructive calls (delete_*) are irreversible: confirm with the user first.
5. Do not retry create/delete blindly after an ambiguous result; re-read state instead.
6. When a tool returns success=false, report the error verbatim and its required_scope.

## Service: shortener — zzo.kr URL 단축

Status: active | Backend: https://zzo.kr

긴 URL을 zzo.kr 단축 코드로 바꾸고, QR·비밀번호 보호·만료·통계·내보내기를 다룹니다.

Auth: header `X-ZZO-Authorization` with value `Bearer <zzo_api_key>`.
익명 생성은 키가 필요 없습니다. 계정 링크·통계·키 조회는 사용자 본인 키로만 동작하며, 공용 서비스 키는 쓰지 않습니다.
Key issuance: https://zzo.kr/url (browser flow via browser_handoff('api_keys')).

| scope | tools |
| --- | --- |
| `links:read` | list_links, get_link, export_links |
| `links:write` | shorten_url(추적·계정 소유), update_link, import_managed_link |
| `links:delete` | delete_link |
| `stats:read` | get_link_stats, get_aggregate_stats, get_link_analytics |
| `keys:read` | list_api_keys, get_api_key_history |

### 생성

| tool | purpose | auth |
| --- | --- | --- |
| `shorten_url` | 링크 생성. alias 커스텀 코드, tracking, 만료, 예약 시작, 일회용, 비밀번호 보호 | 익명 가능 / 추적·계정 소유는 키 |
| `shorten_urls_bulk` | 일괄 생성 (익명 20 / 계정 소유 100) | 위와 같음 |
| `check_code_availability` | 커스텀 코드 사용 가능 여부 확인 (생성 시 원자적 재확인) | 없음 |

### QR

| tool | purpose | auth |
| --- | --- | --- |
| `create_qr` | QR 이미지·다운로드 URL 생성 | 없음 |
| `download_qr` | 코드 또는 URL로 QR 다운로드 링크 | 없음 |

### 비밀번호 입력 (보안 창)

| tool | purpose | auth |
| --- | --- | --- |
| `start_managed_link_password_input` | 관리 비밀번호 입력 창 열기 | 없음 |
| `complete_managed_link_password_input` | 입력 완료 후 credential_ref 발급 | 없음 |
| `start_visitor_password_input` | 방문자 비밀번호 입력 창 열기 | 없음 |
| `complete_visitor_password_input` | 방문자 비밀번호 credential_ref 발급 | 없음 |
| `change_managed_link_password` | 관리 비밀번호 교체·제거 | 비밀번호 흐름 |

### 익명 링크 관리

| tool | purpose | auth |
| --- | --- | --- |
| `get_managed_link` | 링크 정보 조회 | 비밀번호 흐름 |
| `update_managed_link` | 목적지·활성·추적·만료·이름·접근 설정 변경 | 비밀번호 흐름 |
| `delete_managed_link` | 링크 삭제 | 비밀번호 흐름 |
| `get_managed_link_stats` | 클릭 통계 | 비밀번호 흐름 |
| `get_managed_link_analytics` | 상세 통계 (기간·간격·시간대) | 비밀번호 흐름 |
| `export_managed_links` | 최대 20개 일괄 내보내기 | 비밀번호 흐름 |

### 계정 링크

| tool | purpose | auth |
| --- | --- | --- |
| `list_links` | 목록 조회 (q·tag·folder·sort·커서) | links:read |
| `get_link` | 단건 조회 | links:read |
| `update_link` | 목적지·활성·추적·만료·이름·라벨 변경 | links:write |
| `delete_link` | 삭제 (30일 코드 예약) | links:delete |
| `export_links` | JSON 내보내기 (커서 페이지) | links:read |
| `import_managed_link` | 비밀번호로 증명한 익명 링크를 계정으로 이관 | links:write |

### 통계

| tool | purpose | auth |
| --- | --- | --- |
| `get_link_stats` | 링크 클릭 수 | stats:read |
| `get_aggregate_stats` | 계정 전체 통계 | stats:read |
| `get_link_analytics` | 상세 통계 (hour~year, IANA 시간대) | stats:read |

### API 키

| tool | purpose | auth |
| --- | --- | --- |
| `list_api_keys` | 키 메타데이터 조회 (키 원문은 저장·반환하지 않음) | keys:read |
| `get_api_key_history` | 키 변경 이력 | keys:read |

### Fallback

| tool | purpose |
| --- | --- |
| `browser_handoff` | 로그인 동의·API 키 발급/회전은 브라우저에서 진행 |

### Examples

```
shorten_url {"url": "https://example.com/long/path", "alias": "launch-2026"}
  -> {"success": true, "short_url": "https://zzo.kr/launch-2026", "code": "launch-2026"}
check_code_availability {"code": "launch-2026"}      # before creating, optional
update_link {"code": "launch-2026", "title": "campaign", "tags": ["launch"],
            "expiry_mode": "custom", "expires_at": "2026-12-31T00:00:00Z"}
get_link_analytics {"code": "launch-2026", "start": "2026-11-01", "end": "2026-11-30",
                   "interval": "day", "timezone": "Asia/Seoul"}
export_links {"limit": 100}   # -> links[], next_cursor
```

## Errors

| status | meaning |
| --- | --- |
| `400` | 입력이 올바르지 않음 (URL·alias·날짜·option) |
| `401` | 키 없음·폐기·만료, 또는 비밀번호 불일치 |
| `403` | scope 부족 또는 링크 소유권 없음 |
| `404` | 링크가 없거나 내 소유가 아님 |
| `409` | alias 사용 중 또는 30일 예약 |
| `410` | 만료·비활성·소진된 링크 |
| `422` | 목적지가 안전성 검사를 통과하지 못함 (blocked·pending·failed는 저장되지 않음) |
| `429` | 요청 일시 제한 |
| `503` | 저장소·검사기 일시 불가 |

Failures return `{"success": false, "error": "..."}` and, where relevant, `required_scope`.

## Limits

- 일괄 생성: 익명 20개 / 계정 소유 100개
- 비밀번호 입력 참조(credential_ref)는 5분 뒤 만료되고 1회만 사용
- QR 다운로드 URL 2048자까지
- 이름 변경 시 이전 코드는 30일 예약, 삭제도 30일 코드 보유
- 삭제는 되돌릴 수 없음 — 호출 전에 사용자 확인 필요
- 생성·삭제 요청은 결과 확인 없이 자동 재시도하지 않음

## Adding a service

New services are appended to the registry in catalog.py; this page, /catalog.json and
list_services are generated from it. Tools keep flat names, so a new service must not reuse an
existing tool name; prefix new tools with the service id when the meaning would collide.
