fortrip 1.0.0 → 3.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,21 +1,202 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 FortripEngineering
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,4 @@
1
+ Fortrip
2
+ Copyright 2026 FortripAI, Inc.
3
+
4
+ This product includes software developed at FortripAI, Inc. (https://fortrip.ai).
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # fortrip
2
2
 
3
- Search hotels, check live room rates and book with a payment link, from the
3
+ Search hotels, check live offers and order one with a payment link, from the
4
4
  terminal or an AI agent. Hotels only for now. The npm package and the command
5
- are both `fortrip`.
5
+ are both `fortrip`; they talk to Fortrip API v1, `https://api.fortrip.ai/v1`.
6
6
 
7
7
  ```bash
8
8
  npx -y fortrip login
9
- npx -y fortrip search --query Bangkok --check-in 2026-11-10 --check-out 2026-11-12
9
+ npx -y fortrip hotels search --place-name Bangkok --country TH --check-in 2026-11-10 --check-out 2026-11-12 --room 2
10
10
  ```
11
11
 
12
12
  ## Install and run
@@ -23,12 +23,68 @@ or install it once and run `fortrip <command>`:
23
23
  npm install --global fortrip
24
24
  ```
25
25
 
26
- `fortrip --help` lists the commands, `fortrip <command> --help` one command's
27
- flags, and `fortrip --version` prints the version.
28
-
29
- Upgrading from 0.3: 1.0 signs in with OAuth, so a 0.3 sign-in is not reused;
30
- run `fortrip login` once. A `FORTRIP_TOKEN` from 0.3 is no longer accepted.
31
- `fortrip mcp` replaces the separate `fortrip-mcp` package.
26
+ `fortrip --help` lists the commands, `fortrip hotels --help` the hotel
27
+ commands, `fortrip <command> --help` one command's flags, and
28
+ `fortrip --version` prints the version.
29
+
30
+ ## Upgrading from 2.x
31
+
32
+ 3.0 moves the CLI to Fortrip API v1. A 2.x CLI and the 2.x MCP server stop
33
+ working when 3.0 is released, so upgrade the CLI and, if you added it, the
34
+ hosted MCP server's address (see [MCP server](#mcp-server)).
35
+
36
+ - **Sign in again.** The CLI keeps one sign-in per API URL. 2.x saved yours
37
+ under `https://fortrip.ai`; 3.0's API is `https://api.fortrip.ai`, so run
38
+ `fortrip login` once. The old sign-in is not revoked and is left in the file;
39
+ `fortrip logout` removes only the new one.
40
+ - **`hotels rates` is now `hotels offers`.** It prices up to 15 hotels with
41
+ live, bookable offers. `hotels book` orders an offer by its `offerId`
42
+ (`--offer`), and the guests are given per room (`--guest room:first:last`),
43
+ instead of by room and rate plan. `hotels search`, `hotels get`, `login`,
44
+ `logout`, `whoami`, `guide` and `mcp` keep their names; `orders get` and
45
+ `orders list` are new.
46
+ - **Flags changed with the API.** Run `fortrip <command> --help` for the flags
47
+ of 3.0; these are the 2.x ones that moved.
48
+ - Search: `--query` and `--city-code` are replaced by `--place-name` with its
49
+ `--country` (or `--place`, `--locality`, `--point`, `--country-only`);
50
+ `--text` matches a hotel name, brand or area. `--near` is
51
+ `--point lat,lng` with `--radius-meters` (meters, where `--near` took km). `--star-min` and `--star-max`
52
+ are `--stars-min` and `--stars-max`, `--facility` is `--amenity` and
53
+ `--price-max` is `--price-max-per-room-night`. `--price-min` and the short `-q` are gone.
54
+ - Paging: `--page` and `--page-size` are not renamed but replaced. Results
55
+ are paged with a cursor: pass the `nextCursor` of the previous page to
56
+ `--cursor`, and set the page size with `--limit`. There is no page number.
57
+ - Rooms: `--rooms`, `--adults` and `--child-age` are replaced by
58
+ `--room <adults[:age,…]>`, once per room, in `hotels search` and
59
+ `hotels offers`. `hotels book` no longer takes the stay at all: the offer
60
+ carries it.
61
+ - `hotels get`: `--with-rooms` is `--rooms`.
62
+ - `hotels offers` (was `hotels rates`): `--board` is `--require-breakfast`,
63
+ `--free-cancellation` is `--require-free-cancellation`, and `--max-rooms`
64
+ (rooms per hotel) is `--limit-per-hotel` (offers per hotel, 5 by default).
65
+ `--nationality` and `--include-unbookable` are gone.
66
+ - `hotels book`: `--hotel`, `--room-id` and `--rate-plan` are replaced by
67
+ `--offer`, the `offerId` from `hotels offers`. `--guest "First Last:2"` is
68
+ `--guest 2:First:Last` (room, first name, last name). `--contact-name` is
69
+ `--first-name` and `--last-name`, `--contact-phone` is `--phone` and
70
+ `--contact-email` is `--email`.
71
+ - `--currency` is `--display-currency`, which only changes the currency
72
+ prices are shown in: orders are paid in USD.
73
+ - Ids are strings (`htl_…`, `off_…`, `ord_…`, `plc_…`) that you pass back as
74
+ they were returned.
75
+ - **New output.** A result is compact text by default, written for people and
76
+ for models; `--json` prints the API's JSON instead (see
77
+ [Output and exit codes](#output-and-exit-codes)). 2.x printed JSON.
78
+ - **New environment names.** `FORTRIP_CURRENCY` is now
79
+ `FORTRIP_DISPLAY_CURRENCY`, and the default `FORTRIP_API_URL` is
80
+ `https://api.fortrip.ai`. `FORTRIP_MCP_URL` is new. See
81
+ [Environment variables](#environment-variables).
82
+ - **MCP.** The hosted MCP server is `https://mcp.fortrip.ai/`; its address on
83
+ `fortrip.ai` is retired. `get_hotel_rates` is now `get_hotel_offers`, and
84
+ `get_order` and `list_orders` are new.
85
+
86
+ Commands of 1.x and earlier that were renamed (`hotel`, `rates`) are answered
87
+ with the command to type instead.
32
88
 
33
89
  ## Sign in
34
90
 
@@ -42,12 +98,13 @@ It then prints your account.
42
98
 
43
99
  An AI agent can't sit in `login`, so any other command that needs a sign-in
44
100
  doesn't wait: it exits with code 3 and prints `loginUrl`, `userCode` and
45
- `expiresInSeconds` as JSON on stderr. The agent shows the link to the user;
46
- once the user has approved it in the browser, the agent reruns the same
47
- command, which finishes signing in and carries on. Commands that run in
48
- parallel share one link. When Fortrip stops accepting the saved sign-in (it
49
- was revoked, or it expired and couldn't be renewed), the command does the same
50
- and keeps the old sign-in until the new link is approved.
101
+ `expiresInSeconds` on stderr (as `name: value` lines, or beside the error with
102
+ `--json`). The agent shows the link to the user; once the user has approved it
103
+ in the browser, the agent reruns the same command, which finishes signing in
104
+ and carries on. Commands that run in parallel share one link. When Fortrip
105
+ stops accepting the saved sign-in (it was revoked, or it expired and couldn't
106
+ be renewed), the command does the same and keeps the old sign-in until the new
107
+ link is approved.
51
108
 
52
109
  You stay signed in. Access tokens last 24 hours and the CLI renews them
53
110
  itself, before they run out; refresh tokens don't expire, so the sign-in lasts
@@ -60,13 +117,14 @@ is honoured), mode `0600`, per API URL, so a token is only sent to the server
60
117
  that issued it.
61
118
 
62
119
  If a new or renewed sign-in can't be saved (the file stays busy or turns out to
63
- be damaged), `search`, `hotel`, `rates`, `book` and `whoami` still work for that
120
+ be damaged), the `hotels` and `orders` commands and `whoami` still work for that
64
121
  run, with the new token. The sign-in is kept in a `credentials.recovered-*.json`
65
- file next to the credentials file, and the command's JSON output carries a
66
- `warning` and, when the sign-in could be kept, that file in `recoveryFile`.
67
- Later commands use it, and the next successful save merges it back. `login`
68
- doesn't carry on in that case: it exits 1, with `recoveryFile` in the error, and
69
- the sign-in is kept in that file all the same.
122
+ file next to the credentials file, and the command's output carries a
123
+ `warning` and, when the sign-in could be kept, that file in `recoveryFile`
124
+ (as lines after the result, or as fields of the JSON with `--json`). Later
125
+ commands use it, and the next successful save merges it back. `login` doesn't
126
+ carry on in that case: it exits 1, with `recoveryFile` in the error, and the
127
+ sign-in is kept in that file all the same.
70
128
 
71
129
  If the directory itself can't be written (a read-only home, as in some agent
72
130
  sandboxes), `login` exits 1 before it asks you to approve anything, and any
@@ -77,10 +135,12 @@ other command that needs to save a sign-in exits 1 too. The error says to set
77
135
 
78
136
  | Command | What it does |
79
137
  |---|---|
80
- | `search` | Find hotels with indicative prices |
81
- | `hotel <hotelId>` | Static hotel detail: description, policies, facilities and photos |
82
- | `rates` | Live rooms and rates for up to 15 hotels |
83
- | `book` | Create an order and get a payment link |
138
+ | `hotels search` | Find hotels in a place, near a point or by name, with indicative prices |
139
+ | `hotels get <hotelId>` | Hotel details: description, policies, amenities and rooms |
140
+ | `hotels offers` | Live bookable offers for up to 15 hotels |
141
+ | `hotels book` | Order an offer: an unpaid order with a payment link |
142
+ | `orders get <orderId>` | Show an order and its status |
143
+ | `orders list` | List your orders, newest first |
84
144
  | `login` | Sign in through the browser (device code) |
85
145
  | `logout` | Revoke and forget the saved token |
86
146
  | `whoami` | Show the signed-in account |
@@ -88,18 +148,22 @@ other command that needs to save a sign-in exits 1 too. The error says to set
88
148
  | `mcp` | Run an MCP server over stdio for local clients, bridged to Fortrip's hosted server |
89
149
 
90
150
  ```bash
91
- fortrip rates --hotel <hotelId> --check-in 2026-11-10 --check-out 2026-11-12 --rooms 1 --adults 2
151
+ fortrip hotels search --place-name Tokyo --country JP --check-in 2026-11-10 --check-out 2026-11-12 --room 2
152
+ fortrip hotels offers --hotel <hotelId> --check-in 2026-11-10 --check-out 2026-11-12 --room 2 --room 2
92
153
  ```
93
154
 
94
- `search`, `rates` and `book` also accept `--body '<json>'` or
95
- `--body @file.json` with the raw request body; flags override its fields.
155
+ `hotels search`, `hotels offers` and `hotels book` also accept `--body '<json>'`
156
+ or `--body @file.json` with the raw request body; flags override its fields.
96
157
 
97
- `--adults` and `--child-age` are per room, and every room has the same
98
- occupancy: 2 rooms for 4 adults is `--rooms 2 --adults 2`. `rates` and `book`
99
- both require `--rooms` and `--adults`.
158
+ `--room` gives one room's party, as `adults` or `adults:age,age` with each
159
+ child's age, and is repeated for each room: two rooms of 2 adults, one with a
160
+ child of 6, is `--room 2 --room 2:6`. `hotels search` accepts rooms that
161
+ differ; `hotels offers` takes one party per call, so every room must be the
162
+ same.
100
163
 
101
- `book` creates an unpaid order and prints a payment link for it. Nothing is
102
- charged until the person pays on the page the link opens.
164
+ `hotels book` creates an unpaid order and prints a payment link for it.
165
+ Nothing is charged until the person pays on the page the link opens. Orders
166
+ are paid in USD whatever `--display-currency` shows.
103
167
 
104
168
  ## For AI agents
105
169
 
@@ -122,19 +186,27 @@ npx skills add FortripEngineering/fortrip --skill fortrip-cli
122
186
 
123
187
  ## MCP server
124
188
 
125
- `fortrip mcp` runs an MCP server on stdio for clients that start local
126
- servers. It forwards to Fortrip's hosted MCP server, `https://fortrip.ai/api/mcp`,
127
- with your saved sign-in. Sign in once with `npx -y fortrip login` before you
128
- add the server to a client.
189
+ Fortrip's hosted MCP server is `https://mcp.fortrip.ai/`. It has seven tools:
190
+ `get_planning_guide`, `search_hotels`, `get_hotel`, `get_hotel_offers`,
191
+ `book_hotel`, `get_order` and `list_orders`.
192
+
193
+ Clients that support remote MCP servers with OAuth don't need the CLI: add
194
+ `https://mcp.fortrip.ai/` as a remote server and sign in to Fortrip in the
195
+ browser when the client asks. In Claude Code, that is
196
+ `claude mcp add --transport http fortrip https://mcp.fortrip.ai/`.
197
+
198
+ Clients that start local servers can run the CLI as a bridge. `fortrip mcp`
199
+ runs an MCP server on stdio that forwards to the hosted server with your saved
200
+ sign-in.
129
201
 
130
- If the client starts the server before you have, the server fails to connect:
131
- its first request, `initialize`, is answered with a JSON-RPC error (`-32001`)
132
- whose message says to run `npx -y fortrip login` in a terminal, or to open the
133
- sign-in link it names and approve it. Clients typically close the connection
134
- after a failed `initialize`, so sign in (or approve that link), then restart the
135
- server or reconnect it (`/mcp` in Claude Code). If a sign-in stops working
136
- later, only the request that hit it fails with the same kind of error, and the
137
- server keeps running.
202
+ You can add the bridge to a client before you sign in: signed out, it still
203
+ starts and lists its tools. A tool call is then answered with a tool error
204
+ (`isError: true`, code `unauthenticated`) whose message says to run
205
+ `npx -y fortrip login` in a terminal, or to open the sign-in link it names and
206
+ approve it. Once you have, the next tool call works, with no restart. If a
207
+ sign-in stops working later, only the request that hit it fails, the same way
208
+ for a tool call; any other request that hits a sign-in problem gets the
209
+ JSON-RPC error `-32001` instead. The server keeps running.
138
210
 
139
211
  Claude Desktop (Settings, Developer, Edit Config; on macOS
140
212
  `~/Library/Application Support/Claude/claude_desktop_config.json`, on Windows
@@ -167,39 +239,41 @@ command = "npx"
167
239
  args = ["-y", "fortrip", "mcp"]
168
240
  ```
169
241
 
170
- Clients that support remote MCP servers with OAuth don't need the CLI: add
171
- `https://fortrip.ai/api/mcp` as a remote server and sign in to Fortrip in the
172
- browser when the client asks. In Claude Code, that is
173
- `claude mcp add --transport http fortrip https://fortrip.ai/api/mcp`.
174
-
175
242
  ## Environment variables
176
243
 
177
244
  | Variable | Meaning |
178
245
  |---|---|
179
246
  | `FORTRIP_TOKEN` | An access token, used instead of the saved sign-in. It lasts at most 24 hours, so it suits one sandbox session or one CI run, not standing CI. It isn't tied to a server: it is sent to whatever `FORTRIP_API_URL` points at. If Fortrip doesn't accept it, or it contains a line break or another character that can't be sent in a header, commands exit 3 with `tokenSource: "FORTRIP_TOKEN"` and no `loginUrl`; the error never repeats the token. |
180
- | `FORTRIP_API_URL` | The base URL (default `https://fortrip.ai`). Plain `http` is only accepted for `localhost`. |
181
- | `FORTRIP_CURRENCY` | The default `--currency` for `search` and `rates` (`CNY` or `USD`; the API uses `CNY` when nothing sets one). It only changes how prices are shown: `book` charges the currency it returns. |
247
+ | `FORTRIP_API_URL` | The API's base URL (default `https://api.fortrip.ai`). It must be `https`, except for `localhost`, `127.0.0.1` and `[::1]`, which may use plain `http`. It may end in a path prefix (`http://localhost:3000/api/public`), which every request path follows; a query or fragment is dropped. |
248
+ | `FORTRIP_MCP_URL` | The MCP server `fortrip mcp` bridges to (default `https://mcp.fortrip.ai/`), under the same URL rule. Your sign-in is sent to it, so it must be the MCP server of the API you use: on the origin of `FORTRIP_API_URL`, except that the default API goes with the default MCP server, `api.fortrip.ai` and `mcp.fortrip.ai`. When you set `FORTRIP_API_URL` to a local or preview API, set `FORTRIP_MCP_URL` too; `fortrip mcp` exits 2 and says so when you don't. |
249
+ | `FORTRIP_DISPLAY_CURRENCY` | The default `--display-currency` for `hotels search` and `hotels offers` (`USD` or `CNY`). It only changes the currency prices are shown in: orders are paid in USD. |
182
250
 
183
251
  ## Output and exit codes
184
252
 
185
- Data commands (`search`, `hotel`, `rates`, `book`, `login`, `logout`,
186
- `whoami`) print JSON on stdout. `guide` prints Markdown, and `fortrip mcp`
187
- speaks MCP over stdio. Errors are JSON on stderr, with an `error` message, the
188
- `exitCode` and any details.
253
+ A command prints its result as compact text on stdout, the same text the MCP
254
+ tools return. With `--json` (anywhere before `--`) it prints the API's JSON
255
+ instead, on one line. `guide` prints Markdown and `fortrip mcp` speaks MCP over
256
+ stdio.
257
+
258
+ Errors go to stderr, as text, or with `--json` as one line of JSON:
259
+ `{ "error": { "code", "message", "retryable", "requestId", … } }`, Fortrip's
260
+ error envelope, with the CLI's own facts (`loginUrl`, `tokenSource`, `warning`)
261
+ beside it. An error the CLI makes itself, such as a request it refuses to send
262
+ before it asks Fortrip, has an envelope of the same shape, with a `requestId`
263
+ that starts with `local_`.
189
264
 
190
265
  | Code | Meaning |
191
266
  |---|---|
192
267
  | 0 | Success |
193
- | 1 | Other error (`retryable: true` on stderr: worth one retry) |
194
- | 2 | Invalid arguments (local or HTTP 400) |
195
- | 3 | Not signed in, or the sign-in wasn't accepted (HTTP 401); `loginUrl` on stderr |
196
- | 4 | Rate limited (HTTP 429; `retryAfterSeconds` on stderr) |
268
+ | 1 | Any other error, including the answers of the API that aren't mistakes in the request, such as `destination_ambiguous` or `offer_changed` (`retryable` says whether it is worth one retry) |
269
+ | 2 | Invalid arguments (local, or the API's `invalid_request`) |
270
+ | 3 | Not signed in, or the sign-in wasn't accepted; `loginUrl` on stderr |
271
+ | 4 | Rate limited (`retryAfterSeconds` on stderr) |
197
272
 
198
273
  ## Support
199
274
 
200
275
  For changes, cancellations, refunds or other help with a booking, email
201
- [info@fortrip.ai](mailto:info@fortrip.ai) with the booking's order link
202
- (`orderUrl`).
276
+ [info@fortrip.ai](mailto:info@fortrip.ai) with the order's reference or link.
203
277
 
204
278
  ## Releasing
205
279
 
@@ -211,6 +285,13 @@ repository's README.
211
285
  ## License
212
286
 
213
287
  The code and documentation in this repository are licensed under the
214
- [MIT License](https://github.com/FortripEngineering/fortrip/blob/main/LICENSE).
215
- This license does not grant access to the hosted Fortrip service, hotel
216
- inventory, or third-party data.
288
+ [Apache License 2.0](https://github.com/FortripEngineering/fortrip/blob/main/LICENSE).
289
+ Copyright 2026 FortripAI, Inc. Versions before 2.0.0 were published under the
290
+ MIT License. This license does not grant access to the hosted Fortrip service,
291
+ hotel inventory, or third-party data.
292
+
293
+ "Fortrip" and the Fortrip logo are trademarks of FortripAI, Inc. The license
294
+ does not grant permission to use the trade names, trademarks, service marks or
295
+ product names of FortripAI, Inc., except as required for reasonable and
296
+ customary use in describing the origin of the software and reproducing the
297
+ content of the NOTICE file (section 6).
@@ -0,0 +1,30 @@
1
+ Third-party notices for the fortrip package
2
+
3
+ The files in dist/ include code from the packages below, bundled into them.
4
+ Each is listed with its version and license, followed by the license text
5
+ from the package's LICENSE file.
6
+
7
+ ================================================================================
8
+ zod 4.4.3 (MIT)
9
+ --------------------------------------------------------------------------------
10
+ MIT License
11
+
12
+ Copyright (c) 2025 Colin McDonnell
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.