trvl-mcp 1.5.0
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/README.md +37 -0
- package/bin/install.js +98 -0
- package/bin/trvl-mcp.js +30 -0
- package/package.json +23 -0
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# trvl-mcp
|
|
2
|
+
|
|
3
|
+
AI travel agent MCP server. 60 tools for flights, hotels, ground transport, price alerts. No API keys required.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npx trvl-mcp
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Claude Desktop
|
|
12
|
+
|
|
13
|
+
Add to `claude_desktop_config.json`:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"mcpServers": {
|
|
18
|
+
"trvl": {
|
|
19
|
+
"command": "npx",
|
|
20
|
+
"args": ["trvl-mcp"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## What's included
|
|
27
|
+
|
|
28
|
+
- Flight search (Google Flights, Kiwi)
|
|
29
|
+
- Hotel search (Google Hotels, Booking.com, Airbnb, Hostelworld, Trivago)
|
|
30
|
+
- Ground transport (buses, trains, ferries — 20 providers)
|
|
31
|
+
- Destination intelligence (weather, safety, holidays, events)
|
|
32
|
+
- Trip planning and price alerts
|
|
33
|
+
- Travel hacks detection (37 detectors)
|
|
34
|
+
|
|
35
|
+
## License
|
|
36
|
+
|
|
37
|
+
PolyForm Noncommercial 1.0.0
|
package/bin/install.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const https = require("https");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
const { execSync } = require("child_process");
|
|
8
|
+
|
|
9
|
+
const VERSION = require("../package.json").version;
|
|
10
|
+
|
|
11
|
+
function getPlatform() {
|
|
12
|
+
const platform = process.platform;
|
|
13
|
+
if (platform === "darwin") return "darwin";
|
|
14
|
+
if (platform === "linux") return "linux";
|
|
15
|
+
if (platform === "win32") return "windows";
|
|
16
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function getArch() {
|
|
20
|
+
const arch = process.arch;
|
|
21
|
+
if (arch === "x64") return "amd64";
|
|
22
|
+
if (arch === "arm64") return "arm64";
|
|
23
|
+
throw new Error(`Unsupported architecture: ${arch}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function download(url) {
|
|
27
|
+
return new Promise((resolve, reject) => {
|
|
28
|
+
https.get(url, (res) => {
|
|
29
|
+
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
|
|
30
|
+
return download(res.headers.location).then(resolve).catch(reject);
|
|
31
|
+
}
|
|
32
|
+
if (res.statusCode !== 200) {
|
|
33
|
+
return reject(new Error(`Download failed: HTTP ${res.statusCode} from ${url}`));
|
|
34
|
+
}
|
|
35
|
+
const chunks = [];
|
|
36
|
+
res.on("data", (chunk) => chunks.push(chunk));
|
|
37
|
+
res.on("end", () => resolve(Buffer.concat(chunks)));
|
|
38
|
+
res.on("error", reject);
|
|
39
|
+
}).on("error", reject);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function install() {
|
|
44
|
+
const os = getPlatform();
|
|
45
|
+
const arch = getArch();
|
|
46
|
+
const filename = `trvl_${VERSION}_${os}_${arch}.tar.gz`;
|
|
47
|
+
const url = `https://github.com/MikkoParkkola/trvl/releases/download/v${VERSION}/${filename}`;
|
|
48
|
+
const binDir = path.join(__dirname);
|
|
49
|
+
const binaryName = os === "windows" ? "trvl.exe" : "trvl";
|
|
50
|
+
const binaryPath = path.join(binDir, binaryName);
|
|
51
|
+
|
|
52
|
+
// Skip if binary already exists
|
|
53
|
+
if (fs.existsSync(binaryPath)) {
|
|
54
|
+
console.log(`trvl binary already exists at ${binaryPath}`);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
console.log(`Downloading trvl v${VERSION} for ${os}/${arch}...`);
|
|
59
|
+
console.log(` ${url}`);
|
|
60
|
+
|
|
61
|
+
let tarball;
|
|
62
|
+
try {
|
|
63
|
+
tarball = await download(url);
|
|
64
|
+
} catch (err) {
|
|
65
|
+
console.error(`\nFailed to download trvl binary:\n ${err.message}\n`);
|
|
66
|
+
console.error("You can manually download from:");
|
|
67
|
+
console.error(` https://github.com/MikkoParkkola/trvl/releases/tag/v${VERSION}\n`);
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Write tarball to temp file and extract
|
|
72
|
+
const tmpFile = path.join(binDir, filename);
|
|
73
|
+
fs.writeFileSync(tmpFile, tarball);
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
if (os === "windows") {
|
|
77
|
+
// On Windows, use tar which is available since Windows 10
|
|
78
|
+
execSync(`tar -xzf "${tmpFile}" -C "${binDir}" trvl.exe`, { stdio: "pipe" });
|
|
79
|
+
} else {
|
|
80
|
+
execSync(`tar -xzf "${tmpFile}" -C "${binDir}" trvl`, { stdio: "pipe" });
|
|
81
|
+
}
|
|
82
|
+
} catch (err) {
|
|
83
|
+
console.error(`Failed to extract binary: ${err.message}`);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
} finally {
|
|
86
|
+
// Clean up tarball
|
|
87
|
+
fs.unlinkSync(tmpFile);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Make executable on Unix
|
|
91
|
+
if (os !== "windows") {
|
|
92
|
+
fs.chmodSync(binaryPath, 0o755);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
console.log(`trvl v${VERSION} installed successfully.`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
install();
|
package/bin/trvl-mcp.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { spawn } = require("child_process");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
|
|
8
|
+
const binDir = __dirname;
|
|
9
|
+
const isWindows = process.platform === "win32";
|
|
10
|
+
const binaryName = isWindows ? "trvl.exe" : "trvl";
|
|
11
|
+
const binaryPath = path.join(binDir, binaryName);
|
|
12
|
+
|
|
13
|
+
if (!fs.existsSync(binaryPath)) {
|
|
14
|
+
console.error("trvl binary not found. Run the postinstall script:");
|
|
15
|
+
console.error(" node " + path.join(binDir, "install.js"));
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const child = spawn(binaryPath, ["mcp"], {
|
|
20
|
+
stdio: "inherit",
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
child.on("error", (err) => {
|
|
24
|
+
console.error(`Failed to start trvl: ${err.message}`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
child.on("exit", (code) => {
|
|
29
|
+
process.exit(code ?? 0);
|
|
30
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "trvl-mcp",
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"description": "AI travel agent — 1 smart MCP tool plus 62 compatibility aliases for flights, hotels, ground transport, price alerts. No API keys required.",
|
|
5
|
+
"license": "PolyForm-Noncommercial-1.0.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/MikkoParkkola/trvl"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/MikkoParkkola/trvl",
|
|
11
|
+
"keywords": ["mcp", "travel", "flights", "hotels", "ai", "claude", "model-context-protocol"],
|
|
12
|
+
"bin": {
|
|
13
|
+
"trvl-mcp": "bin/trvl-mcp.js"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"postinstall": "node bin/install.js"
|
|
17
|
+
},
|
|
18
|
+
"os": ["darwin", "linux", "win32"],
|
|
19
|
+
"cpu": ["x64", "arm64"],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=16"
|
|
22
|
+
}
|
|
23
|
+
}
|