@vibekiln/cutline-mcp-cli 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.
Files changed (43) hide show
  1. package/Dockerfile +11 -0
  2. package/README.md +248 -0
  3. package/dist/auth/callback.d.ts +6 -0
  4. package/dist/auth/callback.js +97 -0
  5. package/dist/auth/keychain.d.ts +3 -0
  6. package/dist/auth/keychain.js +16 -0
  7. package/dist/commands/init.d.ts +4 -0
  8. package/dist/commands/init.js +309 -0
  9. package/dist/commands/login.d.ts +7 -0
  10. package/dist/commands/login.js +166 -0
  11. package/dist/commands/logout.d.ts +1 -0
  12. package/dist/commands/logout.js +25 -0
  13. package/dist/commands/serve.d.ts +1 -0
  14. package/dist/commands/serve.js +38 -0
  15. package/dist/commands/setup.d.ts +5 -0
  16. package/dist/commands/setup.js +278 -0
  17. package/dist/commands/status.d.ts +3 -0
  18. package/dist/commands/status.js +127 -0
  19. package/dist/commands/upgrade.d.ts +3 -0
  20. package/dist/commands/upgrade.js +112 -0
  21. package/dist/index.d.ts +2 -0
  22. package/dist/index.js +64 -0
  23. package/dist/servers/chunk-DE7R7WKY.js +331 -0
  24. package/dist/servers/chunk-KMUSQOTJ.js +47 -0
  25. package/dist/servers/chunk-OP4EO6FV.js +454 -0
  26. package/dist/servers/chunk-UBBAYTW3.js +946 -0
  27. package/dist/servers/chunk-ZVWDXO6M.js +1063 -0
  28. package/dist/servers/cutline-server.js +10448 -0
  29. package/dist/servers/data-client-FPUZBUO3.js +160 -0
  30. package/dist/servers/exploration-server.js +930 -0
  31. package/dist/servers/graph-metrics-DCNR7JZN.js +12 -0
  32. package/dist/servers/integrations-server.js +107 -0
  33. package/dist/servers/output-server.js +107 -0
  34. package/dist/servers/premortem-server.js +971 -0
  35. package/dist/servers/tools-server.js +287 -0
  36. package/dist/utils/config-store.d.ts +8 -0
  37. package/dist/utils/config-store.js +35 -0
  38. package/dist/utils/config.d.ts +22 -0
  39. package/dist/utils/config.js +48 -0
  40. package/mcpb/manifest.json +77 -0
  41. package/package.json +76 -0
  42. package/server.json +42 -0
  43. package/smithery.yaml +10 -0
@@ -0,0 +1,12 @@
1
+ import {
2
+ applyGenericPrior,
3
+ computeGenericGraphMetrics,
4
+ computeGraphMetrics,
5
+ computeMetricsFromGraph
6
+ } from "./chunk-UBBAYTW3.js";
7
+ export {
8
+ applyGenericPrior,
9
+ computeGenericGraphMetrics,
10
+ computeGraphMetrics,
11
+ computeMetricsFromGraph
12
+ };
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ isWriteTool
4
+ } from "./chunk-KMUSQOTJ.js";
5
+ import {
6
+ guardBoundary,
7
+ guardOutput,
8
+ withPerfTracking
9
+ } from "./chunk-OP4EO6FV.js";
10
+ import {
11
+ cfCreateLinearIssues,
12
+ mapErrorToMcp,
13
+ requirePremiumWithAutoAuth,
14
+ validateAuth,
15
+ validateRequestSize
16
+ } from "./chunk-ZVWDXO6M.js";
17
+
18
+ // ../mcp/dist/mcp/src/integrations-server.js
19
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
20
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
21
+ import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError } from "@modelcontextprotocol/sdk/types.js";
22
+ var server = new Server({
23
+ name: "cutline-integrations",
24
+ version: "0.1.0"
25
+ }, {
26
+ capabilities: {
27
+ tools: {}
28
+ }
29
+ });
30
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
31
+ return {
32
+ tools: [
33
+ {
34
+ name: "integrations_create_issues",
35
+ description: "Create issues in issue tracker (stub)",
36
+ inputSchema: {
37
+ type: "object",
38
+ properties: {
39
+ schema_json: { type: "object" },
40
+ limit: { type: "number" },
41
+ auth_token: { type: "string" }
42
+ },
43
+ required: ["schema_json"]
44
+ }
45
+ },
46
+ {
47
+ name: "stripe_webhook_dispatch",
48
+ description: "Manually dispatch a Stripe webhook event",
49
+ inputSchema: {
50
+ type: "object",
51
+ properties: {
52
+ event: { type: "object" },
53
+ auth_token: { type: "string" }
54
+ },
55
+ required: ["event"]
56
+ }
57
+ }
58
+ ]
59
+ };
60
+ });
61
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
62
+ try {
63
+ const { name, arguments: rawArgs } = request.params;
64
+ if (!rawArgs)
65
+ throw new McpError(ErrorCode.InvalidParams, "Missing arguments");
66
+ validateRequestSize(rawArgs);
67
+ const { args } = guardBoundary(name, rawArgs);
68
+ const rawResponse = await withPerfTracking(name, async () => {
69
+ if (isWriteTool(name)) {
70
+ const peekToken = args.auth_token;
71
+ if (peekToken) {
72
+ const peekDecoded = await validateAuth(peekToken).catch(() => null);
73
+ if (peekDecoded && peekDecoded.accountType === "agent") {
74
+ throw new McpError(ErrorCode.InvalidRequest, "This is a read-only agent account. Write operations require the owner account.");
75
+ }
76
+ }
77
+ }
78
+ switch (name) {
79
+ case "integrations_create_issues": {
80
+ const { schema_json, limit, auth_token } = args;
81
+ await requirePremiumWithAutoAuth(auth_token);
82
+ const result = await cfCreateLinearIssues(schema_json, limit);
83
+ return {
84
+ content: [{ type: "text", text: JSON.stringify(result) }]
85
+ };
86
+ }
87
+ case "stripe_webhook_dispatch": {
88
+ throw new McpError(ErrorCode.InvalidRequest, "Stripe webhook dispatch is not available from local MCP. Webhooks are handled server-side.");
89
+ }
90
+ default:
91
+ throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
92
+ }
93
+ });
94
+ return guardOutput(name, rawResponse);
95
+ } catch (error) {
96
+ throw mapErrorToMcp(error, { tool: request.params.name });
97
+ }
98
+ });
99
+ async function run() {
100
+ const transport = new StdioServerTransport();
101
+ await server.connect(transport);
102
+ console.error("Cutline Integrations MCP Server running on stdio");
103
+ }
104
+ run().catch((error) => {
105
+ console.error("Fatal error running server:", error);
106
+ process.exit(1);
107
+ });
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ PMJsonSchema
4
+ } from "./chunk-DE7R7WKY.js";
5
+ import {
6
+ guardBoundary,
7
+ guardOutput,
8
+ withPerfTracking
9
+ } from "./chunk-OP4EO6FV.js";
10
+ import {
11
+ cfBuildAndUploadPdf,
12
+ cfGenerateAnswer,
13
+ mapErrorToMcp,
14
+ requirePremiumWithAutoAuth,
15
+ validateRequestSize
16
+ } from "./chunk-ZVWDXO6M.js";
17
+
18
+ // ../mcp/dist/mcp/src/output-server.js
19
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
20
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
21
+ import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError } from "@modelcontextprotocol/sdk/types.js";
22
+ var server = new Server({
23
+ name: "cutline-output",
24
+ version: "0.1.0"
25
+ }, {
26
+ capabilities: {
27
+ tools: {}
28
+ }
29
+ });
30
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
31
+ return {
32
+ tools: [
33
+ {
34
+ name: "premortem_render_pdf",
35
+ description: "Generate PDF and signed URL",
36
+ inputSchema: {
37
+ type: "object",
38
+ properties: {
39
+ doc: { type: "object" },
40
+ auth_token: { type: "string" },
41
+ store: { type: "boolean" }
42
+ },
43
+ required: ["doc"]
44
+ }
45
+ },
46
+ {
47
+ name: "premortem_qa_answer",
48
+ description: "Answer questions against a premortem doc",
49
+ inputSchema: {
50
+ type: "object",
51
+ properties: {
52
+ question: { type: "string" },
53
+ doc: { type: "object" }
54
+ },
55
+ required: ["question"]
56
+ }
57
+ }
58
+ ]
59
+ };
60
+ });
61
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
62
+ try {
63
+ const { name, arguments: rawArgs } = request.params;
64
+ if (!rawArgs)
65
+ throw new McpError(ErrorCode.InvalidParams, "Missing arguments");
66
+ validateRequestSize(rawArgs);
67
+ const { args } = guardBoundary(name, rawArgs);
68
+ const rawResponse = await withPerfTracking(name, async () => {
69
+ switch (name) {
70
+ case "premortem_render_pdf": {
71
+ const { doc, auth_token, store = true } = args;
72
+ await requirePremiumWithAutoAuth(auth_token);
73
+ const parsedDoc = PMJsonSchema.parse(doc);
74
+ const result = await cfBuildAndUploadPdf(parsedDoc);
75
+ return {
76
+ content: [{ type: "text", text: JSON.stringify({ ok: true, ...result }) }]
77
+ };
78
+ }
79
+ case "premortem_qa_answer": {
80
+ const { question, doc, auth_token } = args;
81
+ const allowPublic = process.env.ALLOW_PUBLIC_PREMORTEM === "true";
82
+ if (!allowPublic) {
83
+ await requirePremiumWithAutoAuth(auth_token);
84
+ }
85
+ const result = await cfGenerateAnswer(question, doc);
86
+ return {
87
+ content: [{ type: "text", text: JSON.stringify(result) }]
88
+ };
89
+ }
90
+ default:
91
+ throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
92
+ }
93
+ });
94
+ return guardOutput(name, rawResponse);
95
+ } catch (error) {
96
+ throw mapErrorToMcp(error, { tool: request.params.name });
97
+ }
98
+ });
99
+ async function run() {
100
+ const transport = new StdioServerTransport();
101
+ await server.connect(transport);
102
+ console.error("Cutline Output MCP Server running on stdio");
103
+ }
104
+ run().catch((error) => {
105
+ console.error("Fatal error running server:", error);
106
+ process.exit(1);
107
+ });