@scayver/specshot-mcp-server 0.13.0 → 0.22.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 +67 -10
- package/dist/build-standard.js +1070 -743
- package/dist/client.js +53 -3
- package/dist/index.js +37 -3
- package/dist/skills.js +193 -54
- package/dist/tool-descriptions.js +73 -12
- package/dist/tools/agent-loop.js +5 -0
- package/dist/tools/brand.js +64 -0
- package/dist/tools/canvas.js +2 -2
- package/dist/tools/concepts.js +28 -1
- package/dist/tools/etch-ai.js +37 -0
- package/dist/tools/etch-audit.js +30 -0
- package/dist/tools/knowledge.js +60 -0
- package/dist/tools/library.js +71 -0
- package/dist/tools/live.js +94 -0
- package/dist/tools/offline.js +16 -0
- package/dist/tools/project-edit.js +55 -0
- package/dist/tools/references.js +106 -0
- package/dist/tools/review.js +10 -0
- package/dist/tools/search-console.js +25 -0
- package/dist/tools/seo.js +82 -0
- package/dist/tools/site.js +23 -0
- package/dist/tools/skills.js +25 -7
- package/dist/tools/tasks.js +60 -0
- package/dist/tools/wireframe.js +27 -0
- package/dist/tools/wordpress.js +33 -3
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -1,3 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The base address the token is sent to, or an error in plain words.
|
|
3
|
+
*
|
|
4
|
+
* The API token travels in a header on every request, so a plain http address would send it in the
|
|
5
|
+
* clear. Only https is accepted, except on this machine (localhost and 127.0.0.1, for development).
|
|
6
|
+
*/
|
|
7
|
+
export function checkedBaseUrl(raw) {
|
|
8
|
+
let parsed;
|
|
9
|
+
try {
|
|
10
|
+
parsed = new URL(raw);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return { ok: false, error: "SPECSHOT_APP_URL is not a web address. Use https://specshot.cc or leave it unset." };
|
|
14
|
+
}
|
|
15
|
+
const local = parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1";
|
|
16
|
+
if (parsed.protocol !== "https:" && !(parsed.protocol === "http:" && local)) {
|
|
17
|
+
return { ok: false, error: "SPECSHOT_APP_URL must start with https://. A plain http address would send your API token unprotected." };
|
|
18
|
+
}
|
|
19
|
+
if (parsed.username || parsed.password)
|
|
20
|
+
return { ok: false, error: "SPECSHOT_APP_URL must not hold a user name or password." };
|
|
21
|
+
return { ok: true, url: raw.replace(/\/$/, "") };
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A request path, checked. Throws when it could reach another route than the one its tool names.
|
|
25
|
+
*
|
|
26
|
+
* Tools put ids from their arguments into the path (`/api/mcp/concepts/<id>/...`). An id such as
|
|
27
|
+
* `../projects/<id>/intelligence?` would turn a call the person approved into a call to another
|
|
28
|
+
* route with the same method. A path built from real ids never holds a `.` or `..` segment, a
|
|
29
|
+
* query, a fragment, a backslash or a space, so those are refused here, once, for every tool.
|
|
30
|
+
* Query values go through the `params` argument, which encodes them.
|
|
31
|
+
*/
|
|
32
|
+
export function safePath(path) {
|
|
33
|
+
const bad = !path.startsWith("/api/mcp/") ||
|
|
34
|
+
/[?#\\\s]/.test(path) ||
|
|
35
|
+
[...path].some((c) => c.charCodeAt(0) < 0x20) ||
|
|
36
|
+
path.split("/").some((segment) => {
|
|
37
|
+
let decoded = segment;
|
|
38
|
+
try {
|
|
39
|
+
decoded = decodeURIComponent(segment);
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
return decoded === "." || decoded === ".." || decoded.includes("/") || decoded.includes("\\");
|
|
45
|
+
}) ||
|
|
46
|
+
path.includes("//");
|
|
47
|
+
if (bad)
|
|
48
|
+
throw new Error("One of the ids is not valid. Pass ids exactly as SpecShot gave them.");
|
|
49
|
+
return path;
|
|
50
|
+
}
|
|
1
51
|
/** Thin HTTP client for the SpecShot /api/mcp/* routes, authed by an API token. */
|
|
2
52
|
export class SpecShotClient {
|
|
3
53
|
baseUrl;
|
|
@@ -7,7 +57,7 @@ export class SpecShotClient {
|
|
|
7
57
|
this.token = token;
|
|
8
58
|
}
|
|
9
59
|
async get(path, params) {
|
|
10
|
-
const url = new URL(`${this.baseUrl}${path}`);
|
|
60
|
+
const url = new URL(`${this.baseUrl}${safePath(path)}`);
|
|
11
61
|
if (params) {
|
|
12
62
|
for (const [k, v] of Object.entries(params)) {
|
|
13
63
|
if (v !== undefined && v !== "")
|
|
@@ -24,7 +74,7 @@ export class SpecShotClient {
|
|
|
24
74
|
return res.json();
|
|
25
75
|
}
|
|
26
76
|
async patch(path, body) {
|
|
27
|
-
const res = await fetch(`${this.baseUrl}${path}`, {
|
|
77
|
+
const res = await fetch(`${this.baseUrl}${safePath(path)}`, {
|
|
28
78
|
method: "PATCH",
|
|
29
79
|
headers: {
|
|
30
80
|
Authorization: `Bearer ${this.token}`,
|
|
@@ -39,7 +89,7 @@ export class SpecShotClient {
|
|
|
39
89
|
return res.json();
|
|
40
90
|
}
|
|
41
91
|
async post(path, body) {
|
|
42
|
-
const res = await fetch(`${this.baseUrl}${path}`, {
|
|
92
|
+
const res = await fetch(`${this.baseUrl}${safePath(path)}`, {
|
|
43
93
|
method: "POST",
|
|
44
94
|
headers: {
|
|
45
95
|
Authorization: `Bearer ${this.token}`,
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
-
import { SpecShotClient } from "./client.js";
|
|
4
|
+
import { SpecShotClient, checkedBaseUrl } from "./client.js";
|
|
5
5
|
import { registerConceptTools } from "./tools/concepts.js";
|
|
6
6
|
import { registerBrandTools } from "./tools/brand.js";
|
|
7
7
|
import { registerInspirationTools } from "./tools/inspiration.js";
|
|
@@ -18,6 +18,16 @@ import { registerPrototypeTools } from "./tools/prototype.js";
|
|
|
18
18
|
import { registerRenderTools } from "./tools/render.js";
|
|
19
19
|
import { registerAgentLoopTools } from "./tools/agent-loop.js";
|
|
20
20
|
import { registerSiteTools } from "./tools/site.js";
|
|
21
|
+
import { registerSeoTools } from "./tools/seo.js";
|
|
22
|
+
import { registerTaskTools } from "./tools/tasks.js";
|
|
23
|
+
import { registerEtchAuditTools } from "./tools/etch-audit.js";
|
|
24
|
+
import { registerSearchConsoleTools } from "./tools/search-console.js";
|
|
25
|
+
import { registerLibraryTools } from "./tools/library.js";
|
|
26
|
+
import { registerEtchAiTools } from "./tools/etch-ai.js"; // AI steps inside Etch.
|
|
27
|
+
import { registerKnowledgeTools } from "./tools/knowledge.js"; // The agents' briefing and knowledge.
|
|
28
|
+
import { registerProjectEditTools } from "./tools/project-edit.js"; // Project and page edits, Builder BU.
|
|
29
|
+
import { registerReferenceTools } from "./tools/references.js"; // References, captures, search and clients, Builder BW.
|
|
30
|
+
import { registerLiveTools } from "./tools/live.js"; // Live collaboration for agents, Builder BZ.
|
|
21
31
|
import { CONNECT_INSTRUCTIONS, MCP_PROMPTS } from "./build-standard.js";
|
|
22
32
|
import { createRequire } from "node:module";
|
|
23
33
|
/**
|
|
@@ -44,7 +54,12 @@ const VERSION = (() => {
|
|
|
44
54
|
}
|
|
45
55
|
})();
|
|
46
56
|
const token = process.env.SPECSHOT_API_TOKEN;
|
|
47
|
-
const
|
|
57
|
+
const checkedBase = checkedBaseUrl(process.env.SPECSHOT_APP_URL ?? "https://specshot.cc");
|
|
58
|
+
if (!checkedBase.ok) {
|
|
59
|
+
console.error(checkedBase.error);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
const baseUrl = checkedBase.url;
|
|
48
63
|
if (!token) {
|
|
49
64
|
console.error("SPECSHOT_API_TOKEN is required. Generate one at SpecShot, Settings, API Tokens.");
|
|
50
65
|
process.exit(1);
|
|
@@ -103,7 +118,7 @@ registerWorkspaceTools(server, client);
|
|
|
103
118
|
registerCanvasTools(server, client);
|
|
104
119
|
registerImageTools(server, client);
|
|
105
120
|
registerWordPressTools(server, client);
|
|
106
|
-
registerSkillTools(server);
|
|
121
|
+
registerSkillTools(server, client);
|
|
107
122
|
// The canvas slices (docs/CANVAS-DOOP-PLAN.md 4.0). Each slice registers in its own file only.
|
|
108
123
|
registerReviewTools(server, client);
|
|
109
124
|
registerPrototypeTools(server, client);
|
|
@@ -111,5 +126,24 @@ registerRenderTools(server, client);
|
|
|
111
126
|
registerAgentLoopTools(server, client);
|
|
112
127
|
// Whole-site generation for agents (docs/WHOLE-SITE-GENERATION-PLAN.md, "Agents over MCP").
|
|
113
128
|
registerSiteTools(server, client);
|
|
129
|
+
// SEO fixes for agents (docs/SEO-PORTAL-PLAN.md, phase 5).
|
|
130
|
+
registerSeoTools(server, client);
|
|
131
|
+
// Project tasks for agents (docs/PROJECT-FLOW-PLAN.md, Phase 4).
|
|
132
|
+
registerTaskTools(server, client);
|
|
133
|
+
// The Etch site audit (docs/ETCH-TOOLKIT-LESSONS.md, item 3).
|
|
134
|
+
registerEtchAuditTools(server, client);
|
|
135
|
+
// Google Search Console for agents (docs/SEARCH-CONSOLE-SETUP.md).
|
|
136
|
+
registerSearchConsoleTools(server, client);
|
|
137
|
+
// The agency library for agents: SpecShot patterns and the agency's kits (docs/WORDPRESS-PLUGIN-REBUILD.md 4.6).
|
|
138
|
+
registerLibraryTools(server, client);
|
|
139
|
+
// AI steps inside Etch for the workspace's own agent (the owner, 2026-11-02).
|
|
140
|
+
registerEtchAiTools(server, client);
|
|
141
|
+
registerKnowledgeTools(server, client);
|
|
142
|
+
// Project and page edits for agents, Builder BU (the owner, 2026-11-05).
|
|
143
|
+
registerProjectEditTools(server, client);
|
|
144
|
+
// References, captures, search and clients for agents (the owner, 2026-11-05), Builder BW.
|
|
145
|
+
registerReferenceTools(server, client);
|
|
146
|
+
// Live collaboration for agents (the owner, 2026-11-05), Builder BZ.
|
|
147
|
+
registerLiveTools(server, client);
|
|
114
148
|
const transport = new StdioServerTransport();
|
|
115
149
|
await server.connect(transport);
|