htmlhost-mcp 1.4.0 → 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 +2 -2
- package/package.json +1 -1
- package/src/api.mjs +4 -3
- package/src/server.mjs +13 -2
package/README.md
CHANGED
|
@@ -88,7 +88,7 @@ htmlhost-mcp
|
|
|
88
88
|
|---|---|
|
|
89
89
|
| `deploy` | Deploy a local file or directory to htmlhost.co |
|
|
90
90
|
| `deploy_html` | Deploy raw HTML content directly (no local files needed) |
|
|
91
|
-
| `list_sites` | List
|
|
91
|
+
| `list_sites` | List your sites and the ones shared with you |
|
|
92
92
|
| `get_site` | Get details about a specific site (pages, assets, version) |
|
|
93
93
|
| `pull_site` | Download a site's files to a local directory |
|
|
94
94
|
| `delete_site` | Permanently delete a site |
|
|
@@ -126,7 +126,7 @@ ttl (optional) Time-to-live: 1d, 7d, 30d, or never
|
|
|
126
126
|
|
|
127
127
|
### `list_sites`
|
|
128
128
|
|
|
129
|
-
Returns all sites, their URLs, sizes, TTLs, and plan usage.
|
|
129
|
+
Returns all your sites, their URLs, sizes, TTLs, and plan usage, plus `shared`: the sites shared with you as a collaborator, with their owner. You can pull, deploy to and restore those with your own key; only the owner can delete them.
|
|
130
130
|
|
|
131
131
|
### `get_site`
|
|
132
132
|
|
package/package.json
CHANGED
package/src/api.mjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* so signing in once (the `login` tool or `htmlhost login`) covers both.
|
|
6
6
|
*/
|
|
7
7
|
import { readFileSync, writeFileSync, statSync, readdirSync, mkdirSync, existsSync } from "node:fs";
|
|
8
|
-
import { join, basename, dirname, resolve } from "node:path";
|
|
8
|
+
import { join, basename, dirname, resolve, sep } from "node:path";
|
|
9
9
|
import { homedir } from "node:os";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@ import { createHash } from "node:crypto";
|
|
|
14
14
|
// ---------------------------------------------------------------------------
|
|
15
15
|
const CONFIG_PATH = join(homedir(), ".htmlhostrc");
|
|
16
16
|
/** Sent with every request, so the API can tell which version is calling. Kept in step with server.mjs. */
|
|
17
|
-
export const CLIENT_VERSION = "1.
|
|
17
|
+
export const CLIENT_VERSION = "1.5.0";
|
|
18
18
|
const DEFAULT_API = "https://htmlhost.co";
|
|
19
19
|
|
|
20
20
|
export function readConfig() {
|
|
@@ -161,7 +161,8 @@ export function findAllFiles(baseDir, currentDir) {
|
|
|
161
161
|
} else if (entry.isFile()) {
|
|
162
162
|
let size;
|
|
163
163
|
try { size = statSync(fullPath).size; } catch { continue; }
|
|
164
|
-
|
|
164
|
+
// Always with "/" (Windows paths have "\", an address no browser can ask for).
|
|
165
|
+
results.push({ filePath: fullPath, relativePath: fullPath.slice(baseDir.length + 1).split(sep).join("/"), size });
|
|
165
166
|
}
|
|
166
167
|
}
|
|
167
168
|
return results;
|
package/src/server.mjs
CHANGED
|
@@ -122,8 +122,9 @@ export function createServer() {
|
|
|
122
122
|
{
|
|
123
123
|
title: "List sites",
|
|
124
124
|
description:
|
|
125
|
-
"List
|
|
126
|
-
"Returns slug, URL, title, size, TTL, and expiration for each site."
|
|
125
|
+
"List the authenticated user's sites on htmlhost.co, and the sites shared with them as a collaborator (`shared`). " +
|
|
126
|
+
"Returns slug, URL, title, size, TTL, and expiration for each site. " +
|
|
127
|
+
"Shared sites can be pulled, deployed to and restored with this key like your own, but only their owner can delete them.",
|
|
127
128
|
inputSchema: z.object({}),
|
|
128
129
|
},
|
|
129
130
|
wrap(async () => {
|
|
@@ -140,10 +141,20 @@ export function createServer() {
|
|
|
140
141
|
expiresAt: s.expiresAt || null,
|
|
141
142
|
}));
|
|
142
143
|
|
|
144
|
+
const shared = (data.shared || []).map((s) => ({
|
|
145
|
+
slug: s.slug,
|
|
146
|
+
url: `https://${s.slug}.htmlhost.co`,
|
|
147
|
+
title: s.title || null,
|
|
148
|
+
owner: s.owner || null,
|
|
149
|
+
isMultiPage: s.isMultiPage,
|
|
150
|
+
expiresAt: s.expiresAt || null,
|
|
151
|
+
}));
|
|
152
|
+
|
|
143
153
|
return {
|
|
144
154
|
count: sites.length,
|
|
145
155
|
usage: data.usage,
|
|
146
156
|
sites,
|
|
157
|
+
...(shared.length && { shared }),
|
|
147
158
|
};
|
|
148
159
|
})
|
|
149
160
|
);
|