capix-mcp 2.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,101 @@
1
+ /**
2
+ * Capix MCP Server — resources (capix:// URIs).
3
+ *
4
+ * Resources are read-only views the MCP client can list and read by URI. They
5
+ * mirror the discovery + website sub-ports: account, balance, projects,
6
+ * catalogs, deployments, receipts, attestations, websites, and memory/skills
7
+ * intelligence surfaces.
8
+ *
9
+ * `registerResources(server, client)` wires each `capix://…` URI to a
10
+ * `readResource` callback that delegates to the canonical Capix API client.
11
+ */
12
+ export const CAPIX_RESOURCES = [
13
+ {
14
+ uri: "capix://account",
15
+ name: "Account",
16
+ description: "Authenticated account inspection snapshot (wallet, spending limit, active deploys).",
17
+ mimeType: "application/json",
18
+ },
19
+ {
20
+ uri: "capix://balance",
21
+ name: "Balance",
22
+ description: "Customer cash balance (available / held / total) per asset.",
23
+ mimeType: "application/json",
24
+ },
25
+ {
26
+ uri: "capix://projects",
27
+ name: "Projects",
28
+ description: "Projects visible to the authenticated account.",
29
+ mimeType: "application/json",
30
+ },
31
+ {
32
+ uri: "capix://models",
33
+ name: "Models",
34
+ description: "Live model endpoint catalog (model id, context length, price per 1k tokens).",
35
+ mimeType: "application/json",
36
+ },
37
+ {
38
+ uri: "capix://deployments",
39
+ name: "Deployments",
40
+ description: "Deployments for the account/project with phase + allocation state.",
41
+ mimeType: "application/json",
42
+ },
43
+ {
44
+ uri: "capix://receipts",
45
+ name: "Receipts",
46
+ description: "Settled work receipts (cost records).",
47
+ mimeType: "application/json",
48
+ },
49
+ {
50
+ uri: "capix://memory",
51
+ name: "Memory",
52
+ description: "Recent Capix intelligence memory nodes for the active project.",
53
+ mimeType: "application/json",
54
+ },
55
+ {
56
+ uri: "capix://skills",
57
+ name: "Skills",
58
+ description: "Registered Capix skills available to the project.",
59
+ mimeType: "application/json",
60
+ },
61
+ ];
62
+ const RESOURCE_READERS = {
63
+ account: (c) => c.get("/api/v1/account"),
64
+ balance: (c) => c.get("/api/v1/account/balance"),
65
+ projects: (c) => c.get("/api/v1/projects", { limit: 50 }),
66
+ models: (c) => c.get("/api/v1/catalog/models"),
67
+ deployments: (c) => c.get("/api/v1/deployments", { limit: 50 }),
68
+ receipts: (c) => c.get("/api/v1/receipts", { limit: 50 }),
69
+ memory: (c) => c.get("/api/v1/account/memory"),
70
+ skills: (c) => c.get("/api/v1/account/skills"),
71
+ };
72
+ /**
73
+ * Register all capix:// resources with the given McpServer. Each resource's
74
+ * read callback delegates to the canonical Capix API client and returns the
75
+ * raw JSON object as a text content block.
76
+ */
77
+ export function registerResources(server, client) {
78
+ for (const res of CAPIX_RESOURCES) {
79
+ const key = res.uri.replace(/^capix:\/\//, "");
80
+ const reader = RESOURCE_READERS[key];
81
+ if (!reader)
82
+ continue;
83
+ server.registerResource(res.name, res.uri, {
84
+ description: res.description,
85
+ mimeType: res.mimeType,
86
+ }, async () => {
87
+ const data = await reader(client);
88
+ const text = typeof data === "string" ? data : JSON.stringify(data, null, 2);
89
+ return {
90
+ contents: [
91
+ {
92
+ uri: res.uri,
93
+ mimeType: res.mimeType,
94
+ text,
95
+ },
96
+ ],
97
+ };
98
+ });
99
+ }
100
+ }
101
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAaH,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C;QACE,GAAG,EAAE,iBAAiB;QACtB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,qFAAqF;QAClG,QAAQ,EAAE,kBAAkB;KAC7B;IACD;QACE,GAAG,EAAE,iBAAiB;QACtB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,6DAA6D;QAC1E,QAAQ,EAAE,kBAAkB;KAC7B;IACD;QACE,GAAG,EAAE,kBAAkB;QACvB,IAAI,EAAE,UAAU;QAChB,WAAW,EAA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+ * `createCapixMcpServer(client)` builds an {@link McpServer} with all 59
5
+ * tools, the capix:// resources, and the guided prompts registered. Each tool
6
+ * registration wires:
7
+ * - inputSchema → the tool's Zod raw shape (validated by the SDK)
8
+ * - outputSchema → the tool's Zod raw output shape
9
+ * - annotations → readOnlyHint / destructiveHint / idempotentHint derived
10
+ * from the billable/requiresApproval/scope flags
11
+ *
12
+ * The dispatch callback enforces the Capix control-plane invariants:
13
+ * 1. billable / requiresApproval tools refuse to run without an
14
+ * approvalToken (surfaced as a structured MCP error with capixCode
15
+ * `approval_required`). The agent must re-request with a bound token.
16
+ * 2. read-only tools (billable=false, requiresApproval=false) auto-run.
17
+ * 3. every billable tool's cost is the canonical quote the agent obtained
18
+ * upstream (no in-line price guess); the approval token binds that quote.
19
+ *
20
+ * Transports:
21
+ * - stdio : StdioServerTransport, for local agent integration
22
+ * - streamable HTTP : StreamableHTTPServerTransport, for remote / hosted use
23
+ */
24
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
25
+ import type { CapixClient } from "./client.js";
26
+ import type { ToolDef, ToolScope } from "./types.js";
27
+ /**
28
+ * Build a fully-wired McpServer. All 59 tools, resources, and prompts are
29
+ * registered before returning; the caller just attaches a transport.
30
+ */
31
+ export declare function createCapixMcpServer(client: CapixClient, opts?: {
32
+ version?: string;
33
+ }): McpServer;
34
+ export interface CapixServerOptions {
35
+ version?: string;
36
+ /** HTTP port for the streamable HTTP transport (0 = don't start HTTP). */
37
+ httpPort?: number;
38
+ /** Bearer service token guarding the HTTP transport (required if httpPort>0). */
39
+ httpServiceToken?: string;
40
+ }
41
+ /** Start the MCP server on stdio (the default for local agent integration). */
42
+ export declare function startStdioServer(client: CapixClient, opts?: CapixServerOptions): Promise<void>;
43
+ /**
44
+ * Start the MCP server on a streamable HTTP transport.
45
+ *
46
+ * The server exposes the MCP JSON-RPC endpoint at `/mcp` (POST for requests,
47
+ * GET for SSE streams). A `/healthz` endpoint reports wired tool count. The
48
+ * transport is stateful (session id per connection) by default.
49
+ */
50
+ export declare function startHttpServer(client: CapixClient, opts: CapixServerOptions & {
51
+ httpPort: number;
52
+ httpServiceToken: string;
53
+ }): Promise<void>;
54
+ export declare function getToolSummary(): Array<{
55
+ name: string;
56
+ scope: ToolScope;
57
+ billable: boolean;
58
+ requiresApproval: boolean;
59
+ }>;
60
+ export declare function lookupTool(name: string): ToolDef | undefined;
61
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK/C,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAsBrD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,WAAW,EACnB,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1B,SAAS,CAmFX;AA8DD,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iFAAiF;IACjF,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,+EAA+E;AAC/E,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,WAAW,EACnB,IAAI,CAAC,EAAE,kBAAkB,GACxB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,kBAAkB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,GACxE,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAMD,wBAAgB,cAAc,IAAI,KAAK,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC,CAOD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAE5D"}
package/dist/server.js ADDED
@@ -0,0 +1,223 @@
1
+ /**
2
+ * Capix MCP Server — the McpServer assembly + transport wiring.
3
+ *
4
+ * `createCapixMcpServer(client)` builds an {@link McpServer} with all 59
5
+ * tools, the capix:// resources, and the guided prompts registered. Each tool
6
+ * registration wires:
7
+ * - inputSchema → the tool's Zod raw shape (validated by the SDK)
8
+ * - outputSchema → the tool's Zod raw output shape
9
+ * - annotations → readOnlyHint / destructiveHint / idempotentHint derived
10
+ * from the billable/requiresApproval/scope flags
11
+ *
12
+ * The dispatch callback enforces the Capix control-plane invariants:
13
+ * 1. billable / requiresApproval tools refuse to run without an
14
+ * approvalToken (surfaced as a structured MCP error with capixCode
15
+ * `approval_required`). The agent must re-request with a bound token.
16
+ * 2. read-only tools (billable=false, requiresApproval=false) auto-run.
17
+ * 3. every billable tool's cost is the canonical quote the agent obtained
18
+ * upstream (no in-line price guess); the approval token binds that quote.
19
+ *
20
+ * Transports:
21
+ * - stdio : StdioServerTransport, for local agent integration
22
+ * - streamable HTTP : StreamableHTTPServerTransport, for remote / hosted use
23
+ */
24
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
25
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
26
+ import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
27
+ import { randomUUID } from "node:crypto";
28
+ import http from "node:http";
29
+ import { TOOLS, TOOL_MAP, TOOL_COUNT } from "./tools.js";
30
+ import { registerResources } from "./resources.js";
31
+ import { registerPrompts } from "./prompts.js";
32
+ import { CapixApiError } from "./types.js";
33
+ /** MCP tool annotations derived from a tool's billing/approval/scope flags. */
34
+ function annotationsFor(tool) {
35
+ const isDestructive = (tool.scope === "lifecycle" && (tool.name === "capix_delete" || tool.name === "capix_cancel")) ||
36
+ tool.name === "capix_destroy_task_resources" ||
37
+ tool.name === "capix_website_destroy" ||
38
+ tool.name === "capix_website_domain_remove";
39
+ return {
40
+ readOnlyHint: !tool.billable && !tool.requiresApproval,
41
+ destructiveHint: isDestructive,
42
+ idempotentHint: !tool.billable || tool.scope === "discovery",
43
+ openWorldHint: true,
44
+ };
45
+ }
46
+ /**
47
+ * Build a fully-wired McpServer. All 59 tools, resources, and prompts are
48
+ * registered before returning; the caller just attaches a transport.
49
+ */
50
+ export function createCapixMcpServer(client, opts) {
51
+ const server = new McpServer({
52
+ name: "capix-mcp",
53
+ version: opts?.version ?? "2.0.0",
54
+ });
55
+ // ── Tools ───────────────────────────────────────────────────────────────
56
+ for (const tool of TOOLS) {
57
+ server.registerTool(tool.name, {
58
+ title: tool.name.replace(/^capix_/, "").replace(/_/g, " "),
59
+ description: appendApprovalNote(tool),
60
+ inputSchema: tool.inputShape,
61
+ // Conditionally include outputSchema only when defined so the SDK's
62
+ // generic inference picks the ZodRawShape overload (not the empty-
63
+ // overload fallback) for both input and output.
64
+ ...(tool.outputShape ? { outputSchema: tool.outputShape } : {}),
65
+ annotations: annotationsFor(tool),
66
+ _meta: {
67
+ scope: tool.scope,
68
+ billable: tool.billable,
69
+ requiresApproval: tool.requiresApproval,
70
+ },
71
+ }, async (args, extra) => {
72
+ const actor = extra.authInfo?.name ?? "unknown";
73
+ const approvalToken = args.approvalToken ??
74
+ extra.params?.approvalToken;
75
+ // ── Approval gate ──────────────────────────────────────────────────
76
+ if ((tool.billable || tool.requiresApproval) && !approvalToken) {
77
+ return {
78
+ isError: true,
79
+ content: [
80
+ {
81
+ type: "text",
82
+ text: `approval_required: ${tool.name} ${tool.billable
83
+ ? "moves funds or mutates provider state"
84
+ : "mutates state"} and requires a bound approvalToken (§5). Re-request the tool call with an approvalToken obtained after the user reviewed the canonical cost.`,
85
+ },
86
+ ],
87
+ };
88
+ }
89
+ try {
90
+ const data = await tool.handler(args, {
91
+ client,
92
+ ctx: {
93
+ actor,
94
+ traceId: randomUUID(),
95
+ approvalToken,
96
+ },
97
+ });
98
+ return {
99
+ content: [
100
+ {
101
+ type: "text",
102
+ text: JSON.stringify(data, (_k, v) => (typeof v === "bigint" ? v.toString() : v), 2),
103
+ },
104
+ ],
105
+ structuredContent: data,
106
+ };
107
+ }
108
+ catch (err) {
109
+ return errorResult(err, tool.name);
110
+ }
111
+ });
112
+ }
113
+ // ── Resources + prompts ────────────────────────────────────────────────
114
+ registerResources(server, client);
115
+ registerPrompts(server);
116
+ return server;
117
+ }
118
+ /** Surface the billable/approval requirement alongside the description. */
119
+ function appendApprovalNote(tool) {
120
+ if (!tool.billable && !tool.requiresApproval) {
121
+ return `${tool.description} [read-only — auto-runs after auth]`;
122
+ }
123
+ const tags = [];
124
+ if (tool.billable)
125
+ tags.push("billable");
126
+ if (tool.requiresApproval)
127
+ tags.push("requires approvalToken");
128
+ return `${tool.description} [${tags.join(", ")}]`;
129
+ }
130
+ /** Convert a thrown error into a structured MCP error result. */
131
+ function errorResult(err, toolName) {
132
+ if (err instanceof CapixApiError) {
133
+ return {
134
+ isError: true,
135
+ content: [
136
+ {
137
+ type: "text",
138
+ text: JSON.stringify({
139
+ ok: false,
140
+ error: {
141
+ capixCode: err.capixCode,
142
+ message: err.message,
143
+ status: err.status,
144
+ problem: err.problem,
145
+ },
146
+ tool: toolName,
147
+ }),
148
+ },
149
+ ],
150
+ };
151
+ }
152
+ const e = err;
153
+ return {
154
+ isError: true,
155
+ content: [
156
+ {
157
+ type: "text",
158
+ text: JSON.stringify({
159
+ ok: false,
160
+ error: {
161
+ capixCode: e.capixCode ?? "tool_internal_error",
162
+ message: e.message ?? `${toolName} threw unexpectedly`,
163
+ status: e.status,
164
+ },
165
+ tool: toolName,
166
+ }),
167
+ },
168
+ ],
169
+ };
170
+ }
171
+ /** Start the MCP server on stdio (the default for local agent integration). */
172
+ export async function startStdioServer(client, opts) {
173
+ const server = createCapixMcpServer(client, opts);
174
+ const transport = new StdioServerTransport();
175
+ await server.connect(transport);
176
+ }
177
+ /**
178
+ * Start the MCP server on a streamable HTTP transport.
179
+ *
180
+ * The server exposes the MCP JSON-RPC endpoint at `/mcp` (POST for requests,
181
+ * GET for SSE streams). A `/healthz` endpoint reports wired tool count. The
182
+ * transport is stateful (session id per connection) by default.
183
+ */
184
+ export async function startHttpServer(client, opts) {
185
+ const server = createCapixMcpServer(client, opts);
186
+ const transport = new StreamableHTTPServerTransport({
187
+ sessionIdGenerator: () => randomUUID(),
188
+ });
189
+ const httpServer = http.createServer(async (req, res) => {
190
+ const url = new URL(req.url ?? "/", `http://localhost:${opts.httpPort}`);
191
+ // Health/readiness for orchestrators.
192
+ if (req.method === "GET" && url.pathname === "/healthz") {
193
+ res.writeHead(200, { "content-type": "application/json" });
194
+ res.end(JSON.stringify({
195
+ ok: true,
196
+ service: "capix-mcp",
197
+ version: opts.version ?? "2.0.0",
198
+ tools: TOOL_COUNT,
199
+ authenticated: client.isAuthenticated(),
200
+ }));
201
+ return;
202
+ }
203
+ // All other paths flow through the MCP streamable HTTP transport.
204
+ await transport.handleRequest(req, res);
205
+ });
206
+ await server.connect(transport);
207
+ httpServer.listen(opts.httpPort);
208
+ }
209
+ // ===========================================================================
210
+ // Introspection helpers (used by the `doctor` CLI command)
211
+ // ===========================================================================
212
+ export function getToolSummary() {
213
+ return TOOLS.map((t) => ({
214
+ name: t.name,
215
+ scope: t.scope,
216
+ billable: t.billable,
217
+ requiresApproval: t.requiresApproval,
218
+ }));
219
+ }
220
+ export function lookupTool(name) {
221
+ return TOOL_MAP.get(name);
222
+ }
223
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;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,CAAC;AACnC,CAAC;AAED,8EAA8E;AAC9E,2DAA2D;AAC3D,8EAA8E;AAE9E,MAAM,UAAU,cAAc;IAM5B,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACvB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,gBAAgB,EAAE,CAAC,CAAC,gBAAgB;KACrC,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Capix MCP Server — all 59 tool definitions.
3
+ *
4
+ * Each tool is declared with:
5
+ * - inputShape : a Zod raw shape (validated by the McpServer before dispatch)
6
+ * - outputShape : a Zod raw shape describing the structured result envelope
7
+ * - billable / requiresApproval : control-plane flags enforced by the server
8
+ *
9
+ * Handlers are deliberately thin: they translate Zod-validated arguments into
10
+ * canonical `/api/v1/*` client calls and return the upstream JSON object as
11
+ * structured content. The CapixApiError (problem+json) thrown by the client is
12
+ * caught by the server wrapper and surfaced as an MCP error result.
13
+ *
14
+ * Tools are grouped by scope (mirrors services/capix-mcp/tools/*.ts):
15
+ * discovery (9) · planning (6) · lifecycle (7) · networking (8) ·
16
+ * testing (6) · verification (6) · website (17)
17
+ */
18
+ import type { ToolDef } from "./types.js";
19
+ declare const discoveryTools: ToolDef[];
20
+ declare const planningTools: ToolDef[];
21
+ declare const lifecycleTools: ToolDef[];
22
+ declare const networkingTools: ToolDef[];
23
+ declare const testingTools: ToolDef[];
24
+ declare const verificationTools: ToolDef[];
25
+ declare const websiteTools: ToolDef[];
26
+ export declare const TOOLS: ToolDef[];
27
+ export declare const TOOL_NAMES: string[];
28
+ export declare const TOOL_COUNT: number;
29
+ /** Map of tool name → definition, used by the server for O(1) lookup. */
30
+ export declare const TOOL_MAP: Map<string, ToolDef>;
31
+ export { discoveryTools, planningTools, lifecycleTools, networkingTools, testingTools, verificationTools, websiteTools };
32
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAEV,OAAO,EAGR,MAAM,YAAY,CAAC;AAyIpB,QAAA,MAAM,cAAc,EAAE,OAAO,EAmK5B,CAAC;AAqCF,QAAA,MAAM,aAAa,EAAE,OAAO,EA8F3B,CAAC;AAMF,QAAA,MAAM,cAAc,EAAE,OAAO,EA0I5B,CAAC;AAMF,QAAA,MAAM,eAAe,EAAE,OAAO,EA8H7B,CAAC;AAMF,QAAA,MAAM,YAAY,EAAE,OAAO,EA4I1B,CAAC;AAMF,QAAA,MAAM,iBAAiB,EAAE,OAAO,EAmI/B,CAAC;AAaF,QAAA,MAAM,YAAY,EAAE,OAAO,EAmU1B,CAAC;AAMF,eAAO,MAAM,KAAK,EAAE,OAAO,EAQ1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAAM,EAA6B,CAAC;AAE7D,eAAO,MAAM,UAAU,QAAe,CAAC;AAEvC,yEAAyE;AACzE,eAAO,MAAM,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAA0C,CAAC;AAErF,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC"}