@homespunapps/mcp 1.6.59 → 1.6.61
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/dist/bin.d.ts +2 -0
- package/dist/bin.js +18 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +52 -31
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/server.json +2 -2
package/dist/bin.d.ts
ADDED
package/dist/bin.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Process entry point for the `homespun-mcp` binary (see package.json's
|
|
3
|
+
// `bin` field). Kept separate from index.ts, which is a pure module with no
|
|
4
|
+
// top-level side effects, so index.ts can be imported by a test (or by
|
|
5
|
+
// anything else) without starting a stdio server.
|
|
6
|
+
//
|
|
7
|
+
// npm installs a bin as a symlink (node_modules/.bin/homespun-mcp -> this
|
|
8
|
+
// file), so an entry point cannot tell "am I the main module" apart from
|
|
9
|
+
// "was I imported" by comparing process.argv[1] to import.meta.url: under a
|
|
10
|
+
// symlink those two disagree (one is the link path, the other is the
|
|
11
|
+
// resolved real path) and a guard built on that comparison silently never
|
|
12
|
+
// runs main(). Unconditionally calling main() here, in a file whose only
|
|
13
|
+
// job is to be the entry point, sidesteps the question entirely.
|
|
14
|
+
import { main } from "./index.js";
|
|
15
|
+
main().catch((e) => {
|
|
16
|
+
process.stderr.write(`homespun-mcp: fatal: ${e instanceof Error ? (e.stack ?? e.message) : String(e)}\n`);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export declare function wrapToolNames(names: string[], width: number): string;
|
|
2
|
+
export declare const HELP: string;
|
|
3
|
+
export declare function main(): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
// `homespun-mcp` — a thin stdio Model Context Protocol server wrapping Homespun.
|
|
3
2
|
//
|
|
4
3
|
// Speaks MCP over stdio so any MCP client (Claude Desktop, Cursor, …) can use
|
|
@@ -14,34 +13,38 @@
|
|
|
14
13
|
// HOMESPUN_TOKEN alias for HOMESPUN_API_KEY (for MCP host "*_TOKEN" config)
|
|
15
14
|
// HOMESPUN_AGENT_NAME label for the auto-registered agent
|
|
16
15
|
// HOMESPUN_REGISTER_SECRET registration secret (REGISTRATION_MODE=secret relays)
|
|
16
|
+
//
|
|
17
|
+
// This module is a pure library: no top-level side effects, so it can be
|
|
18
|
+
// imported by a test (or by bin.ts) without starting a stdio server. The
|
|
19
|
+
// process entry point lives in bin.ts, which is what `package.json`'s `bin`
|
|
20
|
+
// field points at.
|
|
17
21
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
18
22
|
import { buildServer } from "./server.js";
|
|
23
|
+
import { TOOLS } from "./tools.js";
|
|
19
24
|
import { VERSION } from "./version.js";
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
// Derived from TOOLS so the banner can never drift from what the server
|
|
26
|
+
// actually registers (it did, silently, for months, see #1659). Wrapped by
|
|
27
|
+
// hand rather than left as one long line, since a flat 25-name line is
|
|
28
|
+
// harder to scan than a handful of short ones.
|
|
29
|
+
export function wrapToolNames(names, width) {
|
|
30
|
+
const words = names.map((name, i) => i < names.length - 1 ? `${name},` : `${name}.`);
|
|
31
|
+
const lines = [];
|
|
32
|
+
let current = "Tools exposed:";
|
|
33
|
+
for (const word of words) {
|
|
34
|
+
const next = `${current} ${word}`;
|
|
35
|
+
if (next.length > width && current !== "Tools exposed:") {
|
|
36
|
+
lines.push(current);
|
|
37
|
+
current = word;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
current = next;
|
|
41
|
+
}
|
|
32
42
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
registerSecret: process.env.HOMESPUN_REGISTER_SECRET,
|
|
36
|
-
});
|
|
37
|
-
const transport = new StdioServerTransport();
|
|
38
|
-
await server.connect(transport);
|
|
39
|
-
// Stdio MCP servers run until the host closes stdin; keep the process alive.
|
|
40
|
-
// The transport resolves connect() immediately, so without this the event
|
|
41
|
-
// loop would otherwise stay open only because of the stdin reader — which is
|
|
42
|
-
// the intended behaviour. Nothing more to do here.
|
|
43
|
+
lines.push(current);
|
|
44
|
+
return lines.join("\n");
|
|
43
45
|
}
|
|
44
|
-
const
|
|
46
|
+
const TOOLS_EXPOSED = wrapToolNames(TOOLS.map((t) => t.name), 74);
|
|
47
|
+
export const HELP = `homespun-mcp ${VERSION}: Homespun Model Context Protocol server (stdio)
|
|
45
48
|
|
|
46
49
|
Run by an MCP client over stdio; not meant to be invoked interactively. Add it
|
|
47
50
|
to your MCP client config, e.g. Claude Desktop / Cursor:
|
|
@@ -65,13 +68,31 @@ Environment:
|
|
|
65
68
|
HOMESPUN_AGENT_NAME Display name for the auto-registered agent.
|
|
66
69
|
HOMESPUN_REGISTER_SECRET Registration secret (REGISTRATION_MODE=secret relays).
|
|
67
70
|
|
|
68
|
-
|
|
69
|
-
delete_row, get_feed_events, apps, members, attachments, taste, key,
|
|
70
|
-
feedback, agent, get_skill.
|
|
71
|
+
${TOOLS_EXPOSED}
|
|
71
72
|
|
|
72
73
|
See https://docs.homespun.dev for docs.
|
|
73
74
|
`;
|
|
74
|
-
main()
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
export async function main() {
|
|
76
|
+
// --version / --help are answered locally without starting the transport, so
|
|
77
|
+
// a human poking at the binary gets a useful response instead of a hung
|
|
78
|
+
// stdio session waiting for JSON-RPC.
|
|
79
|
+
const argv = process.argv.slice(2);
|
|
80
|
+
if (argv.includes("--version") || argv.includes("-v")) {
|
|
81
|
+
process.stdout.write(`homespun-mcp ${VERSION}\n`);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
85
|
+
process.stdout.write(HELP);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const server = buildServer({
|
|
89
|
+
agentName: process.env.HOMESPUN_AGENT_NAME,
|
|
90
|
+
registerSecret: process.env.HOMESPUN_REGISTER_SECRET,
|
|
91
|
+
});
|
|
92
|
+
const transport = new StdioServerTransport();
|
|
93
|
+
await server.connect(transport);
|
|
94
|
+
// Stdio MCP servers run until the host closes stdin; keep the process alive.
|
|
95
|
+
// The transport resolves connect() immediately, so without this the event
|
|
96
|
+
// loop would otherwise stay open only because of the stdin reader, which is
|
|
97
|
+
// the intended behaviour. Nothing more to do here.
|
|
98
|
+
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.6.
|
|
1
|
+
export declare const VERSION = "1.6.61";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homespunapps/mcp",
|
|
3
3
|
"mcpName": "dev.homespun/homespun",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.61",
|
|
5
5
|
"description": "Model Context Protocol (stdio) server for Homespun: lets any MCP client (Claude Desktop, Cursor, …) deploy a multi-user web app with hosting, auth, a shared database and permissions included.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"bin": {
|
|
27
|
-
"homespun-mcp": "dist/
|
|
27
|
+
"homespun-mcp": "dist/bin.js"
|
|
28
28
|
},
|
|
29
29
|
"exports": {
|
|
30
30
|
"./tools": "./dist/tools.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
49
|
-
"@homespunapps/core": "^1.6.
|
|
49
|
+
"@homespunapps/core": "^1.6.61",
|
|
50
50
|
"zod": "^4.4.3"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
package/server.json
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"name": "dev.homespun/homespun",
|
|
4
4
|
"title": "Homespun",
|
|
5
5
|
"description": "Deploy a multi-user web app from your agent: hosting, auth, database, and permissions.",
|
|
6
|
-
"version": "1.6.
|
|
6
|
+
"version": "1.6.61",
|
|
7
7
|
"websiteUrl": "https://homespun.dev",
|
|
8
8
|
"packages": [
|
|
9
9
|
{
|
|
10
10
|
"registryType": "npm",
|
|
11
11
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
12
12
|
"identifier": "@homespunapps/mcp",
|
|
13
|
-
"version": "1.6.
|
|
13
|
+
"version": "1.6.61",
|
|
14
14
|
"transport": {
|
|
15
15
|
"type": "stdio"
|
|
16
16
|
},
|