# AI Agents via Ferry MCP

Source: https://ferry.vn/en/building-ai-travel-agents-ferry-vn-mcp-server/
Locale: en
Category: Ferry API & Tech
Published: 2026-11-25
Updated: 2026-11-25
Author: Le Quoc Khoi (CEO, Ferry VN JSC) — https://ferry.vn/en/author/le-quoc-khoi/
Summary: Ferry MCP server (@ferryvn/mcp) connects AI agents to 15+ Vietnam ferry operators with read-only defaults, human-confirmed writes, and zero payment access.

---

> **Key Takeaways:** The **Ferry MCP Server** (`@ferryvn/mcp`) by **Ferry VN JSC** exposes live schedules, seat maps, fares, and booking lookups across 15+ Vietnamese ferry operators to AI assistants over the Model Context Protocol while keeping ticket issuance and wallet debits permanently inaccessible to autonomous agents.
>
> - **Read-Only by Default:** 14 read tools, 2 workflow prompts (`plan_ferry_trip`, `check_booking`), and the `ferry://locations` pier resource work out of the box, while 3 write tools appear only when `FERRY_MCP_ENABLE_WRITES=true`.
> - **Zero Financial Execution Exposure:** Ticket issuance (`confirmToIssue`), payments, wallet top-ups, debt ledgers, pricing edits, and API key administration are never exposed to the agent, enforced by automated repository tests.
> - **Six-Layer Runtime Guardrails:** Every opt-in write requires explicit human confirmation, respects a per-process write budget (`FERRY_MCP_MAX_WRITES`, default 20), rejects unknown arguments strictly, and writes PII-free JSONL audit trails.
> - **Flexible Stdio & Hardened HTTP Deployment:** Install via `.mcpb` in Claude Desktop, `npx -y @ferryvn/mcp` in Claude Code, or containerized `--http` mode with DNS-rebinding guards and bearer token auth.

Deploying a **ferry MCP server** lets travel agencies, Destination Management Companies (DMCs), and Online Travel Agencies (OTAs) turn complex multi-operator island itineraries into natural-language workflows without handing Large Language Models (LLMs) direct control over partner wallets. Bookers and AI planners query live timetables, cabin layouts, and harbor fees across 15+ carriers through one standardized protocol.

Exposing raw booking REST endpoints directly to an AI agent creates severe financial and privacy risk: a hallucinated loop can create duplicate orders, trigger real wallet deductions, or leak passenger passport numbers. This technical guide breaks down `@ferryvn/mcp`'s tool surface, six-layer safety model, stdio versus remote HTTP hardening, and zero-cost `uatexpress` UAT testing workflow.

## Why Travel AI Agents Need Hard Financial Boundaries

Ferry VN partner API keys hold organization-level authority, including non-idempotent booking creation and irreversible VND NET wallet debits at ticket confirmation. Wrapping raw REST endpoints directly into LLM function calls collapses itinerary discovery and financial settlement into one unconstrained blast radius.

`@ferryvn/mcp` enforces that separation architecturally using the open [Model Context Protocol](https://modelcontextprotocol.io). AI assistants handle pier matching, timetable comparison, seat-map checks, and VIMAWA manifest quoting while hitting a hard boundary before any money moves, matching the core platform architecture in our [Unified Vietnam Ferry API guide](/en/vietnam-ferry-api-unified-multi-operator-integration/).

| Capability Tier | Exposed in `@ferryvn/mcp` | Activation Requirement | Financial & Operational Risk Profile |
|---|---|---|---|
| **Catalog, Schedule, Seat & Quote Reads** | `search_locations`, `list_routes`, `search_voyages`, `get_voyage_calendar`, `get_route_prices`, `get_seat_map`, `quote_booking`, `get_disruptions`, `list_vouchers` | Enabled by default | Zero financial mutation and zero customer PII exposure |
| **Customer & Booking Reads** | `find_customers`, `get_booking`, `list_bookings`, `list_cancel_requests`, `get_account` | Enabled by default (hideable via `FERRY_MCP_DISABLED_TOOLS`) | Read-only access, contains PII unless explicitly hidden |
| **Guarded Draft & Cancel Writes** | `create_customer`, `create_booking`, `request_cancellation` | Opt-in (`FERRY_MCP_ENABLE_WRITES=true` + human confirmation) | `create_booking` stops unpaid in status `2`, cancel holds fee |
| **Ticketing, Money & Admin Surfaces** | **Never exposed** (`confirmToIssue`, payments, top-ups, debt ledgers, price rules, webhooks, API keys) | Permanently blocked and CI-tested | Must execute via Dashboard, `@ferryvn/sdk`, or `@ferryvn/cli` |

## Inside `@ferryvn/mcp`: Tools, Prompts, and Resources

`@ferryvn/mcp` lives inside the [`ferry-vn/ferry-sdk` monorepo on GitHub](https://github.com/ferry-vn/ferry-sdk) alongside `@ferryvn/sdk` and `@ferryvn/cli`, sharing one version across all three npm packages on the [Ferry VN API & SDK platform](/en/platform/api-sdk/). Provisioning scoped keys through [Ferry VN API partner onboarding](/en/api-partners/) lets the server inherit your organization's exact pricing, vouchers, and disruption scope.

### Read-Only Discovery, Quoting, and Operations Tools

Every read tool queries live carrier snapshots and seat charts without modifying server state or debiting VND balances:

| Tool / Primitive | Category | Primary Agent Use Case |
|---|---|---|
| `search_locations`, `list_routes` | Catalog | Accent-insensitive mainland/island pier matching and operator route lists |
| `search_voyages`, `get_voyage_calendar` | Schedules | Daily sailing search and multi-day departure calendar inspection |
| `get_route_prices`, `get_seat_map` | Inventory | VAT-inclusive fares by cabin class and real-time vacant seat charts |
| `quote_booking` | Pre-validation | Local validation of ages, IDs, seats, and harbor fees with exact VND quote |
| `find_customers`, `get_booking`, `list_bookings` | Support | Lookup passenger profiles, booking statuses, and ticket leg details |
| `list_cancel_requests`, `get_disruptions` | Exceptions | Monitor cancellation approval chains and weather/technical delays |
| `get_account`, `list_vouchers` | Finance Read | Inspect available VND balance, credit limit, and eligible voucher codes |
| `plan_ferry_trip`, `check_booking`, `ferry://locations` | Prompts & Resource | Built-in guided prompt templates and direct pier catalog resource |

Notice how `quote_booking` mirrors `ferry.bookingDrafts.prepare()` in `@ferryvn/sdk`, validating age tiers, sellable seats, and harbor fees without creating orphaned unpaid records.

### Opt-In Write Tools and Strict Argument Validation

Write tools stay hidden unless `FERRY_MCP_ENABLE_WRITES=true` (exact string match), exposing three bounded actions: `create_customer` (creates a profile under your org), `create_booking` (submits an unpaid status `2` booking with a `payment_expired_at` deadline at zero VND charge), and `request_cancellation` (initiates post-issuance cancellation approval).

Unlike permissive JSON wrappers that drop unrecognized keys, `@ferryvn/mcp` rejects misspelled or unknown properties strictly. That prevents silent bugs such as dropping a misspelled `nationality` field and defaulting a foreign passenger to Vietnam's domestic fare tier.

## Six-Layer Safety Architecture for Production Agents

Production agent deployments must block prompt-injected writes, runaway booking loops, and passport PII leakage into third-party model logs. `@ferryvn/mcp` enforces six runtime controls across every session.

![@ferryvn/mcp six-layer production safety architecture isolating AI agents at Stage 1 Status 2 Unpaid before human checkout](https://cdn.ferry.vn/media/31/diagram-en-mcp-read-only-agent-architecture.webp)

1. **CI-enforced financial exclusion:** Automated tests in `ferry-vn/ferry-sdk` verify that `confirmToIssue`, payment capture, wallet withdrawals, debt ledgers, pricing rules, and API/webhook admin tools never register.
2. **Mandatory human confirmation per write:** Native MCP clients display an itemized confirmation summary (voyages, seats, passenger names, VND total) that the model cannot self-approve, while non-native clients require `user_confirmed: true` after human approval.
3. **Per-process write budget:** `FERRY_MCP_MAX_WRITES` (default `20`) caps writes per running process to stop runaway agent loops.
4. **PII-free JSONL audit logging:** Writes emit structured JSON lines to `stderr` (and optional `FERRY_MCP_AUDIT_FILE`) recording tool names, booking IDs, and passenger counts while omitting names, phones, and passports.
5. **Read-tool suppression for public assistants:** Set `FERRY_MCP_DISABLED_TOOLS=list_bookings,get_booking,find_customers,list_cancel_requests` so consumer-facing assistants query schedules and quotes without accessing passenger Personally Identifiable Information (PII).
6. **Zero-cost UAT testing (`FERRY_ENV=uat`):** Point test harnesses to `https://api.ferryvn.net`, where `OPERATOR_ADAPTER_ALLOWLIST=uatexpress` blocks real carriers and activates `uatexpress` (`UAT Rach Gia`, `UAT Ha Tien`, `UAT Tran De`) at zero cost.

For REST/SDK execution downstream of the agent handoff, review the [Ferry VN SDK quickstart](/en/ferry-vn-sdk-rest-api-developer-quickstart/) and [API reliability and reconciliation patterns](/en/ferry-api-reliability-reconciliation-patterns/).

## Deployment Patterns: Local Stdio vs Remote HTTP Service

`@ferryvn/mcp` runs over local `stdio` for single-user desktop workflows or hardened `--http` mode for shared internal travel services.

### Local Setup for Claude Desktop and Claude Code

Non-developer staff download the signed `ferry-mcp.mcpb` bundle from GitHub releases for Claude Desktop and enter a scoped API key. Technical operators using Claude Code (Node.js 22.12+) run over `stdio`:

```bash
# Read-only Production setup (recommended starting point)
claude mcp add ferryvn \
  -e FERRY_API_KEY="$FERRY_API_KEY" \
  -- npx -y @ferryvn/mcp

# Zero-cost UAT testing setup with opt-in writes and audit log
claude mcp add ferryvn-uat \
  -e FERRY_API_KEY="$FERRY_UAT_API_KEY" \
  -e FERRY_ENV="uat" \
  -e FERRY_MCP_ENABLE_WRITES="true" \
  -e FERRY_MCP_MAX_WRITES="10" \
  -e FERRY_MCP_AUDIT_FILE="/var/log/ferry-mcp-uat.jsonl" \
  -- npx -y @ferryvn/mcp
```

In UAT prompts, always specify `UAT ...` piers (`UAT Rach Gia–UAT Phu Quoc`, `UAT Ha Tien–UAT Phu Quoc`, `UAT Tran De–UAT Con Dao`), as UAT blocks bookings on real operators.

### Hardening Remote HTTP Mode for Multi-User Travel Apps

Launching `ferry-mcp --http --port 3333` serves `POST /mcp` and `GET /healthz` behind four strict perimeter controls:

```env
# Required runtime config for non-loopback HTTP deployments
FERRY_API_KEY=your_scoped_partner_ota_or_read_only_key
FERRY_ENV=production
FERRY_MCP_HTTP_HOST=0.0.0.0
FERRY_MCP_HTTP_TOKEN=replace-with-32-char-random-bearer-secret
FERRY_MCP_ALLOWED_HOSTS=mcp.internal.your-ota.com
FERRY_MCP_ALLOWED_ORIGINS=https://agent.internal.your-ota.com
FERRY_MCP_DISABLED_TOOLS=find_customers,list_bookings
# Writes stay disabled in HTTP mode unless BOTH flags below are true
FERRY_MCP_ENABLE_WRITES=false
FERRY_MCP_HTTP_ALLOW_WRITES=false
```

First, DNS-rebinding guards enforce `FERRY_MCP_ALLOWED_HOSTS` and `FERRY_MCP_ALLOWED_ORIGINS`. Second, non-loopback bindings require `FERRY_MCP_HTTP_TOKEN` (16+ chars) on every `Authorization: Bearer` request. Third, remote writes stay disabled unless both `FERRY_MCP_ENABLE_WRITES=true` and `FERRY_MCP_HTTP_ALLOW_WRITES=true` are set. Fourth, endpoints accept `POST` only (1 MB body limit) and must sit behind TLS.

## Human-in-the-Loop Booking Workflow: Agent to Dashboard Issuance

The safest production pattern pairs `@ferryvn/mcp` as an AI front-desk copilot with deterministic backend or Dashboard issuance, keeping `confirmToIssue` strictly outside the model's reach.

![UAT uatexpress test harness and scoped API key boundary supporting human-in-the-loop MCP agent workflows](https://cdn.ferry.vn/media/31/diagram-en-sdk-quickstart-uat-vs-production.webp)

1. **Conversational discovery:** A consultant asks the agent to compare sailings, vessel classes, and adjacent seats via `search_voyages`, `get_route_prices`, and `get_seat_map`.
2. **VIMAWA manifest quoting:** The agent validates mandatory traveler fields (full name, birth date, passport/ID, nationality) via `quote_booking`, aligning with [Vietnam manifest compliance specs](/en/maritime-passenger-manifest-e-ticket-qr-vietnam/).
3. **Human-confirmed status `2` draft:** With writes enabled, the human confirms the itemized VND summary and `create_booking` writes an unpaid status `2` reservation.
4. **Deterministic checkout & issuance:** A consultant completes issuance in the Agency Dashboard — or your backend calls `ferry.bookings.confirmToIssue(bookingId)` via `@ferryvn/sdk` — debiting your VND wallet and downloading carrier PDFs.

Review MCP environment variables in our [MCP server setup and tool documentation](https://docs.ferry.vn/en/developers/), inspect underlying REST endpoints in the [live OpenAPI specification](https://api.ferry.vn/docs), or compare plans on [Ferry VN Pricing](/en/pricing/) (`hi@ferry.vn` · `+84 924 299 898`).

## Frequently Asked Questions

| Question | Answer |
| --- | --- |
| Can an AI agent issue ferry tickets or debit our agency wallet through `@ferryvn/mcp`? | No. Ticket issuance ( confirmToIssue ), payments, wallet top-ups, balance adjustments, and API key administration are permanently excluded from @ferryvn/mcp and enforced by automated repository tests. Even with writes enabled, create_booking stops at unpaid status 2 so humans or backend code authorize final issuance. |
| How do we prevent an AI agent from reading customer phone numbers or passport IDs? | Pass a comma-separated list to FERRY_MCP_DISABLED_TOOLS (such as find_customers,list_bookings,get_booking,list_cancel_requests ) when starting the server. This hides every PII-bearing read tool while keeping public schedule search, route pricing, seat maps, and anonymous fare quoting active for trip planning. |
| What happens if we enable `FERRY_MCP_ENABLE_WRITES=true` in HTTP mode? | Write tools remain disabled in HTTP mode because remote HTTP requests lack desktop confirmation dialogs. To activate writes over HTTP, an administrator must explicitly set both FERRY_MCP_ENABLE_WRITES=true and FERRY_MCP_HTTP_ALLOW_WRITES=true , alongside FERRY_MCP_HTTP_TOKEN (16+ characters) and TLS termination. |
| How can developers test AI travel workflows without creating live carrier bookings? | Set FERRY_ENV=uat with a UAT API key ( https://api.ferryvn.net ). Ferry VN isolates all real operators via OPERATOR_ADAPTER_ALLOWLIST=uatexpress and exposes simulated uatexpress routes ( UAT Rach Gia , UAT Ha Tien , UAT Tran De ), letting agents quote, create drafts, and test cancellations at zero real cost. |
| Why does `@ferryvn/mcp` reject unknown arguments instead of ignoring them? | Maritime ticket pricing and port clearance depend strictly on accurate passenger fields such as nationality and dateOfBirth . Rejecting unknown or misspelled arguments prevents silent field stripping that could default an international passenger to Vietnam and produce an incorrect fare tier or invalid manifest. |
