inistate-mcp 1.3.1 → 1.3.2

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.
@@ -61,7 +61,12 @@ export class FileClientsStore {
61
61
  try {
62
62
  if (!existsSync(this.file))
63
63
  return;
64
- const parsed = JSON.parse(readFileSync(this.file, "utf8"));
64
+ const raw = readFileSync(this.file, "utf8");
65
+ // A zero-byte file (e.g. pre-created with `touch`) is an empty store, not corruption;
66
+ // treating it as corrupt would disable persistence for the whole process.
67
+ if (!raw.trim())
68
+ return;
69
+ const parsed = JSON.parse(raw);
65
70
  if (!Array.isArray(parsed)) {
66
71
  console.error(`OAuth client store at ${this.file} is not a JSON array — ignoring it`);
67
72
  return;
package/build/http.js CHANGED
@@ -20,8 +20,18 @@ const ISSUER_URL = process.env.OAUTH_ISSUER_URL || `http://localhost:${PORT}`;
20
20
  const APP_URL = process.env.INISTATE_APP_URL || "https://app.inistate.com";
21
21
  const APP_LOGIN_PATH = process.env.INISTATE_APP_LOGIN_PATH || "/#/login";
22
22
  const app = express();
23
+ // Behind nginx (+ CloudFront) every socket peer is the proxy, so without this req.ip is the
24
+ // same for every caller and the per-IP rate limiters share one bucket across all users.
25
+ // Set TRUST_PROXY to the number of proxy hops in front of this process (nginx + CloudFront = 2).
26
+ const TRUST_PROXY = process.env.TRUST_PROXY;
27
+ if (TRUST_PROXY) {
28
+ app.set("trust proxy", /^\d+$/.test(TRUST_PROXY) ? Number(TRUST_PROXY) : TRUST_PROXY);
29
+ }
30
+ // DCR is unauthenticated and Claude registers from shared Anthropic egress IPs, so the SDK's
31
+ // default of 20/hour per IP locks out new users ("Couldn't register with Inistate's sign-in service").
32
+ const REGISTRATION_RATE_LIMIT = Number(process.env.OAUTH_REGISTRATION_RATE_LIMIT) || 300;
23
33
  /* ------------------------------------------------------------------ */
24
- /* CORS (must come before routes) */
34
+ /* CORS (must come before routes) */
25
35
  /* ------------------------------------------------------------------ */
26
36
  app.use((_req, res, next) => {
27
37
  res.setHeader("Access-Control-Allow-Origin", "*");
@@ -47,6 +57,7 @@ app.use(mcpAuthRouter({
47
57
  baseUrl: new URL(ISSUER_URL),
48
58
  resourceServerUrl: new URL("/mcp", ISSUER_URL),
49
59
  scopesSupported: SUPPORTED_SCOPES,
60
+ clientRegistrationOptions: { rateLimit: { max: REGISTRATION_RATE_LIMIT } },
50
61
  }));
51
62
  /* ------------------------------------------------------------------ */
52
63
  /* OAuth authorize callback (login page POSTs here) */
package/build/schema.d.ts CHANGED
@@ -4,6 +4,9 @@ export declare const FRONTEND_GUIDE: string;
4
4
  export declare const SCHEMA_RUNTIME: Record<string, any>;
5
5
  export declare const SCHEMA_CONFIGURE: Record<string, any>;
6
6
  export declare const VALID_FIELD_TYPES: string[];
7
+ export declare const AI_BLOCKED_CREATE_TYPES: Set<string>;
8
+ /** The field types an AI may create: what design_workflow offers. */
9
+ export declare const AI_CREATABLE_FIELD_TYPES: string[];
7
10
  export declare const RESERVED_ACTIVITY_NAMES: string[];
8
11
  export declare const RESERVED_INFORMATION_NAMES: string[];
9
12
  export declare const VALID_ACTOR_TYPES: string[];
package/build/schema.js CHANGED
@@ -95,6 +95,19 @@ export const SCHEMA_RUNTIME = buildSchemaView(RUNTIME_DEFINITIONS, RUNTIME_WORKF
95
95
  export const SCHEMA_CONFIGURE = buildSchemaView(CONFIGURE_DEFINITIONS, CONFIGURE_WORKFLOW_KEYS);
96
96
  // ---------- Derived lookups ----------
97
97
  export const VALID_FIELD_TYPES = SCHEMA.definitions.FieldType.enum;
98
+ // SS06300 (ruled 2026-10-16) - the types the platform refuses on a NEW field made by AI
99
+ // (McpCanvasTransformer.AiBlockedCreateTypeKeys): Date Range is internal, and a Formula needs an
100
+ // expression no MCP schema carries, so it would never compute. Existing fields of these types (they
101
+ // carry an id) round-trip on update untouched.
102
+ export const AI_BLOCKED_CREATE_TYPES = new Set(["daterange", "formula"]);
103
+ /** The field types an AI may create: what design_workflow offers. */
104
+ export const AI_CREATABLE_FIELD_TYPES = VALID_FIELD_TYPES.filter((t) => !AI_BLOCKED_CREATE_TYPES.has(t.toLowerCase()));
105
+ /** The platform's wording (McpCanvasTransformer.AiBlockedCreateTypeHintFor). */
106
+ function aiBlockedCreateHint(baseType) {
107
+ return baseType === "formula"
108
+ ? "'Formula' is an internal field type that cannot be created by AI: a formula field needs an expression, which cannot be given here, so it would never compute. Model the value as a Number or Currency field instead, and set the formula in Studio if it should be calculated."
109
+ : "'Date Range' is an internal field type that cannot be created by AI. Model a date range as two Date fields instead (e.g. 'Start Date' and 'End Date').";
110
+ }
98
111
  // SS06168 — Studio's reserved words (webApp src/components/commons/designValidator.js
99
112
  // activityReservedKeywords / informationReservedKeywords). Studio refuses a custom activity or
100
113
  // information field with one of these names and shows the module as "Configuration incomplete";
@@ -622,6 +635,10 @@ export function validateDesign(schema, mode = "create") {
622
635
  }
623
636
  const base = baseTypeOf(ftype);
624
637
  const hasConnection = typeof f.connection === "string" && f.connection.trim() !== "";
638
+ // SS06300: mirrors the platform - new fields only, so validate_design cannot pass what create_module refuses.
639
+ if (AI_BLOCKED_CREATE_TYPES.has(base) && (mode === "create" || !f.id)) {
640
+ errors.push(`Information field '${f.name}': ${aiBlockedCreateHint(base)}`);
641
+ }
625
642
  if ((base === "selection" || base === "tag")
626
643
  && (!f.options || f.options.length === 0)
627
644
  && !ftype.includes("(")) {
@@ -651,6 +668,10 @@ export function validateDesign(schema, mode = "create") {
651
668
  if (subType && !isValidFieldType(subType)) {
652
669
  errors.push(`Table field '${f.name}' sub-field '${sf.name}' has invalid type '${sf.type}'.`);
653
670
  }
671
+ if (subType && AI_BLOCKED_CREATE_TYPES.has(baseTypeOf(subType))
672
+ && (mode === "create" || !sf.id)) {
673
+ errors.push(`Sub-field '${sf.name}' in '${f.name}': ${aiBlockedCreateHint(baseTypeOf(subType))}`);
674
+ }
654
675
  if (subType && REFERENCE_TYPES_LOWER.has(baseTypeOf(subType))) {
655
676
  errors.push(`Table field '${f.name}' sub-field '${sf.name}' has type '${sf.type}' — Module/Modules/User/Users reference types are not supported inside Table sub-fields.`);
656
677
  }
@@ -1025,7 +1046,7 @@ export function normalizeIndustry(industry) {
1025
1046
  // Returned with every design_workflow call — the design funnel's first step is
1026
1047
  // where agents form their vocabulary, so the constraints ride along.
1027
1048
  const DESIGN_CONSTRAINTS = {
1028
- field_types: VALID_FIELD_TYPES,
1049
+ field_types: AI_CREATABLE_FIELD_TYPES,
1029
1050
  state_colors: VALID_COLORS,
1030
1051
  reference_fields: "User/Users/Module/Modules fields require 'connection': the name of a module that exists in this workspace. Not supported inside Table sub-fields.",
1031
1052
  actors: VALID_ACTOR_TYPES,
package/build/tools.js CHANGED
@@ -1162,6 +1162,11 @@ Load resource inistate://schema before modifying to know valid field types, colo
1162
1162
  body.due = due;
1163
1163
  if (ai)
1164
1164
  body.ai = ai;
1165
+ // SS06044: the platform checks the approval itself where it matters - the `comment`
1166
+ // standard (hybrid) and an App module's hybrid-tier email recipients (SS05963) - so
1167
+ // the guard's `confirmed` has to travel with the call, not stop at the guard.
1168
+ if (confirmed === true)
1169
+ body.confirmed = true;
1165
1170
  if (idempotencyKey)
1166
1171
  body.idempotencyKey = idempotencyKey;
1167
1172
  if (expectedVersion !== undefined)
@@ -1423,6 +1428,10 @@ Load resource inistate://schema before modifying to know valid field types, colo
1423
1428
  };
1424
1429
  if (ai)
1425
1430
  body.ai = ai;
1431
+ // SS06342: as submit_activity (SS06044) - the platform re-checks the approval itself for
1432
+ // an App send whose recipients need one, so the guard's `confirmed` travels with the call.
1433
+ if (confirmed === true)
1434
+ body.confirmed = true;
1426
1435
  log("submit_activities", `module=${moduleName} activity=${activity} count=${items.length}`);
1427
1436
  const data = (await backend.submitActivities(body));
1428
1437
  const results = Array.isArray(data.results)
@@ -186,6 +186,16 @@
186
186
  "type": "array",
187
187
  "items": { "type": "string" },
188
188
  "description": "Subset of allowed options for Selection/Tag fields in this activity. Options may include emoji prefixes. Omit to allow all options."
189
+ },
190
+ "hidden": {
191
+ "type": "boolean",
192
+ "readOnly": true,
193
+ "description": "Read back only (get_module_canvas): this activity's form never shows the field - the designer turned it off and gave it no condition. Same rule get_form reports; submit_activity refuses a value for it. Ignored on input (update_module does not set visibility)."
194
+ },
195
+ "visibleWhen": {
196
+ "type": "string",
197
+ "readOnly": true,
198
+ "description": "Read back only (get_module_canvas): the form shows the field only while this condition holds, written in display names, e.g. {{Skip Reason}}=='Other'. A required field with a condition is required only while it is shown. Ignored on input."
189
199
  }
190
200
  },
191
201
  "additionalProperties": false
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "inistate-mcp",
3
3
  "mcpName": "io.github.Inistate/inistate-mcp",
4
- "version": "1.3.1",
4
+ "version": "1.3.2",
5
5
  "description": "MCP server for the Inistate platform — no-code apps creation powered by AI",
6
6
  "type": "module",
7
7
  "author": "Inistate",
package/server.json CHANGED
@@ -8,13 +8,13 @@
8
8
  "url": "https://github.com/inistate/inistate-mcp",
9
9
  "source": "github"
10
10
  },
11
- "version": "1.3.1",
11
+ "version": "1.3.2",
12
12
  "packages": [
13
13
  {
14
14
  "registryType": "npm",
15
15
  "registryBaseUrl": "https://registry.npmjs.org",
16
16
  "identifier": "inistate-mcp",
17
- "version": "1.3.1",
17
+ "version": "1.3.2",
18
18
  "transport": {
19
19
  "type": "stdio"
20
20
  },