mcp-yoto 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 +23 -0
- package/README.md +86 -0
- package/bin/mcp-yoto.mjs +4 -0
- package/dist/auth/adapter.d.ts +33 -0
- package/dist/auth/adapter.js +131 -0
- package/dist/auth/loopback.d.ts +28 -0
- package/dist/auth/loopback.js +103 -0
- package/dist/auth/open-browser.d.ts +1 -0
- package/dist/auth/open-browser.js +43 -0
- package/dist/auth/pkce.d.ts +10 -0
- package/dist/auth/pkce.js +19 -0
- package/dist/auth/session.d.ts +37 -0
- package/dist/auth/session.js +120 -0
- package/dist/auth/token-exchange.d.ts +27 -0
- package/dist/auth/token-exchange.js +26 -0
- package/dist/auth/token-store.d.ts +69 -0
- package/dist/auth/token-store.js +151 -0
- package/dist/config.d.ts +35 -0
- package/dist/config.js +51 -0
- package/dist/main.d.ts +12 -0
- package/dist/main.js +1958 -0
- package/dist/main.js.map +1 -0
- package/dist/resolve.d.ts +18 -0
- package/dist/resolve.js +141 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.js +40 -0
- package/package.json +61 -0
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the CLI's `McpServer` (all 14 `yoto_*` tools + resources + prompts,
|
|
3
|
+
* via `@mcp-yoto/core`'s `createServer`) and serves it over stdio.
|
|
4
|
+
*
|
|
5
|
+
* `StdioServerTransport` lives at `@modelcontextprotocol/server/stdio`, NOT
|
|
6
|
+
* `@modelcontextprotocol/node` (that package is Node-specific HTTP
|
|
7
|
+
* transports for a server that speaks Streamable HTTP over `node:http` --
|
|
8
|
+
* apps/worker's Cloudflare-hosted equivalent is `@modelcontextprotocol/hono`;
|
|
9
|
+
* neither is stdio). Confirmed against the installed package's own
|
|
10
|
+
* `dist/stdio.d.mts` -- see the report handed back after this phase.
|
|
11
|
+
*/
|
|
12
|
+
import { type AuthAdapter, type Logger, type YotoClient } from "@mcp-yoto/core";
|
|
13
|
+
export interface CreateCliServerOptions {
|
|
14
|
+
auth: AuthAdapter;
|
|
15
|
+
client: YotoClient;
|
|
16
|
+
logger: Logger;
|
|
17
|
+
iconBaseUrl?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function createCliServer(options: CreateCliServerOptions): import("@modelcontextprotocol/server").McpServer;
|
|
20
|
+
/** Connects the server to the current process's stdin/stdout. Never resolves until the transport closes. */
|
|
21
|
+
export declare function runStdioServer(options: CreateCliServerOptions): Promise<void>;
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the CLI's `McpServer` (all 14 `yoto_*` tools + resources + prompts,
|
|
3
|
+
* via `@mcp-yoto/core`'s `createServer`) and serves it over stdio.
|
|
4
|
+
*
|
|
5
|
+
* `StdioServerTransport` lives at `@modelcontextprotocol/server/stdio`, NOT
|
|
6
|
+
* `@modelcontextprotocol/node` (that package is Node-specific HTTP
|
|
7
|
+
* transports for a server that speaks Streamable HTTP over `node:http` --
|
|
8
|
+
* apps/worker's Cloudflare-hosted equivalent is `@modelcontextprotocol/hono`;
|
|
9
|
+
* neither is stdio). Confirmed against the installed package's own
|
|
10
|
+
* `dist/stdio.d.mts` -- see the report handed back after this phase.
|
|
11
|
+
*/
|
|
12
|
+
import { createRequire } from "node:module";
|
|
13
|
+
import { createServer } from "@mcp-yoto/core";
|
|
14
|
+
import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
|
|
15
|
+
import { resolveAudio, resolveImage } from "./resolve.js";
|
|
16
|
+
const require = createRequire(import.meta.url);
|
|
17
|
+
const { version } = require("../package.json");
|
|
18
|
+
export function createCliServer(options) {
|
|
19
|
+
return createServer({
|
|
20
|
+
auth: options.auth,
|
|
21
|
+
client: options.client,
|
|
22
|
+
logger: options.logger,
|
|
23
|
+
iconBaseUrl: options.iconBaseUrl,
|
|
24
|
+
resolveAudio,
|
|
25
|
+
resolveImage,
|
|
26
|
+
mode: "cli",
|
|
27
|
+
}, {
|
|
28
|
+
name: "mcp-yoto",
|
|
29
|
+
version,
|
|
30
|
+
title: "Yoto (Works with Yoto)",
|
|
31
|
+
iconBaseUrl: options.iconBaseUrl,
|
|
32
|
+
websiteUrl: "https://github.com/danpillay87/mcp-yoto",
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/** Connects the server to the current process's stdin/stdout. Never resolves until the transport closes. */
|
|
36
|
+
export async function runStdioServer(options) {
|
|
37
|
+
const server = createCliServer(options);
|
|
38
|
+
const transport = new StdioServerTransport();
|
|
39
|
+
await server.connect(transport);
|
|
40
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mcp-yoto",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for Yoto -- connect your Yoto library to Claude, ChatGPT, Cursor and other MCP clients.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"bin": {
|
|
9
|
+
"mcp-yoto": "bin/mcp-yoto.mjs"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"bin",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"mcpName": "io.github.danpillay87/mcp-yoto",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/danpillay87/mcp-yoto.git",
|
|
24
|
+
"directory": "apps/cli"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/danpillay87/mcp-yoto#readme",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/danpillay87/mcp-yoto/issues"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"mcp",
|
|
32
|
+
"model-context-protocol",
|
|
33
|
+
"yoto",
|
|
34
|
+
"claude",
|
|
35
|
+
"chatgpt",
|
|
36
|
+
"audio",
|
|
37
|
+
"kids",
|
|
38
|
+
"audiobook"
|
|
39
|
+
],
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=22"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc -b && tsup",
|
|
45
|
+
"dev": "tsx src/main.ts",
|
|
46
|
+
"test": "vitest run"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@modelcontextprotocol/server": "2.0.0",
|
|
50
|
+
"zod": "4.6.4"
|
|
51
|
+
},
|
|
52
|
+
"optionalDependencies": {
|
|
53
|
+
"@napi-rs/keyring": "2.0.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@mcp-yoto/core": "0.1.0",
|
|
57
|
+
"@types/node": "24.9.2",
|
|
58
|
+
"tsup": "8.5.1",
|
|
59
|
+
"tsx": "4.23.13"
|
|
60
|
+
}
|
|
61
|
+
}
|