@clipy/mcp 0.14.0 → 0.15.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/dist/index.js +75 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -64,7 +64,7 @@ const CLI_CONFIG = readCliConfig();
|
|
|
64
64
|
const API_URL = (process.env.CLIPY_API_URL || CLI_CONFIG.apiUrl || "https://clipy.online").replace(/\/+$/, "");
|
|
65
65
|
const API_KEY = process.env.CLIPY_API_KEY || CLI_CONFIG.apiKey;
|
|
66
66
|
const API_KEY_SOURCE = process.env.CLIPY_API_KEY ? "env CLIPY_API_KEY" : CLI_CONFIG.apiKey ? cliConfigPath() : null;
|
|
67
|
-
const SERVER_VERSION = "0.
|
|
67
|
+
const SERVER_VERSION = "0.15.1";
|
|
68
68
|
/** Every keyless failure points at the same two fixes, cheapest one first. */
|
|
69
69
|
const MISSING_KEY_MESSAGE = `No Clipy credential. Run \`clipy login\` in a terminal — it writes ${cliConfigPath()}, which this server reads — ` +
|
|
70
70
|
`or mint a key at ${API_URL}/settings/api-keys and set CLIPY_API_KEY in your MCP client config. ` +
|
|
@@ -94,7 +94,7 @@ function actionableApiError(status, message, path) {
|
|
|
94
94
|
case 401:
|
|
95
95
|
return `${message} (HTTP 401 — the Clipy credential ${API_KEY_SOURCE ? `read from ${API_KEY_SOURCE}` : "is missing and"} is invalid, expired, or revoked.) Fix it, then retry: run \`clipy login\` in a terminal to approve this device (it writes ${cliConfigPath()}, which this server reads), or mint a key at ${API_URL}/settings/api-keys and set CLIPY_API_KEY in your MCP client config. Either way the credential is read at startup, so restart the MCP client afterwards. Retrying this call unchanged will fail identically.`;
|
|
96
96
|
case 403:
|
|
97
|
-
return `${message} (HTTP 403 — the API key is valid but lacks the scope this call needs, or the resource belongs to another account.) Write tools need a key with the "ingest" permission; mint one at ${API_URL}/settings/api-keys. Retrying with the same key cannot succeed.`;
|
|
97
|
+
return `${message} (HTTP 403 — the API key is valid but lacks the scope this call needs, or the resource belongs to another account.) ${/\/edit(\?|$)/.test(path) ? 'Video editing (get_edit_transcript, edit_recording) needs a key with the "recordings:write" permission' : 'Write tools need a key with the "ingest" permission'}; mint one at ${API_URL}/settings/api-keys. Retrying with the same key cannot succeed.`;
|
|
98
98
|
case 404:
|
|
99
99
|
return `${message} (HTTP 404.) ${notFoundHint}`;
|
|
100
100
|
case 429:
|
|
@@ -253,8 +253,11 @@ async function apiPostJson(path, payload, method = "POST") {
|
|
|
253
253
|
if (!res.ok) {
|
|
254
254
|
const msg = (typeof body.error === "string" && body.error) || `Clipy API error ${res.status}`;
|
|
255
255
|
if (res.status === 403) {
|
|
256
|
-
throw new Error(
|
|
257
|
-
|
|
256
|
+
throw new Error(/\/edit$/.test(path)
|
|
257
|
+
? `${msg}\nedit_recording needs an API key with the "recordings:write" permission. ` +
|
|
258
|
+
`Mint one at ${API_URL}/settings/api-keys.`
|
|
259
|
+
: `${msg}\nThe record tool needs an API key with the "ingest" permission. ` +
|
|
260
|
+
`Mint one at ${API_URL}/settings/api-keys (check "Record & upload").`);
|
|
258
261
|
}
|
|
259
262
|
throw new Error(msg);
|
|
260
263
|
}
|
|
@@ -1105,6 +1108,74 @@ server.tool("get_transcript", "Get a recording's full transcript: timestamped se
|
|
|
1105
1108
|
return fail(e.message);
|
|
1106
1109
|
}
|
|
1107
1110
|
});
|
|
1111
|
+
server.tool("get_edit_transcript", "Read a recording the way edit_recording edits it: every spoken word with its index, start and end in ms on the ORIGINAL recording's timeline, a `filler` flag on hesitations (um, uh, er, hmm), and `removed` on words the current version already cuts. Also returns the current cuts and the revision to pass to edit_recording. Words come in pages of up to 1,500; when transcript.nextFromWord is not null, call again with fromWord. When approximateWordTimings is true, cut whole sentences rather than single words. Needs the 'recordings:write' scope, because it includes the text of words the owner cut.", {
|
|
1112
|
+
id: recordingIdSchema,
|
|
1113
|
+
fromWord: z.number().int().min(0).optional().describe("First word index to return (default 0)."),
|
|
1114
|
+
limit: z.number().int().min(1).max(1500).optional().describe("Words per page (max 1500)."),
|
|
1115
|
+
}, async ({ id, fromWord, limit }) => {
|
|
1116
|
+
try {
|
|
1117
|
+
const query = new URLSearchParams();
|
|
1118
|
+
if (fromWord !== undefined)
|
|
1119
|
+
query.set("fromWord", String(fromWord));
|
|
1120
|
+
if (limit !== undefined)
|
|
1121
|
+
query.set("limit", String(limit));
|
|
1122
|
+
const qs = query.toString();
|
|
1123
|
+
return ok(await api(`/api/v1/recordings/${encodeURIComponent(normalizeId(id))}/edit${qs ? `?${qs}` : ""}`));
|
|
1124
|
+
}
|
|
1125
|
+
catch (e) {
|
|
1126
|
+
return fail(e.message);
|
|
1127
|
+
}
|
|
1128
|
+
});
|
|
1129
|
+
server.tool("edit_recording", "Cut parts of a recording's video by its transcript (a fumbled sentence, a tangent, dead air, or every filler word). Needs the 'recordings:write' scope. Word indexes and ms times come from get_edit_transcript and are on the ORIGINAL timeline; operations apply on top of the current cuts in this order: restoreOriginal, removeWords, removeRanges, removeFillerWords, restoreWords, restoreRanges. autoZoom: true zooms in on recorded clicks (Mac and Windows recordings). Clipy keeps the original, so a cut can be brought back unless the owner deletes the original; the transcript is generated again after each edit, replacing hand corrections. The share link stays the same and switches to the new version when rendering finishes; transcript, summary and key moments then regenerate. Run with dryRun first, show the user removedWords, and confirm before editing a recording others may be watching.", {
|
|
1130
|
+
id: recordingIdSchema,
|
|
1131
|
+
removeWords: z
|
|
1132
|
+
.array(z.object({
|
|
1133
|
+
from: z.number().int().min(0),
|
|
1134
|
+
to: z.number().int().min(0).optional().describe("Defaults to from (one word)."),
|
|
1135
|
+
}))
|
|
1136
|
+
.max(500)
|
|
1137
|
+
.optional()
|
|
1138
|
+
.describe("Word index ranges to cut, inclusive."),
|
|
1139
|
+
removeRanges: z
|
|
1140
|
+
.array(z.object({ startMs: z.number().int().min(0), endMs: z.number().int().min(1) }))
|
|
1141
|
+
.max(500)
|
|
1142
|
+
.optional()
|
|
1143
|
+
.describe("Time ranges to cut, ms on the original timeline."),
|
|
1144
|
+
removeFillerWords: z.boolean().optional().describe("Cut every um, uh, er and hmm."),
|
|
1145
|
+
restoreWords: z
|
|
1146
|
+
.array(z.object({
|
|
1147
|
+
from: z.number().int().min(0),
|
|
1148
|
+
to: z.number().int().min(0).optional().describe("Defaults to from (one word)."),
|
|
1149
|
+
}))
|
|
1150
|
+
.max(500)
|
|
1151
|
+
.optional()
|
|
1152
|
+
.describe("Word index ranges to bring back, inclusive."),
|
|
1153
|
+
restoreRanges: z
|
|
1154
|
+
.array(z.object({ startMs: z.number().int().min(0), endMs: z.number().int().min(1) }))
|
|
1155
|
+
.max(500)
|
|
1156
|
+
.optional()
|
|
1157
|
+
.describe("Time ranges to bring back, ms on the original timeline."),
|
|
1158
|
+
restoreOriginal: z.boolean().optional().describe("Drop every cut before applying the rest."),
|
|
1159
|
+
autoZoom: z
|
|
1160
|
+
.boolean()
|
|
1161
|
+
.optional()
|
|
1162
|
+
.describe("Zoom in on recorded clicks, up to 40 zooms (Mac and Windows recordings only); omit to keep the current setting."),
|
|
1163
|
+
expectedRevision: z
|
|
1164
|
+
.number()
|
|
1165
|
+
.int()
|
|
1166
|
+
.min(0)
|
|
1167
|
+
.optional()
|
|
1168
|
+
.describe("Revision from get_edit_transcript; refused if the recording changed since."),
|
|
1169
|
+
dryRun: z.boolean().optional().describe("Return the plan without changing anything."),
|
|
1170
|
+
}, async ({ id, ...operations }) => {
|
|
1171
|
+
try {
|
|
1172
|
+
const pid = encodeURIComponent(normalizeId(id));
|
|
1173
|
+
return ok(await apiPostJson(`/api/v1/recordings/${pid}/edit`, operations));
|
|
1174
|
+
}
|
|
1175
|
+
catch (e) {
|
|
1176
|
+
return fail(e.message);
|
|
1177
|
+
}
|
|
1178
|
+
});
|
|
1108
1179
|
server.tool("get_summary", "Get a recording's AI summary: a TL;DR, key points, and any action items. If it isn't ready yet, returns the current status.", { id: recordingIdSchema }, async ({ id }) => {
|
|
1109
1180
|
try {
|
|
1110
1181
|
return ok(await api(`/api/v1/recordings/${encodeURIComponent(normalizeId(id))}/summary`));
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clipy/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"mcpName": "online.clipy/mcp",
|
|
5
|
-
"description": "Model Context Protocol (MCP) server for Clipy
|
|
5
|
+
"description": "Model Context Protocol (MCP) server for Clipy \u2014 give Claude, Cursor, and other AI agents read access to your screen recordings' transcripts, AI summaries, and key moments with frames.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"publishConfig": {
|