buildtolaunch-mcp 1.0.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.
Files changed (2) hide show
  1. package/index.js +78 -0
  2. package/package.json +15 -0
package/index.js ADDED
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * buildtolaunch-mcp
4
+ * Thin stdio → HTTP proxy for the Build to Launch MCP server.
5
+ * Usage: npx buildtolaunch-mcp --token YOUR_TOKEN
6
+ */
7
+
8
+ const https = require("https");
9
+ const readline = require("readline");
10
+
11
+ // Resolve token from --token arg or BTL_TOKEN env var
12
+ const args = process.argv.slice(2);
13
+ const tokenIdx = args.indexOf("--token");
14
+ const token = tokenIdx >= 0 ? args[tokenIdx + 1] : process.env.BTL_TOKEN;
15
+
16
+ if (!token) {
17
+ process.stderr.write(
18
+ "Build to Launch MCP: missing token.\n" +
19
+ "Get yours at: https://resources.buildtolaunch.ai/mcp\n" +
20
+ "Then use: npx buildtolaunch-mcp --token YOUR_TOKEN\n"
21
+ );
22
+ process.exit(1);
23
+ }
24
+
25
+ const HOST = "mcp.buildtolaunch.ai";
26
+ const PATH = "/mcp";
27
+
28
+ function post(body, callback) {
29
+ const data = Buffer.from(body, "utf8");
30
+ const req = https.request(
31
+ {
32
+ hostname: HOST,
33
+ path: PATH,
34
+ method: "POST",
35
+ headers: {
36
+ "Content-Type": "application/json",
37
+ "Authorization": `Bearer ${token}`,
38
+ "Content-Length": data.length,
39
+ },
40
+ },
41
+ (res) => {
42
+ let chunks = "";
43
+ res.on("data", (c) => (chunks += c));
44
+ res.on("end", () => callback(null, res.statusCode, chunks));
45
+ }
46
+ );
47
+ req.on("error", callback);
48
+ req.write(data);
49
+ req.end();
50
+ }
51
+
52
+ let pending = 0;
53
+ let stdinClosed = false;
54
+
55
+ function maybeExit() {
56
+ if (stdinClosed && pending === 0) process.exit(0);
57
+ }
58
+
59
+ const rl = readline.createInterface({ input: process.stdin, crlfDelay: Infinity });
60
+
61
+ rl.on("line", (line) => {
62
+ if (!line.trim()) return;
63
+ pending++;
64
+ post(line, (err, status, body) => {
65
+ pending--;
66
+ if (err) {
67
+ process.stderr.write(`buildtolaunch-mcp error: ${err.message}\n`);
68
+ } else if (body && body.trim()) {
69
+ process.stdout.write(body.trim() + "\n");
70
+ }
71
+ maybeExit();
72
+ });
73
+ });
74
+
75
+ rl.on("close", () => {
76
+ stdinClosed = true;
77
+ maybeExit();
78
+ });
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "buildtolaunch-mcp",
3
+ "version": "1.0.0",
4
+ "description": "Build to Launch MCP — AI tools for content creators and builders",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "buildtolaunch-mcp": "./index.js"
8
+ },
9
+ "keywords": ["mcp", "claude", "ai", "buildtolaunch"],
10
+ "author": "Build to Launch",
11
+ "license": "MIT",
12
+ "engines": {
13
+ "node": ">=18"
14
+ }
15
+ }