@moda-ai/cli 1.0.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/dist/worker.js ADDED
@@ -0,0 +1,24 @@
1
+ // src/worker.ts
2
+ // Cloudflare Workers entry point for the MCP HTTP/SSE transport.
3
+ //
4
+ // NOTE: The MCP SDK's SSEServerTransport expects an Express Response object,
5
+ // which is incompatible with the Cloudflare Workers fetch handler model.
6
+ // Full SSE support requires either the MCP SDK's StreamableHTTPServerTransport
7
+ // or a custom adapter. This file provides the skeleton and a /health endpoint
8
+ // that works today; SSE transport implementation is tracked as a follow-up.
9
+ import { getToolDefinitions } from './tools.js';
10
+ export default {
11
+ async fetch(request, env) {
12
+ const url = new URL(request.url);
13
+ if (url.pathname === '/health') {
14
+ return new Response(JSON.stringify({ status: 'ok', service: 'moda-mcp' }), { headers: { 'Content-Type': 'application/json' } });
15
+ }
16
+ if (url.pathname === '/tools' && request.method === 'GET') {
17
+ return new Response(JSON.stringify({ tools: getToolDefinitions() }), { headers: { 'Content-Type': 'application/json' } });
18
+ }
19
+ // SSE/MCP streaming transport handling is deferred pending SDK compatibility
20
+ // investigation. See Phase 3 open question in implementation plan.
21
+ return new Response('Not Found', { status: 404 });
22
+ },
23
+ };
24
+ //# sourceMappingURL=worker.js.map
@@ -0,0 +1,12 @@
1
+ {
2
+ "mcpServers": {
3
+ "moda-data-api": {
4
+ "command": "node",
5
+ "args": ["/absolute/path/to/apps/moda-cli/dist/index.js"],
6
+ "env": {
7
+ "MODA_API_KEY": "moda_sk_your_api_key_here"
8
+ },
9
+ "comment": "Uses production API (https://modaflows.com) by default. For local dev, add: \"MODA_BASE_URL\": \"http://localhost:3001\""
10
+ }
11
+ }
12
+ }
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@moda-ai/cli",
3
+ "version": "1.0.0",
4
+ "description": "CLI and MCP server for Moda - AI agent analytics and observability",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "moda-mcp": "./dist/index.js",
9
+ "moda": "./dist/cli.js"
10
+ },
11
+ "files": [
12
+ "dist/**/*.js",
13
+ "dist/**/*.d.ts",
14
+ "!dist/__tests__",
15
+ "README.md",
16
+ ".env.example",
17
+ "mcp-config.example.json"
18
+ ],
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "scripts": {
23
+ "build": "tsc",
24
+ "prepublishOnly": "npm run build",
25
+ "dev": "tsc --watch",
26
+ "start": "node dist/index.js",
27
+ "start:http": "node dist/http-server.js",
28
+ "typecheck": "tsc --noEmit",
29
+ "test": "vitest run",
30
+ "test:ci": "vitest run",
31
+ "test:watch": "vitest",
32
+ "test:e2e": "npm run build && vitest run e2e"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/ModaLabs/moda-cli.git"
37
+ },
38
+ "keywords": [
39
+ "moda",
40
+ "llm",
41
+ "observability",
42
+ "mcp",
43
+ "cli",
44
+ "analytics",
45
+ "ai-agents"
46
+ ],
47
+ "author": "Moda <hello@modaflows.com>",
48
+ "license": "MIT",
49
+ "homepage": "https://docs.modaflows.com/data-api/cli",
50
+ "bugs": {
51
+ "url": "https://github.com/ModaLabs/moda-cli/issues"
52
+ },
53
+ "dependencies": {
54
+ "@modelcontextprotocol/sdk": "^1.0.4",
55
+ "cors": "^2.8.5",
56
+ "express": "^4.21.2",
57
+ "zod": "^3.24.1"
58
+ },
59
+ "devDependencies": {
60
+ "@types/cors": "^2.8.19",
61
+ "@types/express": "^5.0.6",
62
+ "@types/node": "^22.10.5",
63
+ "typescript": "^5.7.2",
64
+ "vitest": "^3.0.0"
65
+ },
66
+ "engines": {
67
+ "node": ">=18.0.0"
68
+ }
69
+ }