@clipform/mcp-server 1.18.0 → 1.22.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 +1 -2
- package/dist/{chunk-GZH3JXEB.js → chunk-CN4LJK36.js} +1075 -5932
- package/dist/chunk-CN4LJK36.js.map +1 -0
- package/dist/chunk-DDSNGWKB.js +534 -0
- package/dist/chunk-DDSNGWKB.js.map +1 -0
- package/dist/chunk-DWFACCUE.js +4701 -0
- package/dist/chunk-DWFACCUE.js.map +1 -0
- package/dist/chunk-Z7CP5LVY.js +188 -0
- package/dist/chunk-Z7CP5LVY.js.map +1 -0
- package/dist/index.js +21 -4
- package/dist/index.js.map +1 -1
- package/dist/prompts.d.ts +42 -0
- package/dist/prompts.js +31 -0
- package/dist/prompts.js.map +1 -0
- package/dist/resources.d.ts +11 -0
- package/dist/resources.js +17 -0
- package/dist/resources.js.map +1 -0
- package/dist/server.d.ts +5 -2
- package/dist/server.js +4 -1
- package/package.json +14 -1
- package/dist/chunk-GZH3JXEB.js.map +0 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getMcpAuth
|
|
3
|
+
} from "./chunk-HCZI2UJ5.js";
|
|
4
|
+
|
|
5
|
+
// src/lib/telemetry.ts
|
|
6
|
+
var telemetryEnabled = process.env.DO_NOT_TRACK !== "1" && process.env.CLIPFORM_TELEMETRY !== "off";
|
|
7
|
+
var mcpVersion = "unknown";
|
|
8
|
+
function setMcpVersion(version) {
|
|
9
|
+
mcpVersion = version;
|
|
10
|
+
}
|
|
11
|
+
function getApiBaseUrl() {
|
|
12
|
+
return process.env.API_URL || null;
|
|
13
|
+
}
|
|
14
|
+
function reportError(report) {
|
|
15
|
+
if (!telemetryEnabled) return;
|
|
16
|
+
const base = getApiBaseUrl();
|
|
17
|
+
if (!base) return;
|
|
18
|
+
const payload = {
|
|
19
|
+
...report,
|
|
20
|
+
error_message: report.error_message.slice(0, 500),
|
|
21
|
+
mcp_version: mcpVersion,
|
|
22
|
+
runtime: detectRuntime(),
|
|
23
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
24
|
+
};
|
|
25
|
+
fetch(`${base}/v1/telemetry/errors`, {
|
|
26
|
+
method: "POST",
|
|
27
|
+
headers: { "Content-Type": "application/json" },
|
|
28
|
+
body: JSON.stringify(payload),
|
|
29
|
+
signal: AbortSignal.timeout(2e3)
|
|
30
|
+
}).catch(() => {
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function isServerFault(status) {
|
|
34
|
+
return status >= 500;
|
|
35
|
+
}
|
|
36
|
+
function detectRuntime() {
|
|
37
|
+
if (process.env.CLAUDE_CODE) return "claude-code";
|
|
38
|
+
if (process.env.CURSOR_SESSION_ID) return "cursor";
|
|
39
|
+
return "stdio";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// src/lib/api-client.ts
|
|
43
|
+
function getApiBaseUrl2() {
|
|
44
|
+
const url = process.env.API_URL;
|
|
45
|
+
if (!url) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
"API_URL must be set (e.g. http://localhost:3003 or https://api.clipform.io)"
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return url;
|
|
51
|
+
}
|
|
52
|
+
function getAuthHeaders() {
|
|
53
|
+
const authCtx = getMcpAuth();
|
|
54
|
+
const apiKey = authCtx?.api_key || process.env.CLIPFORM_API_KEY;
|
|
55
|
+
if (!apiKey) {
|
|
56
|
+
throw new Error("CLIPFORM_API_KEY must be set.");
|
|
57
|
+
}
|
|
58
|
+
return { "Authorization": `Bearer ${apiKey}` };
|
|
59
|
+
}
|
|
60
|
+
async function callApi(path, options = {}) {
|
|
61
|
+
const { body, params, timeoutMs = 3e4 } = options;
|
|
62
|
+
const method = options.method || (body ? "POST" : "GET");
|
|
63
|
+
const base = getApiBaseUrl2();
|
|
64
|
+
const prefix = path.startsWith("/internal/") ? "" : "/v1";
|
|
65
|
+
let url = `${base}${prefix}${path}`;
|
|
66
|
+
if (params) {
|
|
67
|
+
const searchParams = new URLSearchParams(params);
|
|
68
|
+
url += `?${searchParams.toString()}`;
|
|
69
|
+
}
|
|
70
|
+
const headers = {
|
|
71
|
+
"Content-Type": "application/json",
|
|
72
|
+
...getAuthHeaders()
|
|
73
|
+
};
|
|
74
|
+
const fetchOptions = {
|
|
75
|
+
method,
|
|
76
|
+
headers,
|
|
77
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
78
|
+
};
|
|
79
|
+
if (body && method !== "GET") {
|
|
80
|
+
fetchOptions.body = JSON.stringify(body);
|
|
81
|
+
}
|
|
82
|
+
let response;
|
|
83
|
+
try {
|
|
84
|
+
response = await fetch(url, fetchOptions);
|
|
85
|
+
} catch (err) {
|
|
86
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
87
|
+
reportError({
|
|
88
|
+
error_type: "connection_error",
|
|
89
|
+
error_message: message,
|
|
90
|
+
tool_name: getMcpAuth()?.tool_name,
|
|
91
|
+
api_path: `${prefix}${path}`
|
|
92
|
+
});
|
|
93
|
+
return {
|
|
94
|
+
ok: false,
|
|
95
|
+
status: 0,
|
|
96
|
+
error: `Failed to connect to API at ${url}.
|
|
97
|
+
|
|
98
|
+
Error: ${message}`
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
if (response.status === 204) {
|
|
102
|
+
return { ok: true, data: {} };
|
|
103
|
+
}
|
|
104
|
+
const data = await response.json();
|
|
105
|
+
if (!response.ok) {
|
|
106
|
+
const errorMsg = data.error || `API error (${response.status})`;
|
|
107
|
+
if (isServerFault(response.status)) {
|
|
108
|
+
reportError({
|
|
109
|
+
error_type: `http_${response.status}`,
|
|
110
|
+
error_message: errorMsg,
|
|
111
|
+
tool_name: getMcpAuth()?.tool_name,
|
|
112
|
+
status_code: response.status,
|
|
113
|
+
api_path: `${prefix}${path}`
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
ok: false,
|
|
118
|
+
status: response.status,
|
|
119
|
+
error: errorMsg
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
return { ok: true, data };
|
|
123
|
+
}
|
|
124
|
+
function errorResult(message) {
|
|
125
|
+
return {
|
|
126
|
+
content: [{ type: "text", text: message }],
|
|
127
|
+
isError: true
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function textResult(text) {
|
|
131
|
+
return {
|
|
132
|
+
content: [{ type: "text", text }]
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// src/lib/session-context.ts
|
|
137
|
+
async function getSessionContext() {
|
|
138
|
+
let result;
|
|
139
|
+
try {
|
|
140
|
+
result = await callApi("/me", { method: "GET" });
|
|
141
|
+
} catch {
|
|
142
|
+
return "";
|
|
143
|
+
}
|
|
144
|
+
if (!result.ok) return "";
|
|
145
|
+
const me = result.data;
|
|
146
|
+
const plan = me.plan;
|
|
147
|
+
const lines = [];
|
|
148
|
+
lines.push("## Your Session");
|
|
149
|
+
if (me.auth_mode === "oauth") {
|
|
150
|
+
lines.push(`Auth: OAuth (connected)`);
|
|
151
|
+
lines.push(`Workspace: ${me.workspace?.name ?? "Unknown"} (${me.workspace?.id ?? "?"})`);
|
|
152
|
+
lines.push(`User: ${me.user_id ?? "?"}`);
|
|
153
|
+
lines.push(`Company: ${me.company_id ?? "none"}`);
|
|
154
|
+
} else {
|
|
155
|
+
lines.push("Auth: anonymous (not connected to a Clipform account)");
|
|
156
|
+
if (me.workspace) {
|
|
157
|
+
lines.push(`Workspace: ${me.workspace.name} (${me.workspace.id})`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
lines.push(`Plan: ${plan.name} (tier ${plan.tier})`);
|
|
161
|
+
if (plan.node_limit !== null) {
|
|
162
|
+
lines.push(`Question limit: ${plan.node_limit} per form`);
|
|
163
|
+
} else {
|
|
164
|
+
lines.push("Questions: unlimited");
|
|
165
|
+
}
|
|
166
|
+
if (plan.form_limit !== null) {
|
|
167
|
+
lines.push(`Form limit: ${plan.form_limit} forms`);
|
|
168
|
+
} else {
|
|
169
|
+
lines.push("Forms: unlimited");
|
|
170
|
+
}
|
|
171
|
+
if (plan.custom_theme === false) {
|
|
172
|
+
lines.push("Custom themes: not available on this plan");
|
|
173
|
+
}
|
|
174
|
+
if (me.auth_mode !== "oauth") {
|
|
175
|
+
lines.push(`
|
|
176
|
+
To unlock your full plan: sign in to your Clipform account.`);
|
|
177
|
+
}
|
|
178
|
+
return lines.join("\n");
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export {
|
|
182
|
+
setMcpVersion,
|
|
183
|
+
callApi,
|
|
184
|
+
errorResult,
|
|
185
|
+
textResult,
|
|
186
|
+
getSessionContext
|
|
187
|
+
};
|
|
188
|
+
//# sourceMappingURL=chunk-Z7CP5LVY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/telemetry.ts","../src/lib/api-client.ts","../src/lib/session-context.ts"],"sourcesContent":["const telemetryEnabled =\n process.env.DO_NOT_TRACK !== \"1\" &&\n process.env.CLIPFORM_TELEMETRY !== \"off\";\n\nlet mcpVersion = \"unknown\";\n\nexport function setMcpVersion(version: string) {\n mcpVersion = version;\n}\n\nfunction getApiBaseUrl(): string | null {\n return process.env.API_URL || null;\n}\n\nexport interface ErrorReport {\n error_type: string;\n error_message: string;\n tool_name?: string;\n status_code?: number;\n api_path?: string;\n}\n\nexport function reportError(report: ErrorReport) {\n if (!telemetryEnabled) return;\n const base = getApiBaseUrl();\n if (!base) return;\n\n const payload = {\n ...report,\n error_message: report.error_message.slice(0, 500),\n mcp_version: mcpVersion,\n runtime: detectRuntime(),\n timestamp: new Date().toISOString(),\n };\n\n fetch(`${base}/v1/telemetry/errors`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(payload),\n signal: AbortSignal.timeout(2_000),\n }).catch(() => {});\n}\n\nexport function isServerFault(status: number): boolean {\n return status >= 500;\n}\n\nfunction detectRuntime(): string {\n if (process.env.CLAUDE_CODE) return \"claude-code\";\n if (process.env.CURSOR_SESSION_ID) return \"cursor\";\n return \"stdio\";\n}\n","import { getMcpAuth } from \"./auth-context.js\";\nimport { reportError, isServerFault } from \"./telemetry.js\";\n\nfunction getApiBaseUrl(): string {\n const url = process.env.API_URL;\n if (!url) {\n throw new Error(\n \"API_URL must be set (e.g. http://localhost:3003 or https://api.clipform.io)\"\n );\n }\n return url;\n}\n\n\nfunction getAuthHeaders(): Record<string, string> {\n const authCtx = getMcpAuth();\n const apiKey = authCtx?.api_key || process.env.CLIPFORM_API_KEY;\n if (!apiKey) {\n throw new Error(\"CLIPFORM_API_KEY must be set.\");\n }\n\n return { \"Authorization\": `Bearer ${apiKey}` };\n}\n\ninterface ApiOptions {\n method?: string;\n body?: Record<string, unknown>;\n params?: Record<string, string>;\n timeoutMs?: number;\n}\n\ntype ApiResult =\n | { ok: true; data: Record<string, unknown> }\n | { ok: false; status: number; error: string };\n\nexport async function callApi(\n path: string,\n options: ApiOptions = {}\n): Promise<ApiResult> {\n const { body, params, timeoutMs = 30_000 } = options;\n const method = options.method || (body ? \"POST\" : \"GET\");\n\n const base = getApiBaseUrl();\n const prefix = path.startsWith(\"/internal/\") ? \"\" : \"/v1\";\n let url = `${base}${prefix}${path}`;\n if (params) {\n const searchParams = new URLSearchParams(params);\n url += `?${searchParams.toString()}`;\n }\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n ...getAuthHeaders(),\n };\n\n const fetchOptions: RequestInit = {\n method,\n headers,\n signal: AbortSignal.timeout(timeoutMs),\n };\n\n if (body && method !== \"GET\") {\n fetchOptions.body = JSON.stringify(body);\n }\n\n let response: Response;\n try {\n response = await fetch(url, fetchOptions);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n reportError({\n error_type: \"connection_error\",\n error_message: message,\n tool_name: getMcpAuth()?.tool_name,\n api_path: `${prefix}${path}`,\n });\n return {\n ok: false,\n status: 0,\n error: `Failed to connect to API at ${url}.\\n\\nError: ${message}`,\n };\n }\n\n if (response.status === 204) {\n return { ok: true, data: {} };\n }\n\n const data = (await response.json()) as Record<string, unknown>;\n\n if (!response.ok) {\n const errorMsg = (data.error as string) || `API error (${response.status})`;\n if (isServerFault(response.status)) {\n reportError({\n error_type: `http_${response.status}`,\n error_message: errorMsg,\n tool_name: getMcpAuth()?.tool_name,\n status_code: response.status,\n api_path: `${prefix}${path}`,\n });\n }\n return {\n ok: false,\n status: response.status,\n error: errorMsg,\n };\n }\n\n return { ok: true, data };\n}\n\nexport function errorResult(message: string) {\n return {\n content: [{ type: \"text\" as const, text: message }],\n isError: true,\n };\n}\n\nexport function textResult(text: string) {\n return {\n content: [{ type: \"text\" as const, text }],\n };\n}\n","import { BUSINESS } from \"@vid-master/config\";\nimport { callApi } from \"./api-client.js\";\n\nexport async function getSessionContext(): Promise<string> {\n let result;\n try {\n result = await callApi(\"/me\", { method: \"GET\" });\n } catch {\n return \"\";\n }\n if (!result.ok) return \"\";\n\n const me = result.data as any;\n const plan = me.plan;\n const lines: string[] = [];\n\n lines.push(\"## Your Session\");\n if (me.auth_mode === \"oauth\") {\n lines.push(`Auth: OAuth (connected)`);\n lines.push(`Workspace: ${me.workspace?.name ?? \"Unknown\"} (${me.workspace?.id ?? \"?\"})`);\n lines.push(`User: ${me.user_id ?? \"?\"}`);\n lines.push(`Company: ${me.company_id ?? \"none\"}`);\n } else {\n lines.push(\"Auth: anonymous (not connected to a Clipform account)\");\n if (me.workspace) {\n lines.push(`Workspace: ${me.workspace.name} (${me.workspace.id})`);\n }\n }\n lines.push(`Plan: ${plan.name} (tier ${plan.tier})`);\n if (plan.node_limit !== null) {\n lines.push(`Question limit: ${plan.node_limit} per form`);\n } else {\n lines.push(\"Questions: unlimited\");\n }\n if (plan.form_limit !== null) {\n lines.push(`Form limit: ${plan.form_limit} forms`);\n } else {\n lines.push(\"Forms: unlimited\");\n }\n if (plan.custom_theme === false) {\n lines.push(\"Custom themes: not available on this plan\");\n }\n if (me.auth_mode !== \"oauth\") {\n lines.push(`\\nTo unlock your full plan: sign in to your Clipform account.`);\n }\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;AAAA,IAAM,mBACJ,QAAQ,IAAI,iBAAiB,OAC7B,QAAQ,IAAI,uBAAuB;AAErC,IAAI,aAAa;AAEV,SAAS,cAAc,SAAiB;AAC7C,eAAa;AACf;AAEA,SAAS,gBAA+B;AACtC,SAAO,QAAQ,IAAI,WAAW;AAChC;AAUO,SAAS,YAAY,QAAqB;AAC/C,MAAI,CAAC,iBAAkB;AACvB,QAAM,OAAO,cAAc;AAC3B,MAAI,CAAC,KAAM;AAEX,QAAM,UAAU;AAAA,IACd,GAAG;AAAA,IACH,eAAe,OAAO,cAAc,MAAM,GAAG,GAAG;AAAA,IAChD,aAAa;AAAA,IACb,SAAS,cAAc;AAAA,IACvB,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,EACpC;AAEA,QAAM,GAAG,IAAI,wBAAwB;AAAA,IACnC,QAAQ;AAAA,IACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,IAC9C,MAAM,KAAK,UAAU,OAAO;AAAA,IAC5B,QAAQ,YAAY,QAAQ,GAAK;AAAA,EACnC,CAAC,EAAE,MAAM,MAAM;AAAA,EAAC,CAAC;AACnB;AAEO,SAAS,cAAc,QAAyB;AACrD,SAAO,UAAU;AACnB;AAEA,SAAS,gBAAwB;AAC/B,MAAI,QAAQ,IAAI,YAAa,QAAO;AACpC,MAAI,QAAQ,IAAI,kBAAmB,QAAO;AAC1C,SAAO;AACT;;;AChDA,SAASA,iBAAwB;AAC/B,QAAM,MAAM,QAAQ,IAAI;AACxB,MAAI,CAAC,KAAK;AACR,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAGA,SAAS,iBAAyC;AAChD,QAAM,UAAU,WAAW;AAC3B,QAAM,SAAS,SAAS,WAAW,QAAQ,IAAI;AAC/C,MAAI,CAAC,QAA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AA,EAClD,OAAO;AACL,UAAM,KAAK,uDAAuD;AAClE,QAAI,GAAG,WAAW;AAChB,YAAM,KAAK,cAAc,GAAG,UAAU,IAAI,KAAK,GAAG,UAAU,EAAE,GAAG;AAAA,IACnE;AAAA,EACF;AACA,QAAM,KAAK,SAAS,KAAK,IAAI,UAAU,KAAK,IAAI,GAAG;AACnD,MAAI,KAAK,eAAe,MAAM;AAC5B,UAAM,KAAK,mBAAmB,KAAK,UAAU,WAAW;AAAA,EAC1D,OAAO;AACL,UAAM,KAAK,sBAAsB;AAAA,EACnC;AACA,MAAI,KAAK,eAAe,MAAM;AAC5B,UAAM,KAAK,eAAe,KAAK,UAAU,QAAQ;AAAA,EACnD,OAAO;AACL,UAAM,KAAK,kBAAkB;AAAA,EAC/B;AACA,MAAI,KAAK,iBAAiB,OAAO;AAC/B,UAAM,KAAK,2CAA2C;AAAA,EACxD;AACA,MAAI,GAAG,cAAc,SAAS;AAC5B,UAAM,KAAK;AAAA,4DAA+D;AAAA,EAC5E;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":["getApiBaseUrl"]}
|
package/dist/index.js
CHANGED
|
@@ -2,11 +2,21 @@
|
|
|
2
2
|
import {
|
|
3
3
|
JSONRPCMessageSchema,
|
|
4
4
|
createServer
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CN4LJK36.js";
|
|
6
|
+
import "./chunk-DWFACCUE.js";
|
|
7
|
+
import "./chunk-DDSNGWKB.js";
|
|
8
|
+
import {
|
|
9
|
+
setMcpVersion
|
|
10
|
+
} from "./chunk-Z7CP5LVY.js";
|
|
6
11
|
import "./chunk-HCZI2UJ5.js";
|
|
7
12
|
|
|
13
|
+
// src/index.ts
|
|
14
|
+
import { readFileSync } from "fs";
|
|
15
|
+
import { dirname, join } from "path";
|
|
16
|
+
import { fileURLToPath } from "url";
|
|
17
|
+
|
|
8
18
|
// ../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
9
|
-
import
|
|
19
|
+
import process2 from "process";
|
|
10
20
|
|
|
11
21
|
// ../../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
12
22
|
var ReadBuffer = class {
|
|
@@ -38,7 +48,7 @@ function serializeMessage(message) {
|
|
|
38
48
|
|
|
39
49
|
// ../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
40
50
|
var StdioServerTransport = class {
|
|
41
|
-
constructor(_stdin =
|
|
51
|
+
constructor(_stdin = process2.stdin, _stdout = process2.stdout) {
|
|
42
52
|
this._stdin = _stdin;
|
|
43
53
|
this._stdout = _stdout;
|
|
44
54
|
this._readBuffer = new ReadBuffer();
|
|
@@ -98,8 +108,15 @@ var StdioServerTransport = class {
|
|
|
98
108
|
};
|
|
99
109
|
|
|
100
110
|
// src/index.ts
|
|
111
|
+
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
112
|
+
var pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
|
|
113
|
+
setMcpVersion(pkg.version);
|
|
114
|
+
var telemetryOff = process.env.DO_NOT_TRACK === "1" || process.env.CLIPFORM_TELEMETRY === "off";
|
|
101
115
|
var server = createServer();
|
|
102
116
|
var transport = new StdioServerTransport();
|
|
103
117
|
await server.connect(transport);
|
|
104
|
-
console.error(
|
|
118
|
+
console.error(`Clipform MCP Server v${pkg.version} running on stdio`);
|
|
119
|
+
if (!telemetryOff) {
|
|
120
|
+
console.error("Telemetry enabled (server errors only). Set DO_NOT_TRACK=1 to disable.");
|
|
121
|
+
}
|
|
105
122
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/@modelcontextprotocol/sdk/src/server/stdio.ts","../../../node_modules/@modelcontextprotocol/sdk/src/shared/stdio.ts"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../../../node_modules/@modelcontextprotocol/sdk/src/server/stdio.ts","../../../node_modules/@modelcontextprotocol/sdk/src/shared/stdio.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { createServer } from \"./server.js\";\nimport { setMcpVersion } from \"./lib/telemetry.js\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nconst pkg = JSON.parse(readFileSync(join(__dirname, \"..\", \"package.json\"), \"utf-8\"));\nsetMcpVersion(pkg.version);\n\nconst telemetryOff =\n process.env.DO_NOT_TRACK === \"1\" || process.env.CLIPFORM_TELEMETRY === \"off\";\n\nconst server = createServer();\nconst transport = new StdioServerTransport();\nawait server.connect(transport);\nconsole.error(`Clipform MCP Server v${pkg.version} running on stdio`);\nif (!telemetryOff) {\n console.error(\"Telemetry enabled (server errors only). Set DO_NOT_TRACK=1 to disable.\");\n}\n",null,null],"mappings":";;;;;;;;;;;;;AACA,SAAS,oBAAoB;AAC7B,SAAS,SAAS,YAAY;AAC9B,SAAS,qBAAqB;;;ACH9B,OAAOA,cAAa;;;ACKd,IAAO,aAAP,MAAiB;EAGnB,OAAO,OAAa;AAChB,SAAK,UAAU,KAAK,UAAU,OAAO,OAAO,CAAC,KAAK,SAAS,KAAK,CAAC,IAAI;EACzE;EAEA,cAAW;AACP,QAAI,CAAC,KAAK,SAAS;AACf,aAAO;IACX;AAEA,UAAM,QAAQ,KAAK,QAAQ,QAAQ,IAAI;AACvC,QAAI,UAAU,IAAI;AACd,aAAO;IACX;AAEA,UAAM,OAAO,KAAK,QAAQ,SAAS,QAAQ,GAAG,KAAK,EAAE,QAAQ,OAAO,EAAE;AACtE,SAAK,UAAU,KAAK,QAAQ,SAAS,QAAQ,CAAC;AAC9C,WAAO,mBAAmB,IAAI;EAClC;EAEA,QAAK;AACD,SAAK,UAAU;EACnB;;AAGE,SAAU,mBAAmB,MAAY;AAC3C,SAAO,qBAAqB,MAA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AO;AACH,aAAK,QAAQ,KAAK,SAAS,OAAO;MACtC;IACJ,CAAC;EACL;;;;ADlFJ,IAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AACxD,IAAM,MAAM,KAAK,MAAM,aAAa,KAAK,WAAW,MAAM,cAAc,GAAG,OAAO,CAAC;AACnF,cAAc,IAAI,OAAO;AAEzB,IAAM,eACJ,QAAQ,IAAI,iBAAiB,OAAO,QAAQ,IAAI,uBAAuB;AAEzE,IAAM,SAAS,aAAa;AAC5B,IAAM,YAAY,IAAI,qBAAqB;AAC3C,MAAM,OAAO,QAAQ,SAAS;AAC9B,QAAQ,MAAM,wBAAwB,IAAI,OAAO,mBAAmB;AACpE,IAAI,CAAC,cAAc;AACjB,UAAQ,MAAM,wEAAwE;AACxF;","names":["process","process"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { QuizVariant } from './resources.js';
|
|
3
|
+
|
|
4
|
+
declare const WORKFLOW_TYPES: readonly ["quiz", "survey", "interview", "funnel", "testimonial", "application", "booking"];
|
|
5
|
+
type WorkflowType = (typeof WORKFLOW_TYPES)[number];
|
|
6
|
+
interface WorkflowArgs {
|
|
7
|
+
topic?: string;
|
|
8
|
+
question_count?: number;
|
|
9
|
+
media_style?: "text" | "images" | "video";
|
|
10
|
+
categories?: string;
|
|
11
|
+
youtube_url?: string;
|
|
12
|
+
audience?: string;
|
|
13
|
+
purpose?: string;
|
|
14
|
+
response_format?: "video" | "audio" | "text" | "all";
|
|
15
|
+
needs_consent?: boolean;
|
|
16
|
+
anonymous?: boolean;
|
|
17
|
+
outcomes?: string;
|
|
18
|
+
criteria?: string;
|
|
19
|
+
needs_contact?: boolean;
|
|
20
|
+
use_case?: string;
|
|
21
|
+
role?: string;
|
|
22
|
+
event_name?: string;
|
|
23
|
+
event_type?: string;
|
|
24
|
+
}
|
|
25
|
+
interface DiscoveryParam {
|
|
26
|
+
key: keyof WorkflowArgs;
|
|
27
|
+
question: string;
|
|
28
|
+
fallback: string;
|
|
29
|
+
}
|
|
30
|
+
declare function buildDiscovery(params: DiscoveryParam[], args: WorkflowArgs): string;
|
|
31
|
+
declare const QUIZ_DISCOVERY: DiscoveryParam[];
|
|
32
|
+
declare const PERSONALITY_DISCOVERY: DiscoveryParam[];
|
|
33
|
+
declare const COMPREHENSION_DISCOVERY: DiscoveryParam[];
|
|
34
|
+
declare const SURVEY_DISCOVERY: DiscoveryParam[];
|
|
35
|
+
declare const INTERVIEW_DISCOVERY: DiscoveryParam[];
|
|
36
|
+
declare const TESTIMONIAL_DISCOVERY: DiscoveryParam[];
|
|
37
|
+
declare const APPLICATION_DISCOVERY: DiscoveryParam[];
|
|
38
|
+
declare const BOOKING_DISCOVERY: DiscoveryParam[];
|
|
39
|
+
declare function getWorkflowText(type: WorkflowType, args?: WorkflowArgs, variant?: QuizVariant): Promise<string>;
|
|
40
|
+
declare function registerPrompts(server: McpServer): void;
|
|
41
|
+
|
|
42
|
+
export { APPLICATION_DISCOVERY, BOOKING_DISCOVERY, COMPREHENSION_DISCOVERY, type DiscoveryParam, INTERVIEW_DISCOVERY, PERSONALITY_DISCOVERY, QUIZ_DISCOVERY, SURVEY_DISCOVERY, TESTIMONIAL_DISCOVERY, WORKFLOW_TYPES, type WorkflowArgs, type WorkflowType, buildDiscovery, getWorkflowText, registerPrompts };
|
package/dist/prompts.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
APPLICATION_DISCOVERY,
|
|
3
|
+
BOOKING_DISCOVERY,
|
|
4
|
+
COMPREHENSION_DISCOVERY,
|
|
5
|
+
INTERVIEW_DISCOVERY,
|
|
6
|
+
PERSONALITY_DISCOVERY,
|
|
7
|
+
QUIZ_DISCOVERY,
|
|
8
|
+
SURVEY_DISCOVERY,
|
|
9
|
+
TESTIMONIAL_DISCOVERY,
|
|
10
|
+
WORKFLOW_TYPES,
|
|
11
|
+
buildDiscovery,
|
|
12
|
+
getWorkflowText,
|
|
13
|
+
registerPrompts
|
|
14
|
+
} from "./chunk-DWFACCUE.js";
|
|
15
|
+
import "./chunk-Z7CP5LVY.js";
|
|
16
|
+
import "./chunk-HCZI2UJ5.js";
|
|
17
|
+
export {
|
|
18
|
+
APPLICATION_DISCOVERY,
|
|
19
|
+
BOOKING_DISCOVERY,
|
|
20
|
+
COMPREHENSION_DISCOVERY,
|
|
21
|
+
INTERVIEW_DISCOVERY,
|
|
22
|
+
PERSONALITY_DISCOVERY,
|
|
23
|
+
QUIZ_DISCOVERY,
|
|
24
|
+
SURVEY_DISCOVERY,
|
|
25
|
+
TESTIMONIAL_DISCOVERY,
|
|
26
|
+
WORKFLOW_TYPES,
|
|
27
|
+
buildDiscovery,
|
|
28
|
+
getWorkflowText,
|
|
29
|
+
registerPrompts
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
|
|
3
|
+
declare const GUIDE_TYPES: readonly ["quiz", "survey", "interview", "funnel", "testimonial", "application", "booking"];
|
|
4
|
+
type GuideType = (typeof GUIDE_TYPES)[number];
|
|
5
|
+
declare const QUIZ_VARIANTS: readonly ["personality", "comprehension"];
|
|
6
|
+
type QuizVariant = (typeof QUIZ_VARIANTS)[number];
|
|
7
|
+
declare function getGuideContent(type: GuideType, variant?: QuizVariant): string;
|
|
8
|
+
declare function getGuideUri(type: GuideType, variant?: QuizVariant): string;
|
|
9
|
+
declare function registerResources(server: McpServer): void;
|
|
10
|
+
|
|
11
|
+
export { GUIDE_TYPES, type GuideType, QUIZ_VARIANTS, type QuizVariant, getGuideContent, getGuideUri, registerResources };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GUIDE_TYPES,
|
|
3
|
+
QUIZ_VARIANTS,
|
|
4
|
+
getGuideContent,
|
|
5
|
+
getGuideUri,
|
|
6
|
+
registerResources
|
|
7
|
+
} from "./chunk-DDSNGWKB.js";
|
|
8
|
+
import "./chunk-Z7CP5LVY.js";
|
|
9
|
+
import "./chunk-HCZI2UJ5.js";
|
|
10
|
+
export {
|
|
11
|
+
GUIDE_TYPES,
|
|
12
|
+
QUIZ_VARIANTS,
|
|
13
|
+
getGuideContent,
|
|
14
|
+
getGuideUri,
|
|
15
|
+
registerResources
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface CreateServerOptions {
|
|
4
|
+
onToolError?: (toolName: string, error: Error) => void;
|
|
5
|
+
}
|
|
6
|
+
declare function createServer(options?: CreateServerOptions): McpServer;
|
|
4
7
|
|
|
5
|
-
export { createServer };
|
|
8
|
+
export { type CreateServerOptions, createServer };
|
package/dist/server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clipform/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.1",
|
|
4
4
|
"description": "MCP server for building and managing Clipform video forms",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://clipform.io",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/andy-cb-smith/vid-master.git",
|
|
10
|
+
"directory": "packages/mcp-server"
|
|
11
|
+
},
|
|
7
12
|
"type": "module",
|
|
8
13
|
"main": "dist/index.js",
|
|
9
14
|
"exports": {
|
|
@@ -18,6 +23,14 @@
|
|
|
18
23
|
"./auth-context": {
|
|
19
24
|
"types": "./dist/auth-context.d.ts",
|
|
20
25
|
"default": "./dist/auth-context.js"
|
|
26
|
+
},
|
|
27
|
+
"./prompts": {
|
|
28
|
+
"types": "./dist/prompts.d.ts",
|
|
29
|
+
"default": "./dist/prompts.js"
|
|
30
|
+
},
|
|
31
|
+
"./resources": {
|
|
32
|
+
"types": "./dist/resources.d.ts",
|
|
33
|
+
"default": "./dist/resources.js"
|
|
21
34
|
}
|
|
22
35
|
},
|
|
23
36
|
"bin": {
|