@clipform/mcp-server 1.0.0 → 1.1.3
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 +123 -87
- package/dist/lib/api-client.d.ts +5 -0
- package/dist/lib/api-client.js +47 -0
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/config.d.ts +1 -0
- package/dist/lib/config.js +63 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/prompts.d.ts +2 -0
- package/dist/prompts.js +123 -0
- package/dist/prompts.js.map +1 -0
- package/dist/server.js +45 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/attach-question-audio.d.ts +2 -0
- package/dist/tools/attach-question-audio.js +37 -0
- package/dist/tools/attach-question-audio.js.map +1 -0
- package/dist/tools/delete-question-media.d.ts +2 -0
- package/dist/tools/delete-question-media.js +29 -0
- package/dist/tools/delete-question-media.js.map +1 -0
- package/dist/tools/generate-slideshow.d.ts +2 -0
- package/dist/tools/generate-slideshow.js +52 -0
- package/dist/tools/generate-slideshow.js.map +1 -0
- package/dist/tools/generate-tts.d.ts +2 -0
- package/dist/tools/generate-tts.js +48 -0
- package/dist/tools/generate-tts.js.map +1 -0
- package/dist/tools/get-daily-content.d.ts +2 -0
- package/dist/tools/get-daily-content.js +66 -0
- package/dist/tools/get-daily-content.js.map +1 -0
- package/dist/tools/get-question-media.d.ts +2 -0
- package/dist/tools/get-question-media.js +39 -0
- package/dist/tools/get-question-media.js.map +1 -0
- package/dist/tools/get-trivia.d.ts +2 -0
- package/dist/tools/get-trivia.js +49 -0
- package/dist/tools/get-trivia.js.map +1 -0
- package/dist/tools/log-generation.d.ts +2 -0
- package/dist/tools/log-generation.js +34 -0
- package/dist/tools/log-generation.js.map +1 -0
- package/dist/tools/lookup-country.d.ts +2 -0
- package/dist/tools/lookup-country.js +38 -0
- package/dist/tools/lookup-country.js.map +1 -0
- package/dist/tools/search-images.d.ts +2 -0
- package/dist/tools/search-images.js +36 -0
- package/dist/tools/search-images.js.map +1 -0
- package/dist/tools/search-knowledge.d.ts +2 -0
- package/dist/tools/search-knowledge.js +40 -0
- package/dist/tools/search-knowledge.js.map +1 -0
- package/dist/tools/search-news.d.ts +2 -0
- package/dist/tools/search-news.js +38 -0
- package/dist/tools/search-news.js.map +1 -0
- package/dist/tools/search-videos.d.ts +2 -0
- package/dist/tools/search-videos.js +37 -0
- package/dist/tools/search-videos.js.map +1 -0
- package/dist/tools/set-question-logic.d.ts +2 -0
- package/dist/tools/set-question-logic.js +54 -0
- package/dist/tools/set-question-logic.js.map +1 -0
- package/dist/tools/upload-question-media.d.ts +2 -0
- package/dist/tools/upload-question-media.js +41 -0
- package/dist/tools/upload-question-media.js.map +1 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,87 +1,123 @@
|
|
|
1
|
-
# @clipform/mcp-server
|
|
2
|
-
|
|
3
|
-
MCP server for [Clipform](https://clipform.io) - build and manage video-style forms from Claude Code, Claude Desktop, or any MCP client.
|
|
4
|
-
|
|
5
|
-
## Quick Start
|
|
6
|
-
|
|
7
|
-
Add to your Claude Desktop config (`claude_desktop_config.json`):
|
|
8
|
-
|
|
9
|
-
```json
|
|
10
|
-
{
|
|
11
|
-
"mcpServers": {
|
|
12
|
-
"clipform": {
|
|
13
|
-
"command": "npx",
|
|
14
|
-
"args": ["-y", "@clipform/mcp-server"]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Or for Claude Code, add to `.mcp.json`:
|
|
21
|
-
|
|
22
|
-
```json
|
|
23
|
-
{
|
|
24
|
-
"mcpServers": {
|
|
25
|
-
"clipform": {
|
|
26
|
-
"type": "stdio",
|
|
27
|
-
"command": "npx",
|
|
28
|
-
"args": ["-y", "@clipform/mcp-server"]
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## What you can do
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
|
39
|
-
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
1
|
+
# @clipform/mcp-server
|
|
2
|
+
|
|
3
|
+
MCP server for [Clipform](https://clipform.io) - build and manage video-style forms from Claude Code, Claude Desktop, or any MCP client.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
Add to your Claude Desktop config (`claude_desktop_config.json`):
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"mcpServers": {
|
|
12
|
+
"clipform": {
|
|
13
|
+
"command": "npx",
|
|
14
|
+
"args": ["-y", "@clipform/mcp-server"]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Or for Claude Code, add to `.mcp.json`:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"mcpServers": {
|
|
25
|
+
"clipform": {
|
|
26
|
+
"type": "stdio",
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": ["-y", "@clipform/mcp-server"]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## What you can do
|
|
35
|
+
|
|
36
|
+
### Form & question management
|
|
37
|
+
|
|
38
|
+
| Tool | Description |
|
|
39
|
+
|------|-------------|
|
|
40
|
+
| `clipform_create_form` | Create a new form with questions in one call |
|
|
41
|
+
| `clipform_get_form` | View a form and all its questions |
|
|
42
|
+
| `clipform_update_form` | Change title, publish status, or settings (step counter, back nav) |
|
|
43
|
+
| `clipform_delete_form` | Delete an unclaimed form |
|
|
44
|
+
| `clipform_add_question` | Add a question to an existing form |
|
|
45
|
+
| `clipform_update_question` | Update question text, type, config, or options |
|
|
46
|
+
| `clipform_delete_question` | Remove a question (logic chain auto-relinks) |
|
|
47
|
+
|
|
48
|
+
### Media & logic
|
|
49
|
+
|
|
50
|
+
| Tool | Description |
|
|
51
|
+
|------|-------------|
|
|
52
|
+
| `clipform_upload_question_media` | Attach video or image to a question |
|
|
53
|
+
| `clipform_get_question_media` | View a question's media details |
|
|
54
|
+
| `clipform_delete_question_media` | Remove media from a question |
|
|
55
|
+
| `clipform_attach_question_audio` | Attach audio to a still-image question |
|
|
56
|
+
| `clipform_set_question_logic` | Set branching logic on a question |
|
|
57
|
+
| `clipform_generate_tts` | Generate narration audio from text (Edge TTS) |
|
|
58
|
+
| `clipform_generate_slideshow` | Create a Ken Burns slideshow video from images + audio |
|
|
59
|
+
| `clipform_log_generation` | Save an audit trail for generated forms |
|
|
60
|
+
|
|
61
|
+
### Content research
|
|
62
|
+
|
|
63
|
+
| Tool | Description |
|
|
64
|
+
|------|-------------|
|
|
65
|
+
| `formgen_search_images` | Search royalty-free images (Pexels, Unsplash, Pixabay, Wikimedia, NASA, iNaturalist) |
|
|
66
|
+
| `formgen_search_videos` | Search stock video clips (Pexels, Pixabay) |
|
|
67
|
+
| `formgen_search_knowledge` | Search Wikipedia for topic research |
|
|
68
|
+
| `formgen_search_news` | Search current news (NewsAPI, The Guardian) |
|
|
69
|
+
| `formgen_get_trivia` | Get ready-made trivia questions (Open Trivia DB, 24 categories) |
|
|
70
|
+
| `formgen_lookup_country` | Look up country data (capital, population, flags, etc.) |
|
|
71
|
+
| `formgen_get_daily_content` | Get today's NASA APOD and Wikipedia featured content |
|
|
72
|
+
|
|
73
|
+
### Guided prompts
|
|
74
|
+
|
|
75
|
+
| Prompt | Description |
|
|
76
|
+
|--------|-------------|
|
|
77
|
+
| `create-quiz` | Best practices for building scored quizzes with media |
|
|
78
|
+
| `create-form` | Best practices for standard forms and surveys |
|
|
79
|
+
| `create-journo-request` | Turn a journalist's callout into a Clipform |
|
|
80
|
+
|
|
81
|
+
## Question types
|
|
82
|
+
|
|
83
|
+
- **choice** - Multiple choice with single or multiple selection
|
|
84
|
+
- **open** - Free-form text, audio, or video responses
|
|
85
|
+
- **contact** - Collect name, email, phone, company, and more
|
|
86
|
+
- **button** - Simple button for acknowledgment or navigation
|
|
87
|
+
- **binary** - Two-option choice (yes/no, true/false, this vs that)
|
|
88
|
+
- **scale** - Rating scale
|
|
89
|
+
- **external_link** - Redirect to an external URL
|
|
90
|
+
- **end_screen** - Customizable completion screen with score-based content
|
|
91
|
+
|
|
92
|
+
## Example prompt
|
|
93
|
+
|
|
94
|
+
> Create a Clipform called "Customer Feedback" with a choice question asking "How would you rate our service?" with options Excellent, Good, Fair, Poor, then an open-ended question asking "Any additional comments?", and finish with an end screen saying "Thanks for your feedback!"
|
|
95
|
+
|
|
96
|
+
## Configuration
|
|
97
|
+
|
|
98
|
+
By default the server connects to `https://api.clipform.io`. To point at a local dev server:
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"mcpServers": {
|
|
103
|
+
"clipform": {
|
|
104
|
+
"command": "npx",
|
|
105
|
+
"args": ["-y", "@clipform/mcp-server"],
|
|
106
|
+
"env": {
|
|
107
|
+
"SERVER_URL": "http://localhost:3003"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## How it works
|
|
115
|
+
|
|
116
|
+
When you create a form, you get back an `edit_token` that authorizes all subsequent changes. The token works until the form is claimed by a user via the claim URL.
|
|
117
|
+
|
|
118
|
+
Forms are created with a start node and end screen automatically - you just add the questions in between.
|
|
119
|
+
|
|
120
|
+
## Links
|
|
121
|
+
|
|
122
|
+
- [Clipform](https://clipform.io) - Create interactive video forms
|
|
123
|
+
- [Documentation](https://clipform.io/docs)
|
package/dist/lib/api-client.d.ts
CHANGED
|
@@ -13,6 +13,11 @@ type ApiResult = {
|
|
|
13
13
|
error: string;
|
|
14
14
|
};
|
|
15
15
|
export declare function callApi(path: string, options?: ApiOptions): Promise<ApiResult>;
|
|
16
|
+
/**
|
|
17
|
+
* Call an internal API endpoint (formgen, media, etc.)
|
|
18
|
+
* Uses INTERNAL_API_KEY for auth and INTERNAL_API_URL as base.
|
|
19
|
+
*/
|
|
20
|
+
export declare function callInternalApi(path: string, options?: Omit<ApiOptions, "token">): Promise<ApiResult>;
|
|
16
21
|
export declare function errorResult(message: string): {
|
|
17
22
|
content: {
|
|
18
23
|
type: "text";
|
package/dist/lib/api-client.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const DASHBOARD_URL = process.env.SERVER_URL || process.env.DASHBOARD_URL || "https://api.clipform.io";
|
|
2
2
|
const API_VERSION = "v1";
|
|
3
|
+
const INTERNAL_API_URL = process.env.INTERNAL_API_URL || DASHBOARD_URL;
|
|
4
|
+
const INTERNAL_API_KEY = process.env.INTERNAL_API_KEY || "";
|
|
3
5
|
export async function callApi(path, options = {}) {
|
|
4
6
|
const { method = "GET", body, params, token } = options;
|
|
5
7
|
let url = `${DASHBOARD_URL}/${API_VERSION}${path}`;
|
|
@@ -42,6 +44,51 @@ export async function callApi(path, options = {}) {
|
|
|
42
44
|
}
|
|
43
45
|
return { ok: true, data };
|
|
44
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Call an internal API endpoint (formgen, media, etc.)
|
|
49
|
+
* Uses INTERNAL_API_KEY for auth and INTERNAL_API_URL as base.
|
|
50
|
+
*/
|
|
51
|
+
export async function callInternalApi(path, options = {}) {
|
|
52
|
+
const { method = "POST", body, params } = options;
|
|
53
|
+
let url = `${INTERNAL_API_URL}${path}`;
|
|
54
|
+
if (params) {
|
|
55
|
+
const searchParams = new URLSearchParams(params);
|
|
56
|
+
url += `?${searchParams.toString()}`;
|
|
57
|
+
}
|
|
58
|
+
const headers = {
|
|
59
|
+
"Content-Type": "application/json",
|
|
60
|
+
};
|
|
61
|
+
if (INTERNAL_API_KEY) {
|
|
62
|
+
headers["Authorization"] = `Bearer ${INTERNAL_API_KEY}`;
|
|
63
|
+
}
|
|
64
|
+
const fetchOptions = { method, headers };
|
|
65
|
+
if (body && method !== "GET") {
|
|
66
|
+
fetchOptions.body = JSON.stringify(body);
|
|
67
|
+
}
|
|
68
|
+
let response;
|
|
69
|
+
try {
|
|
70
|
+
response = await fetch(url, fetchOptions);
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
return {
|
|
74
|
+
ok: false,
|
|
75
|
+
status: 0,
|
|
76
|
+
error: `Failed to connect to internal API at ${url}.\n\nError: ${err instanceof Error ? err.message : String(err)}`,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
if (response.status === 204) {
|
|
80
|
+
return { ok: true, data: {} };
|
|
81
|
+
}
|
|
82
|
+
const data = await response.json();
|
|
83
|
+
if (!response.ok) {
|
|
84
|
+
return {
|
|
85
|
+
ok: false,
|
|
86
|
+
status: response.status,
|
|
87
|
+
error: data.error || `Internal API error (${response.status})`,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
return { ok: true, data };
|
|
91
|
+
}
|
|
45
92
|
export function errorResult(message) {
|
|
46
93
|
return {
|
|
47
94
|
content: [{ type: "text", text: message }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/lib/api-client.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GACjB,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,yBAAyB,CAAC;AACnF,MAAM,WAAW,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/lib/api-client.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GACjB,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,yBAAyB,CAAC;AACnF,MAAM,WAAW,GAAG,IAAI,CAAC;AAEzB,MAAM,gBAAgB,GACpB,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,aAAa,CAAC;AAChD,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC;AAa5D,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,IAAY,EACZ,UAAsB,EAAE;IAExB,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAExD,IAAI,GAAG,GAAG,GAAG,aAAa,IAAI,WAAW,GAAG,IAAI,EAAE,CAAC;IACnD,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;QACjD,GAAG,IAAI,IAAI,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC;IACvC,CAAC;IAED,MAAM,OAAO,GAA2B;QACtC,cAAc,EAAE,kBAAkB;KACnC,CAAC;IACF,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,KAAK,EAAE,CAAC;IAC/C,CAAC;IAED,MAAM,YAAY,GAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAEtD,IAAI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YACvB,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,uBAAuB,QAAQ,CAAC,MAAM,GAAG;SAC/D,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QACnD,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC;KAC3C,CAAC;AACJ,CAAC"}
|
package/dist/lib/config.d.ts
CHANGED
package/dist/lib/config.js
CHANGED
|
@@ -12,6 +12,7 @@ export const ANSWER_TYPES = {
|
|
|
12
12
|
is_active: true,
|
|
13
13
|
is_system: false,
|
|
14
14
|
has_options: true,
|
|
15
|
+
max_option_length: 36,
|
|
15
16
|
config_schema: {
|
|
16
17
|
type: "object",
|
|
17
18
|
properties: {
|
|
@@ -137,12 +138,43 @@ export const ANSWER_TYPES = {
|
|
|
137
138
|
},
|
|
138
139
|
},
|
|
139
140
|
},
|
|
141
|
+
binary: {
|
|
142
|
+
label: "Binary",
|
|
143
|
+
description: "Two-option choice - yes/no, true/false, or this vs that",
|
|
144
|
+
is_active: true,
|
|
145
|
+
is_system: false,
|
|
146
|
+
has_options: true,
|
|
147
|
+
max_option_length: 12,
|
|
148
|
+
config_schema: {
|
|
149
|
+
type: "object",
|
|
150
|
+
properties: {
|
|
151
|
+
choice: {
|
|
152
|
+
type: "object",
|
|
153
|
+
properties: {
|
|
154
|
+
enable_branching: {
|
|
155
|
+
type: "boolean",
|
|
156
|
+
label: "Enable branching logic",
|
|
157
|
+
default: true,
|
|
158
|
+
description: "Allow each option to have its own logic path.",
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
content_media_type: {
|
|
163
|
+
enum: ["upload", "recorded"],
|
|
164
|
+
type: "string",
|
|
165
|
+
label: "Content media type",
|
|
166
|
+
description: "How the question media was provided",
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
},
|
|
140
171
|
button: {
|
|
141
172
|
label: "Button",
|
|
142
173
|
description: "Simple button for acknowledgment or navigation",
|
|
143
174
|
is_active: true,
|
|
144
175
|
is_system: false,
|
|
145
176
|
has_options: true,
|
|
177
|
+
max_option_length: 28,
|
|
146
178
|
config_schema: {
|
|
147
179
|
type: "object",
|
|
148
180
|
properties: {
|
|
@@ -248,6 +280,37 @@ export const ANSWER_TYPES = {
|
|
|
248
280
|
label: "Restart button text",
|
|
249
281
|
default: "Start over",
|
|
250
282
|
},
|
|
283
|
+
score_ranges: {
|
|
284
|
+
type: "array",
|
|
285
|
+
label: "Score-based content",
|
|
286
|
+
description: "Show different content based on cumulative score. First matching range wins.",
|
|
287
|
+
items: {
|
|
288
|
+
type: "object",
|
|
289
|
+
required: ["min", "max", "title"],
|
|
290
|
+
properties: {
|
|
291
|
+
min: { type: "integer", label: "Minimum score (inclusive)" },
|
|
292
|
+
max: { type: "integer", label: "Maximum score (inclusive)" },
|
|
293
|
+
title: { type: "string", label: "Title" },
|
|
294
|
+
message: { type: "string", label: "Message" },
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
scoring_results: {
|
|
299
|
+
type: "array",
|
|
300
|
+
label: "Category-based results",
|
|
301
|
+
description: "Results keyed by scoring category. The winning category (highest non-knocked-out score) determines which result is shown.",
|
|
302
|
+
items: {
|
|
303
|
+
type: "object",
|
|
304
|
+
required: ["category", "title"],
|
|
305
|
+
properties: {
|
|
306
|
+
category: { type: "string", label: "Category key (must match keys used in option scores)" },
|
|
307
|
+
title: { type: "string", label: "Title" },
|
|
308
|
+
message: { type: "string", label: "Message" },
|
|
309
|
+
cta_url: { type: "string", label: "CTA URL", format: "uri" },
|
|
310
|
+
cta_text: { type: "string", label: "CTA button text" },
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
},
|
|
251
314
|
},
|
|
252
315
|
},
|
|
253
316
|
},
|
package/dist/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoBH,MAAM,CAAC,MAAM,YAAY,GAAyC;IAChE,MAAM,EAAE;QACN,KAAK,EAAE,iBAAiB;QACxB,WAAW,EACT,6DAA6D;QAC/D,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,IAAI;QACjB,iBAAiB,EAAE,EAAE;QACrB,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,gBAAgB,EAAE;4BAChB,IAAI,EAAE,SAAS;4BACf,KAAK,EAAE,wBAAwB;4BAC/B,OAAO,EAAE,IAAI;4BACb,WAAW,EACT,sGAAsG;yBACzG;qBACF;iBACF;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;oBAC5B,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,gBAAgB;oBACvB,OAAO,EAAE,QAAQ;oBACjB,WAAW,EAAE,qCAAqC;iBACnD;gBACD,mBAAmB,EAAE;oBACnB,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE,qBAAqB;oBAC5B,OAAO,EAAE,KAAK;oBACd,WAAW,EACT,sEAAsE;iBACzE;gBACD,iBAAiB,EAAE;oBACjB,IAAI,EAAE,SAAS;oBACf,KA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EAAE;IACxF,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,EAAE;IACzF,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,KAAK,EAAE,CAAC,EAAE;IAC9F,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,kCAAkC,EAAE,KAAK,EAAE,CAAC,EAAE;IACrH,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC,EAAE;CAChG,CAAC"}
|
package/dist/prompts.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export function registerPrompts(server) {
|
|
2
|
+
server.registerPrompt("create-quiz", {
|
|
3
|
+
title: "Quiz Creation Guide",
|
|
4
|
+
description: "Best practices and defaults for creating a quiz with Clipform",
|
|
5
|
+
}, async () => ({
|
|
6
|
+
messages: [
|
|
7
|
+
{
|
|
8
|
+
role: "user",
|
|
9
|
+
content: { type: "text", text: "How should I create a quiz?" },
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
role: "assistant",
|
|
13
|
+
content: {
|
|
14
|
+
type: "text",
|
|
15
|
+
text: `When creating a quiz (knowledge questions with correct/wrong answers):
|
|
16
|
+
|
|
17
|
+
**Form settings** (set via clipform_update_form after creation):
|
|
18
|
+
- show_step_counter: true (shows "1/5" progress)
|
|
19
|
+
- disable_back_navigation: true (no going back to change answers)
|
|
20
|
+
|
|
21
|
+
**Question defaults:**
|
|
22
|
+
- Randomise answer options (set randomise_options: true in config)
|
|
23
|
+
- 3-4 wrong answers per question for good difficulty
|
|
24
|
+
- One clearly correct answer
|
|
25
|
+
|
|
26
|
+
**Scoring:**
|
|
27
|
+
- Set score: 1 on the correct answer option, score: 0 on wrong answers
|
|
28
|
+
- This enables automatic score tracking throughout the quiz
|
|
29
|
+
|
|
30
|
+
**Media workflow (if the user wants video):**
|
|
31
|
+
1. clipform_generate_tts - generate narration audio for each question
|
|
32
|
+
2. formgen_search_images - find 3 images per question
|
|
33
|
+
3. clipform_generate_slideshow - create Ken Burns video from images + audio
|
|
34
|
+
4. clipform_upload_media - attach video to question (include captions from TTS for subtitles)
|
|
35
|
+
|
|
36
|
+
**Image selection:**
|
|
37
|
+
- ONLY use image URLs from formgen_search_images results. These are quality-filtered and high-res.
|
|
38
|
+
|
|
39
|
+
**Narration style:**
|
|
40
|
+
- The TTS narration should only read the question - do NOT repeat the answer options verbally. The options are displayed on screen for the user to read and tap.
|
|
41
|
+
- Keep narration concise and conversational. Add a brief interesting fact or context if it fits naturally.
|
|
42
|
+
|
|
43
|
+
**Audit log (final step):**
|
|
44
|
+
After building the quiz, call clipform_log_generation with:
|
|
45
|
+
- summary of what was built
|
|
46
|
+
- sources used for research (Wikipedia articles, URLs)
|
|
47
|
+
- images used with attribution and license
|
|
48
|
+
|
|
49
|
+
**Before building, ask the user:**
|
|
50
|
+
1. How many questions?
|
|
51
|
+
2. Media style: text only, still images, or slideshow video with narration?
|
|
52
|
+
3. Any topic or style preferences?`,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
}));
|
|
57
|
+
server.registerPrompt("create-form", {
|
|
58
|
+
title: "Form Creation Guide",
|
|
59
|
+
description: "Best practices for creating a standard form or survey with Clipform",
|
|
60
|
+
}, async () => ({
|
|
61
|
+
messages: [
|
|
62
|
+
{
|
|
63
|
+
role: "user",
|
|
64
|
+
content: { type: "text", text: "How should I create a form?" },
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
role: "assistant",
|
|
68
|
+
content: {
|
|
69
|
+
type: "text",
|
|
70
|
+
text: `When creating a standard form or survey:
|
|
71
|
+
|
|
72
|
+
**Form settings:**
|
|
73
|
+
- Back navigation is enabled by default (respondents can review answers)
|
|
74
|
+
- Step counter is off by default (optional, enable for longer forms)
|
|
75
|
+
|
|
76
|
+
**Common patterns:**
|
|
77
|
+
- Use "contact" type for collecting user details (name, email, etc.)
|
|
78
|
+
- Use "open" type for free-text responses
|
|
79
|
+
- Use "choice" type for multiple choice / single select
|
|
80
|
+
- End with an "end_screen" type for a thank you message
|
|
81
|
+
|
|
82
|
+
**Media:** Forms can have video or image backgrounds on each question. Use clipform_upload_media to attach media after creation.`,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
}));
|
|
87
|
+
server.registerPrompt("create-journo-request", {
|
|
88
|
+
title: "Journalist Request Guide",
|
|
89
|
+
description: "Best practices for turning a journalist's callout into a Clipform",
|
|
90
|
+
}, async () => ({
|
|
91
|
+
messages: [
|
|
92
|
+
{
|
|
93
|
+
role: "user",
|
|
94
|
+
content: { type: "text", text: "How should I create a journalist request form?" },
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
role: "assistant",
|
|
98
|
+
content: {
|
|
99
|
+
type: "text",
|
|
100
|
+
text: `When a journalist pastes their callout/request text, turn it into a Clipform. The form replaces "DM me" or "email me" with a shareable link.
|
|
101
|
+
|
|
102
|
+
**Form structure (in order):**
|
|
103
|
+
1. **Open question** - The core ask from the journalist's text. Use "open" type. Default to text + audio + video responses.
|
|
104
|
+
2. **Additional short questions** (optional) - Only for distinct secondary asks. Don't over-split.
|
|
105
|
+
3. **Contact collection** - Always include. Minimum: first_name and email.
|
|
106
|
+
4. **Consent checkbox** - "I agree that my response may be used in published media coverage."
|
|
107
|
+
5. **End screen** - "Thanks for your response. The journalist will be in touch if they'd like to take things further."
|
|
108
|
+
|
|
109
|
+
**Form settings:**
|
|
110
|
+
- disable_back_navigation: false
|
|
111
|
+
- show_step_counter: true
|
|
112
|
+
|
|
113
|
+
**Two modes:**
|
|
114
|
+
- One-shot: build immediately with sensible defaults when asked directly
|
|
115
|
+
- Dialogue: ask about video-only/format and extra fields, show wireframe preview first
|
|
116
|
+
|
|
117
|
+
Default to dialogue mode unless explicitly asked for one-shot.`,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,MAAM,CAAC,cAAc,CACnB,aAAa,EACb;QACE,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,+DAA+D;KAC7E,EACD,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,6BAA6B,EAAE;aACxE;YACD;gBACE,IAAI,EAAE,WAAoB;gBAC1B,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAqCiB;iBACxB;aACF;SACF;KACF,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,cAAc,CACnB,aAAa,EACb;QACE,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,qEAAqE;KACnF,EACD,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,6BAA6B,EAAE;aACxE;YACD;gBACE,IAAI,EAAE,WAAoB;gBAC1B,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE;;;;;;;;;;;;iIAY+G;iBACtH;aACF;SACF;KACF,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,cAAc,CACnB,uBAAuB,EACvB;QACE,KAAK,EAAE,0BAA0B;QACjC,WAAW,EAAE,mEAAmE;KACjF,EACD,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,gDAAgD,EAAE;aAC3F;YACD;gBACE,IAAI,EAAE,WAAoB;gBAC1B,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE;;;;;;;;;;;;;;;;;+DAiB6C;iBACpD;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -1,23 +1,67 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
// Form CRUD tools
|
|
2
3
|
import { registerCreateFormTool } from "./tools/create-form.js";
|
|
3
4
|
import { registerGetFormTool } from "./tools/get-form.js";
|
|
4
5
|
import { registerUpdateFormTool } from "./tools/update-form.js";
|
|
5
6
|
import { registerDeleteFormTool } from "./tools/delete-form.js";
|
|
7
|
+
// Question CRUD tools
|
|
6
8
|
import { registerAddQuestionTool } from "./tools/add-question.js";
|
|
7
9
|
import { registerUpdateQuestionTool } from "./tools/update-question.js";
|
|
8
10
|
import { registerDeleteQuestionTool } from "./tools/delete-question.js";
|
|
11
|
+
// Media management tools
|
|
12
|
+
import { registerUploadQuestionMediaTool } from "./tools/upload-question-media.js";
|
|
13
|
+
import { registerGetQuestionMediaTool } from "./tools/get-question-media.js";
|
|
14
|
+
import { registerDeleteQuestionMediaTool } from "./tools/delete-question-media.js";
|
|
15
|
+
import { registerSetQuestionLogicTool } from "./tools/set-question-logic.js";
|
|
16
|
+
import { registerAttachQuestionAudioTool } from "./tools/attach-question-audio.js";
|
|
17
|
+
// Core media generation tools
|
|
18
|
+
import { registerGenerateTtsTool } from "./tools/generate-tts.js";
|
|
19
|
+
import { registerGenerateSlideshowTool } from "./tools/generate-slideshow.js";
|
|
20
|
+
import { registerLogGenerationTool } from "./tools/log-generation.js";
|
|
21
|
+
// FormGen content research tools
|
|
22
|
+
import { registerSearchImagesTool } from "./tools/search-images.js";
|
|
23
|
+
import { registerSearchVideosTool } from "./tools/search-videos.js";
|
|
24
|
+
import { registerSearchKnowledgeTool } from "./tools/search-knowledge.js";
|
|
25
|
+
import { registerSearchNewsTool } from "./tools/search-news.js";
|
|
26
|
+
import { registerGetTriviaTool } from "./tools/get-trivia.js";
|
|
27
|
+
import { registerLookupCountryTool } from "./tools/lookup-country.js";
|
|
28
|
+
import { registerGetDailyContentTool } from "./tools/get-daily-content.js";
|
|
29
|
+
// Prompts
|
|
30
|
+
import { registerPrompts } from "./prompts.js";
|
|
9
31
|
export function createServer() {
|
|
10
32
|
const server = new McpServer({
|
|
11
33
|
name: "clipform-mcp-server",
|
|
12
|
-
version: "1.
|
|
34
|
+
version: "1.1.0",
|
|
13
35
|
});
|
|
36
|
+
// Form CRUD
|
|
14
37
|
registerCreateFormTool(server);
|
|
15
38
|
registerGetFormTool(server);
|
|
16
39
|
registerUpdateFormTool(server);
|
|
17
40
|
registerDeleteFormTool(server);
|
|
41
|
+
// Question CRUD
|
|
18
42
|
registerAddQuestionTool(server);
|
|
19
43
|
registerUpdateQuestionTool(server);
|
|
20
44
|
registerDeleteQuestionTool(server);
|
|
45
|
+
// Media management
|
|
46
|
+
registerUploadQuestionMediaTool(server);
|
|
47
|
+
registerGetQuestionMediaTool(server);
|
|
48
|
+
registerDeleteQuestionMediaTool(server);
|
|
49
|
+
registerSetQuestionLogicTool(server);
|
|
50
|
+
registerAttachQuestionAudioTool(server);
|
|
51
|
+
// Core media generation
|
|
52
|
+
registerGenerateTtsTool(server);
|
|
53
|
+
registerGenerateSlideshowTool(server);
|
|
54
|
+
registerLogGenerationTool(server);
|
|
55
|
+
// FormGen content research
|
|
56
|
+
registerSearchImagesTool(server);
|
|
57
|
+
registerSearchVideosTool(server);
|
|
58
|
+
registerSearchKnowledgeTool(server);
|
|
59
|
+
registerSearchNewsTool(server);
|
|
60
|
+
registerGetTriviaTool(server);
|
|
61
|
+
registerLookupCountryTool(server);
|
|
62
|
+
registerGetDailyContentTool(server);
|
|
63
|
+
// Prompts
|
|
64
|
+
registerPrompts(server);
|
|
21
65
|
return server;
|
|
22
66
|
}
|
|
23
67
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,kBAAkB;AAClB,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,sBAAsB;AACtB,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAExE,yBAAyB;AACzB,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EA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