@scayver/specshot-mcp-server 0.9.0 → 0.9.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/README.md +16 -5
- package/dist/build-standard.js +4 -0
- package/dist/index.js +48 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,11 +22,22 @@ node dist/index.js
|
|
|
22
22
|
`npm install` alone does NOT reliably produce `dist/`: it only builds via the
|
|
23
23
|
`prepare` hook, which `npm ci` skips and which behaves differently across npm
|
|
24
24
|
versions and workspaces. Always run `npm run build`. Rebuild after any src
|
|
25
|
-
change. The server prints a startup
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
change. The server prints a startup banner to stderr with its version and target
|
|
26
|
+
URL, so a stale dist is visible at a glance: `[specshot-mcp] v<version> ->
|
|
27
|
+
https://specshot.cc`. That version is read from package.json at runtime, so it
|
|
28
|
+
is always the truth about the build you are running.
|
|
29
|
+
|
|
30
|
+
**Do not diagnose your build from a version number written in a doc.** An
|
|
31
|
+
earlier revision of this paragraph named specific versions and tool counts, and
|
|
32
|
+
those numbers rotted: a doc claiming "the current server is 0.6.0" teaches you
|
|
33
|
+
to conclude you are on an old build when you are not. On 2026-07-21 an agent
|
|
34
|
+
reasoning from stale published guidance re-reported a bug that had been fixed
|
|
35
|
+
days earlier and built workarounds that degraded its designs. Compare against
|
|
36
|
+
the LIVE server instead: call the `whoami` tool. Over stdio it returns the
|
|
37
|
+
running `serverVersion` (read from package.json in that very process), the
|
|
38
|
+
transport, and the SpecShot URL it targets. Over the hosted HTTP endpoint it
|
|
39
|
+
also returns the workspace, the token scope, and the real `toolCount`. If
|
|
40
|
+
`whoami` disagrees with anything you read here, `whoami` is right.
|
|
30
41
|
|
|
31
42
|
After publishing, npx works with no install:
|
|
32
43
|
|
package/dist/build-standard.js
CHANGED
|
@@ -26,6 +26,10 @@ model on the server, so the quality is entirely yours.
|
|
|
26
26
|
- One self-contained HTML per page, CSS inline in a <style> block. No external
|
|
27
27
|
scripts, fonts, or images: the preview strips script/iframe/object/embed/link/meta/
|
|
28
28
|
base and drops @import, so inline everything (SVG, gradients, data: URIs).
|
|
29
|
+
- Embedded fonts load: an @font-face with a data: URI src (or local()) registers and
|
|
30
|
+
renders in the preview. One with an external url is dropped whole. Do not strip
|
|
31
|
+
embedded fonts to work around the preview, and do not depend on locally installed
|
|
32
|
+
fonts (a client reviewing in the portal does not have them).
|
|
29
33
|
- Save each page with save_wireframe and ALWAYS pass its pageSlug, so it files under
|
|
30
34
|
the page and its sections become selectable for client feedback. Revise in place
|
|
31
35
|
with revise_wireframe when feedback arrives; keep version history.
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,30 @@ import { registerMessageTools } from "./tools/messages.js";
|
|
|
10
10
|
import { registerWorkspaceTools } from "./tools/workspace.js";
|
|
11
11
|
import { registerCanvasTools } from "./tools/canvas.js";
|
|
12
12
|
import { BUILD_STANDARD_SHORT } from "./build-standard.js";
|
|
13
|
-
|
|
13
|
+
import { createRequire } from "node:module";
|
|
14
|
+
/**
|
|
15
|
+
* Read the version from package.json instead of restating it. A hardcoded copy
|
|
16
|
+
* sat at 0.7.0 while the package shipped 0.9.0, so this server introduced itself
|
|
17
|
+
* to every agent as two versions older than it was — including in the 0.9.0
|
|
18
|
+
* tarball published on 2026-07-21. That is the same lie the hosted endpoint told
|
|
19
|
+
* (see apps/web/src/lib/mcp-version.ts), and it matters because an agent that
|
|
20
|
+
* believes it is on an old build will "confirm" bugs that were already fixed and
|
|
21
|
+
* build workarounds for them, which is exactly what happened that day.
|
|
22
|
+
*
|
|
23
|
+
* dist/index.js resolves "../package.json" to the package root, and npm always
|
|
24
|
+
* includes package.json in the tarball, so this holds for a published install
|
|
25
|
+
* and a local build alike. Falling back to "unknown" is deliberate: a version we
|
|
26
|
+
* cannot read must never masquerade as a specific one.
|
|
27
|
+
*/
|
|
28
|
+
const VERSION = (() => {
|
|
29
|
+
try {
|
|
30
|
+
const require = createRequire(import.meta.url);
|
|
31
|
+
return require("../package.json").version ?? "unknown";
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return "unknown";
|
|
35
|
+
}
|
|
36
|
+
})();
|
|
14
37
|
const token = process.env.SPECSHOT_API_TOKEN;
|
|
15
38
|
const baseUrl = process.env.SPECSHOT_APP_URL ?? "https://specshot.cc";
|
|
16
39
|
if (!token) {
|
|
@@ -34,6 +57,30 @@ server.registerPrompt("build_a_page", {
|
|
|
34
57
|
}, () => ({
|
|
35
58
|
messages: [{ role: "user", content: { type: "text", text: BUILD_STANDARD_SHORT } }],
|
|
36
59
|
}));
|
|
60
|
+
/**
|
|
61
|
+
* whoami: ground truth about THIS process, so an agent never has to infer what
|
|
62
|
+
* it is running from a version written in a doc or remembered from a past
|
|
63
|
+
* session. The hosted endpoint has always had this; stdio did not, which left
|
|
64
|
+
* an npx agent with no way to ask. On 2026-07-21 one reasoned from stale
|
|
65
|
+
* published guidance, "confirmed" an already-fixed bug, and built workarounds
|
|
66
|
+
* for it. Everything here is read live: the version from package.json, the
|
|
67
|
+
* target from the resolved base URL. No secrets, and the token is never echoed.
|
|
68
|
+
*/
|
|
69
|
+
server.tool("whoami", "Confirm what you are actually connected to: the running server version, the transport (stdio), the SpecShot URL it targets, and whether an API token is configured. Call this FIRST when anything seems inconsistent with what you expect, and trust it over any version number written in a doc, a README, or your own memory of a past session. Returns no secrets.", {}, async () => ({
|
|
70
|
+
content: [
|
|
71
|
+
{
|
|
72
|
+
type: "text",
|
|
73
|
+
text: JSON.stringify({
|
|
74
|
+
serverVersion: VERSION,
|
|
75
|
+
transport: "stdio",
|
|
76
|
+
packageName: "@scayver/specshot-mcp-server",
|
|
77
|
+
targetUrl: baseUrl,
|
|
78
|
+
tokenConfigured: Boolean(token),
|
|
79
|
+
note: "Read live from this process. If a doc or a remembered version disagrees with this, this is right.",
|
|
80
|
+
}, null, 2),
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
}));
|
|
37
84
|
registerConceptTools(server, client);
|
|
38
85
|
registerBrandTools(server, client);
|
|
39
86
|
registerInspirationTools(server, client);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayver/specshot-mcp-server",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "MCP server for SpecShot — lets Claude Code, Claude Desktop, and Cursor fetch approved design concepts with brand tokens and a ready-to-build prompt.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|