@vidofy/mcp 0.1.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/LICENSE +21 -0
- package/README.md +151 -0
- package/dist/backend.d.ts +133 -0
- package/dist/backend.js +455 -0
- package/dist/config.d.ts +85 -0
- package/dist/config.js +207 -0
- package/dist/heartbeat.d.ts +11 -0
- package/dist/heartbeat.js +70 -0
- package/dist/http.d.ts +44 -0
- package/dist/http.js +885 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +661 -0
- package/dist/log.d.ts +19 -0
- package/dist/log.js +22 -0
- package/dist/map/b2c.d.ts +139 -0
- package/dist/map/b2c.js +236 -0
- package/dist/media-duration.d.ts +33 -0
- package/dist/media-duration.js +137 -0
- package/dist/oauth/authorize.d.ts +61 -0
- package/dist/oauth/authorize.js +275 -0
- package/dist/oauth/clients.d.ts +137 -0
- package/dist/oauth/clients.js +621 -0
- package/dist/oauth/ratelimit.d.ts +92 -0
- package/dist/oauth/ratelimit.js +116 -0
- package/dist/oauth/store.d.ts +135 -0
- package/dist/oauth/store.js +277 -0
- package/dist/oauth/token.d.ts +29 -0
- package/dist/oauth/token.js +165 -0
- package/dist/schema.d.ts +147 -0
- package/dist/schema.js +629 -0
- package/dist/tools/account.d.ts +28 -0
- package/dist/tools/account.js +130 -0
- package/dist/tools/generation.d.ts +102 -0
- package/dist/tools/generation.js +1194 -0
- package/dist/tools/info.d.ts +50 -0
- package/dist/tools/info.js +95 -0
- package/dist/ui/generation-card.html +869 -0
- package/package.json +79 -0
- package/server.json +36 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @vidofy/mcp — the Vidofy MCP server.
|
|
4
|
+
*
|
|
5
|
+
* Lets a desktop AI client (Claude Desktop, Cursor, …) generate media with
|
|
6
|
+
* Vidofy, billed to the user's own account. Runs locally over stdio; the
|
|
7
|
+
* client launches it, so nothing here listens on a port.
|
|
8
|
+
*
|
|
9
|
+
* Nine tools: list_modes → list_models → get_model to choose, estimate_cost to
|
|
10
|
+
* price it, generate to run it, get_status and get_result to follow it, plus
|
|
11
|
+
* get_balance and get_usage.
|
|
12
|
+
*
|
|
13
|
+
* Eight of the nine are read-only. `generate` is the only one that spends the
|
|
14
|
+
* user's balance, and it is the only one whose annotations say so — which is
|
|
15
|
+
* what a client reads to decide whether to ask the user first.
|
|
16
|
+
*
|
|
17
|
+
* `upload_file` is deliberately absent: /app/v1 has no upload route at all
|
|
18
|
+
* (it is /api/v1 + an API key only), so on the account door files travel
|
|
19
|
+
* multipart with the submit itself, exactly as the studio posts them. It was
|
|
20
|
+
* planned as a key-mode tool; key mode is not served (see the refusal below),
|
|
21
|
+
* so nothing would ever call it. Nine tools is the whole set, not nine of ten.
|
|
22
|
+
*
|
|
23
|
+
* WHY stdout IS OFF LIMITS
|
|
24
|
+
* ------------------------
|
|
25
|
+
* stdio transport means stdout IS the protocol channel — one stray
|
|
26
|
+
* console.log() writes a non-JSON-RPC line into the stream and the client
|
|
27
|
+
* drops the connection with an error that names nothing. Every diagnostic in
|
|
28
|
+
* this package goes to stderr, which the client shows in its logs and ignores
|
|
29
|
+
* otherwise. There is a `log()` helper below; use it and never console.log.
|
|
30
|
+
*/
|
|
31
|
+
import { Server } from '@modelcontextprotocol/server';
|
|
32
|
+
import { type Config } from './config.js';
|
|
33
|
+
import { log } from './log.js';
|
|
34
|
+
export { log };
|
|
35
|
+
/** The version from package.json, so the User-Agent cannot drift from the release. */
|
|
36
|
+
export declare function readVersion(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Build a fully wired Server for one credential — everything except the
|
|
39
|
+
* transport.
|
|
40
|
+
*
|
|
41
|
+
* Extracted from main() so the remote transport can reuse it (src/http.ts).
|
|
42
|
+
* The split matters for one reason that is easy to miss: over stdio this
|
|
43
|
+
* process serves exactly ONE account for its whole life, while over HTTP each
|
|
44
|
+
* request carries a different person's token. So the Server cannot be a
|
|
45
|
+
* module-level singleton — it is built per caller, around that caller's Config,
|
|
46
|
+
* and `cfg` being a parameter rather than a global is what makes spending the
|
|
47
|
+
* wrong account's coins impossible by construction.
|
|
48
|
+
*/
|
|
49
|
+
export declare function buildServer(cfg: Config, version: string): Server;
|