@buildpad/mcp 0.1.11 → 0.1.13

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/index.js CHANGED
@@ -5,7 +5,7 @@ var __export = (target, all) => {
5
5
  __defProp(target, name, { get: all[name], enumerable: true });
6
6
  };
7
7
 
8
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
8
+ // ../../node_modules/zod/v3/external.js
9
9
  var external_exports = {};
10
10
  __export(external_exports, {
11
11
  BRAND: () => BRAND,
@@ -117,7 +117,7 @@ __export(external_exports, {
117
117
  void: () => voidType
118
118
  });
119
119
 
120
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
120
+ // ../../node_modules/zod/v3/helpers/util.js
121
121
  var util;
122
122
  (function(util2) {
123
123
  util2.assertEqual = (_) => {
@@ -251,7 +251,7 @@ var getParsedType = (data) => {
251
251
  }
252
252
  };
253
253
 
254
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js
254
+ // ../../node_modules/zod/v3/ZodError.js
255
255
  var ZodIssueCode = util.arrayToEnum([
256
256
  "invalid_type",
257
257
  "invalid_literal",
@@ -369,7 +369,7 @@ ZodError.create = (issues) => {
369
369
  return error;
370
370
  };
371
371
 
372
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
372
+ // ../../node_modules/zod/v3/locales/en.js
373
373
  var errorMap = (issue, _ctx) => {
374
374
  let message;
375
375
  switch (issue.code) {
@@ -472,7 +472,7 @@ var errorMap = (issue, _ctx) => {
472
472
  };
473
473
  var en_default = errorMap;
474
474
 
475
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js
475
+ // ../../node_modules/zod/v3/errors.js
476
476
  var overrideErrorMap = en_default;
477
477
  function setErrorMap(map) {
478
478
  overrideErrorMap = map;
@@ -481,7 +481,7 @@ function getErrorMap() {
481
481
  return overrideErrorMap;
482
482
  }
483
483
 
484
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
484
+ // ../../node_modules/zod/v3/helpers/parseUtil.js
485
485
  var makeIssue = (params) => {
486
486
  const { data, path, errorMaps, issueData } = params;
487
487
  const fullPath = [...path, ...issueData.path || []];
@@ -591,14 +591,14 @@ var isDirty = (x) => x.status === "dirty";
591
591
  var isValid = (x) => x.status === "valid";
592
592
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
593
593
 
594
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
594
+ // ../../node_modules/zod/v3/helpers/errorUtil.js
595
595
  var errorUtil;
596
596
  (function(errorUtil2) {
597
597
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
598
598
  errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
599
599
  })(errorUtil || (errorUtil = {}));
600
600
 
601
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
601
+ // ../../node_modules/zod/v3/types.js
602
602
  var ParseInputLazyPath = class {
603
603
  constructor(parent, value, path, key) {
604
604
  this._cachedPath = [];
@@ -4046,7 +4046,7 @@ var coerce = {
4046
4046
  };
4047
4047
  var NEVER = INVALID;
4048
4048
 
4049
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@0.5.0/node_modules/@modelcontextprotocol/sdk/dist/types.js
4049
+ // ../../node_modules/@modelcontextprotocol/sdk/dist/types.js
4050
4050
  var LATEST_PROTOCOL_VERSION = "2024-11-05";
4051
4051
  var SUPPORTED_PROTOCOL_VERSIONS = [
4052
4052
  LATEST_PROTOCOL_VERSION,
@@ -4751,7 +4751,7 @@ var McpError = class extends Error {
4751
4751
  }
4752
4752
  };
4753
4753
 
4754
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@0.5.0/node_modules/@modelcontextprotocol/sdk/dist/shared/protocol.js
4754
+ // ../../node_modules/@modelcontextprotocol/sdk/dist/shared/protocol.js
4755
4755
  var Protocol = class {
4756
4756
  constructor(_options) {
4757
4757
  this._options = _options;
@@ -5008,7 +5008,7 @@ var Protocol = class {
5008
5008
  }
5009
5009
  };
5010
5010
 
5011
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@0.5.0/node_modules/@modelcontextprotocol/sdk/dist/server/index.js
5011
+ // ../../node_modules/@modelcontextprotocol/sdk/dist/server/index.js
5012
5012
  var Server = class extends Protocol {
5013
5013
  /**
5014
5014
  * Initializes this server with the given name and version information.
@@ -5161,10 +5161,10 @@ var Server = class extends Protocol {
5161
5161
  }
5162
5162
  };
5163
5163
 
5164
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@0.5.0/node_modules/@modelcontextprotocol/sdk/dist/server/stdio.js
5164
+ // ../../node_modules/@modelcontextprotocol/sdk/dist/server/stdio.js
5165
5165
  import process2 from "process";
5166
5166
 
5167
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@0.5.0/node_modules/@modelcontextprotocol/sdk/dist/shared/stdio.js
5167
+ // ../../node_modules/@modelcontextprotocol/sdk/dist/shared/stdio.js
5168
5168
  var ReadBuffer = class {
5169
5169
  append(chunk) {
5170
5170
  this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
@@ -5192,7 +5192,7 @@ function serializeMessage(message) {
5192
5192
  return JSON.stringify(message) + "\n";
5193
5193
  }
5194
5194
 
5195
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@0.5.0/node_modules/@modelcontextprotocol/sdk/dist/server/stdio.js
5195
+ // ../../node_modules/@modelcontextprotocol/sdk/dist/server/stdio.js
5196
5196
  var StdioServerTransport = class {
5197
5197
  constructor(_stdin = process2.stdin, _stdout = process2.stdout) {
5198
5198
  this._stdin = _stdin;
@@ -5840,6 +5840,73 @@ function loadRegistry() {
5840
5840
  "hasOptions": true
5841
5841
  }
5842
5842
  },
5843
+ {
5844
+ "name": "input-hash",
5845
+ "title": "InputHash",
5846
+ "description": "Hashed input interface for securely storing values like passwords. Shows lock icon indicator for existing hashed values.",
5847
+ "category": "input",
5848
+ "files": [
5849
+ {
5850
+ "source": "ui-interfaces/src/input-hash/InputHash.tsx",
5851
+ "target": "components/ui/input-hash.tsx"
5852
+ }
5853
+ ],
5854
+ "dependencies": [
5855
+ "@mantine/core",
5856
+ "@tabler/icons-react"
5857
+ ],
5858
+ "internalDependencies": [],
5859
+ "interface": {
5860
+ "id": "input-hash",
5861
+ "name": "Hash",
5862
+ "icon": "IconFingerprint",
5863
+ "types": [
5864
+ "hash"
5865
+ ],
5866
+ "localTypes": [
5867
+ "standard"
5868
+ ],
5869
+ "group": "other",
5870
+ "order": 4,
5871
+ "supported": true,
5872
+ "hasOptions": true
5873
+ }
5874
+ },
5875
+ {
5876
+ "name": "system-token",
5877
+ "title": "SystemToken",
5878
+ "description": "Token generator interface with generate, copy, and remove actions. Used for API tokens and system authentication keys.",
5879
+ "category": "input",
5880
+ "files": [
5881
+ {
5882
+ "source": "ui-interfaces/src/system-token/SystemToken.tsx",
5883
+ "target": "components/ui/system-token.tsx"
5884
+ }
5885
+ ],
5886
+ "dependencies": [
5887
+ "@mantine/core",
5888
+ "@tabler/icons-react"
5889
+ ],
5890
+ "internalDependencies": [
5891
+ "services",
5892
+ "hooks"
5893
+ ],
5894
+ "interface": {
5895
+ "id": "system-token",
5896
+ "name": "Token",
5897
+ "icon": "IconKey",
5898
+ "types": [
5899
+ "hash"
5900
+ ],
5901
+ "localTypes": [
5902
+ "standard"
5903
+ ],
5904
+ "group": "other",
5905
+ "order": 5,
5906
+ "supported": true,
5907
+ "hasOptions": false
5908
+ }
5909
+ },
5843
5910
  {
5844
5911
  "name": "input-block-editor",
5845
5912
  "title": "InputBlockEditor",
@@ -7466,6 +7533,12 @@ function getComponentsByCategory(category) {
7466
7533
  function getCategories() {
7467
7534
  return getRegistry().categories;
7468
7535
  }
7536
+ function getLibModule(name) {
7537
+ return getRegistry().lib[name];
7538
+ }
7539
+ function getAllLibModules() {
7540
+ return Object.values(getRegistry().lib);
7541
+ }
7469
7542
  var PACKAGES = [
7470
7543
  {
7471
7544
  name: "@buildpad/types",
@@ -7718,10 +7791,12 @@ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
7718
7791
  if (uri.startsWith("buildpad://components/")) {
7719
7792
  const componentName = uri.replace("buildpad://components/", "");
7720
7793
  const component = getComponent(componentName);
7721
- if (!component) {
7794
+ const libModule = !component ? getLibModule(componentName) : void 0;
7795
+ if (!component && !libModule) {
7722
7796
  throw new Error(`Component not found: ${componentName}`);
7723
7797
  }
7724
- const sourcePath = component.files[0]?.source;
7798
+ const files = component ? component.files : libModule.files ?? [];
7799
+ const sourcePath = files[0]?.source;
7725
7800
  const source = sourcePath ? readSourceFile(sourcePath) : null;
7726
7801
  if (!source) {
7727
7802
  throw new Error(`Source file not found for component: ${componentName}`);
@@ -7886,6 +7961,14 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
7886
7961
  required: ["name"]
7887
7962
  }
7888
7963
  },
7964
+ {
7965
+ name: "list_lib_modules",
7966
+ description: "List all available CLI lib modules (e.g. external-oauth, supabase-auth, api-routes) that can be added via `buildpad add <name>`. These are infrastructure/auth modules, separate from UI components.",
7967
+ inputSchema: {
7968
+ type: "object",
7969
+ properties: {}
7970
+ }
7971
+ },
7889
7972
  {
7890
7973
  name: "get_rbac_pattern",
7891
7974
  description: "Get RBAC (Role-Based Access Control) setup patterns for DaaS applications. Returns complete MCP tool call sequences to set up roles, policies, access, and permissions with dynamic variables.",
@@ -7928,15 +8011,56 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
7928
8011
  ]
7929
8012
  };
7930
8013
  }
8014
+ case "list_lib_modules": {
8015
+ const libModules = getAllLibModules().map((m) => ({
8016
+ name: m.name,
8017
+ description: m.description,
8018
+ dependencies: m.dependencies ?? [],
8019
+ internalDependencies: m.internalDependencies ?? [],
8020
+ installCommand: `npx @buildpad/cli add ${m.name}`,
8021
+ files: (m.files ?? []).map((f) => f.target)
8022
+ }));
8023
+ return {
8024
+ content: [
8025
+ {
8026
+ type: "text",
8027
+ text: JSON.stringify(libModules, null, 2)
8028
+ }
8029
+ ]
8030
+ };
8031
+ }
7931
8032
  case "get_component": {
7932
8033
  const componentName = args?.name;
7933
8034
  if (!componentName) {
7934
8035
  throw new Error("Component name is required");
7935
8036
  }
7936
8037
  const component = getComponent(componentName);
7937
- if (!component) {
8038
+ const libModule = !component ? getLibModule(componentName) : void 0;
8039
+ if (!component && !libModule) {
7938
8040
  throw new Error(`Component not found: ${componentName}`);
7939
8041
  }
8042
+ if (libModule) {
8043
+ const libFiles = {};
8044
+ for (const file of libModule.files ?? []) {
8045
+ const content = readSourceFile(file.source);
8046
+ if (content) libFiles[file.target] = content;
8047
+ }
8048
+ return {
8049
+ content: [{
8050
+ type: "text",
8051
+ text: JSON.stringify({
8052
+ name: libModule.name,
8053
+ description: libModule.description,
8054
+ type: "lib-module",
8055
+ files: libModule.files,
8056
+ dependencies: libModule.dependencies ?? [],
8057
+ internalDependencies: libModule.internalDependencies ?? [],
8058
+ allSources: libFiles,
8059
+ installCommand: `npx @buildpad/cli add ${libModule.name}`
8060
+ }, null, 2)
8061
+ }]
8062
+ };
8063
+ }
7940
8064
  const sources = {};
7941
8065
  for (const file of component.files) {
7942
8066
  const content = readSourceFile(file.source);
@@ -7976,9 +8100,22 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
7976
8100
  throw new Error("Component name is required");
7977
8101
  }
7978
8102
  const component = getComponent(componentName);
7979
- if (!component) {
8103
+ const libModule = !component ? getLibModule(componentName) : void 0;
8104
+ if (!component && !libModule) {
7980
8105
  throw new Error(`Component not found: ${componentName}`);
7981
8106
  }
8107
+ if (libModule) {
8108
+ return {
8109
+ content: [{
8110
+ type: "text",
8111
+ text: `// Lib module: ${libModule.name}
8112
+ // Install via CLI:
8113
+ // npx @buildpad/cli add ${libModule.name}
8114
+
8115
+ // ${libModule.description}`
8116
+ }]
8117
+ };
8118
+ }
7982
8119
  const example = generateUsageExample(component);
7983
8120
  return {
7984
8121
  content: [
@@ -8214,9 +8351,58 @@ your-project/
8214
8351
  throw new Error("Component name is required");
8215
8352
  }
8216
8353
  const component = getComponent(componentName);
8217
- if (!component) {
8354
+ const libModule = !component ? getLibModule(componentName) : void 0;
8355
+ if (!component && !libModule) {
8218
8356
  throw new Error(`Component not found: ${componentName}`);
8219
8357
  }
8358
+ if (libModule) {
8359
+ const registry = getRegistry();
8360
+ const allLibFiles = [];
8361
+ const visited = /* @__PURE__ */ new Set();
8362
+ const resolveLib = (name2) => {
8363
+ if (visited.has(name2)) return;
8364
+ visited.add(name2);
8365
+ const mod = registry.lib[name2];
8366
+ if (!mod) return;
8367
+ for (const dep of mod.internalDependencies ?? []) resolveLib(dep);
8368
+ for (const file of mod.files ?? []) {
8369
+ const content = readSourceFile(file.source);
8370
+ if (content) allLibFiles.push({ path: file.target, content, module: name2 });
8371
+ }
8372
+ };
8373
+ resolveLib(componentName);
8374
+ const allDeps = [...new Set(
8375
+ [...visited].flatMap((n) => (registry.lib[n]?.dependencies ?? []).map((d) => d.replace(/@[^@/]*$/, "")))
8376
+ )];
8377
+ return {
8378
+ content: [{
8379
+ type: "text",
8380
+ text: JSON.stringify({
8381
+ name: libModule.name,
8382
+ description: libModule.description,
8383
+ type: "lib-module",
8384
+ files: allLibFiles,
8385
+ peerDependencies: allDeps,
8386
+ installCommand: `npx @buildpad/cli add ${libModule.name}`,
8387
+ instructions: `## Install lib module: ${libModule.name}
8388
+
8389
+ \`\`\`bash
8390
+ npx @buildpad/cli add ${libModule.name}
8391
+ \`\`\`
8392
+
8393
+ ${libModule.description}
8394
+
8395
+ Files installed:
8396
+ ${allLibFiles.map((f) => `- \`${f.path}\` (${f.module})`).join("\n")}${allDeps.length ? `
8397
+
8398
+ ### npm dependencies
8399
+ \`\`\`bash
8400
+ pnpm add ${allDeps.join(" ")}
8401
+ \`\`\`` : ""}`
8402
+ }, null, 2)
8403
+ }]
8404
+ };
8405
+ }
8220
8406
  const files = [];
8221
8407
  for (const file of component.files) {
8222
8408
  const content = readSourceFile(file.source);
@@ -8231,10 +8417,10 @@ your-project/
8231
8417
  if (includeLib && component.internalDependencies?.length > 0) {
8232
8418
  const registry = getRegistry();
8233
8419
  for (const dep of component.internalDependencies) {
8234
- const libModule = registry.lib[dep];
8235
- if (libModule) {
8236
- if (libModule.files) {
8237
- for (const file of libModule.files) {
8420
+ const libModule2 = registry.lib[dep];
8421
+ if (libModule2) {
8422
+ if (libModule2.files) {
8423
+ for (const file of libModule2.files) {
8238
8424
  const content = readSourceFile(file.source);
8239
8425
  if (content) {
8240
8426
  libFiles.push({
@@ -8244,11 +8430,11 @@ your-project/
8244
8430
  });
8245
8431
  }
8246
8432
  }
8247
- } else if (libModule.path && libModule.target) {
8248
- const content = readSourceFile(libModule.path);
8433
+ } else if (libModule2.path && libModule2.target) {
8434
+ const content = readSourceFile(libModule2.path);
8249
8435
  if (content) {
8250
8436
  libFiles.push({
8251
- path: libModule.target,
8437
+ path: libModule2.target,
8252
8438
  content,
8253
8439
  module: dep
8254
8440
  });