@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.
@@ -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;