@fluentcommerce/fluent-mcp-extn 0.7.3 → 0.7.4

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/README.md CHANGED
@@ -50,7 +50,7 @@ The official `fluent mcp server` (bundled with Fluent CLI) covers core GraphQL a
50
50
  | Auto-paginated GraphQL (`graphql_queryAll`) | | Yes |
51
51
  | GraphQL planning helpers (`graphql_planOperation` / `graphql_buildQuery` / `graphql_generateFull`) | | Yes |
52
52
  | Batch mutations (`graphql_batchMutate`) | | Yes |
53
- | Batch ingestion (`batch.*`) | | Yes |
53
+ | Batch ingestion (`batch_*`) | | Yes |
54
54
  | Batch payload planning (`batch_describePayload`) | | Yes |
55
55
  | Prometheus metrics (`metrics_query`) | | Yes |
56
56
  | Metrics health assessment (`metrics_healthCheck`) | | Yes |
@@ -295,6 +295,14 @@ npx @fluentcommerce/fluent-mcp-extn
295
295
 
296
296
  This starts the MCP stdio server process. In a plain terminal it appears idle because it is waiting for MCP JSON-RPC input from your IDE/agent.
297
297
 
298
+ To run with **Streamable HTTP** transport instead of stdio:
299
+
300
+ ```bash
301
+ FLUENT_MCP_TRANSPORT=http npx @fluentcommerce/fluent-mcp-extn
302
+ ```
303
+
304
+ This starts an HTTP server (default port 3100, override with `FLUENT_MCP_HTTP_PORT`). Set `FLUENT_MCP_AUTH_TOKEN` to enable bearer token authentication. Useful for remote MCP clients or multi-agent setups where stdio is not practical.
305
+
298
306
  Or install as a project dependency:
299
307
 
300
308
  ```bash
@@ -419,7 +427,7 @@ Example:
419
427
  }
420
428
  ```
421
429
 
422
- Typical category values: `config`, `health`, `connection`, `event`, `metrics`, `workflow`, `plugin`, `graphql`, `batch`, `webhook`, `entity`, `setting`, `environment`, `test`, `cache`.
430
+ Typical category values: `config`, `health`, `time`, `connection`, `event`, `metrics`, `workflow`, `plugin`, `graphql`, `batch`, `webhook`, `entity`, `setting`, `environment`, `test`, `cache`.
423
431
 
424
432
  This is a prompt-budget optimization, not an access-control boundary. It reduces what the MCP client discovers, but it does not block an explicit low-level `tools/call` if a caller already knows a hidden tool name.
425
433
 
@@ -538,7 +546,7 @@ Compare workflow versions across retailers:
538
546
  ```
539
547
  1. workflow_get { entityType: "ORDER", entitySubtype: "HD", profile: "STAGING/UK" }
540
548
  2. workflow_get { entityType: "ORDER", entitySubtype: "HD", profile: "STAGING/US" }
541
- 3. workflow_diff { left: <uk-workflow>, right: <us-workflow> }
549
+ 3. workflow_diff { base: <uk-workflow>, target: <us-workflow> }
542
550
  ```
543
551
 
544
552
  ### Cache
@@ -1198,7 +1206,7 @@ See the [Getting Started](https://www.npmjs.com/package/@fluentcommerce/ai-skill
1198
1206
  ```bash
1199
1207
  git clone https://bitbucket.org/fluentcommerce/fluent-mcp-extn.git
1200
1208
  cd fluent-mcp-extn
1201
- npm install && npm run build && npm test # 524 unit tests across 23 test files
1209
+ npm install && npm run build && npm test # 601 unit tests across 25 test files
1202
1210
  npm run dev # hot-reload via tsx
1203
1211
  ```
1204
1212
 
@@ -175,6 +175,27 @@ function analyzePaginationLimits(pagination, limits) {
175
175
  warning: `Auto-pagination may be truncated by the ${reasons.join(" and ")}. Narrow the query or raise the limit if you need a complete result.`,
176
176
  };
177
177
  }
178
+ /**
179
+ * Count actual edges in the merged response data.
180
+ * Guards against SDK metadata bugs where totalRecords is computed
181
+ * as totalPages × pageSize instead of the true accumulated count.
182
+ */
183
+ function countConnectionEdges(result) {
184
+ if (!result || typeof result !== "object")
185
+ return null;
186
+ const data = result.data;
187
+ if (!data || typeof data !== "object")
188
+ return null;
189
+ for (const val of Object.values(data)) {
190
+ if (!val || typeof val !== "object")
191
+ continue;
192
+ const connection = val;
193
+ if (Array.isArray(connection.edges)) {
194
+ return connection.edges.length;
195
+ }
196
+ }
197
+ return null;
198
+ }
178
199
  // ---------------------------------------------------------------------------
179
200
  // Handlers
180
201
  // ---------------------------------------------------------------------------
@@ -217,7 +238,25 @@ export async function handleGraphQLQueryAll(args, ctx) {
217
238
  errorHandling: parsed.errorHandling,
218
239
  };
219
240
  const result = await client.graphqlPaginated(payload);
220
- const pagination = result.extensions?.autoPagination ?? null;
241
+ const rawPagination = result.extensions?.autoPagination ?? null;
242
+ // Reconcile SDK metadata: the SDK may report totalRecords as
243
+ // totalPages × pageSize instead of the true accumulated count.
244
+ // Count the actual edges in the merged response to detect and fix this.
245
+ const actualEdgeCount = countConnectionEdges(result);
246
+ let pagination = rawPagination;
247
+ if (rawPagination &&
248
+ typeof rawPagination === "object" &&
249
+ actualEdgeCount !== null) {
250
+ const sdkTotal = rawPagination.totalRecords;
251
+ if (typeof sdkTotal === "number" && sdkTotal !== actualEdgeCount) {
252
+ const corrected = {
253
+ ...rawPagination,
254
+ totalRecords: actualEdgeCount,
255
+ _sdkReportedRecords: sdkTotal,
256
+ };
257
+ pagination = corrected;
258
+ }
259
+ }
221
260
  const paginationInfo = pagination && typeof pagination === "object"
222
261
  ? pagination
223
262
  : null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentcommerce/fluent-mcp-extn",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "[Experimental] MCP (Model Context Protocol) extension server for Fluent Commerce. Exposes event dispatch, transition actions, GraphQL execution, Prometheus metrics, batch ingestion, and webhook validation as MCP tools.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -52,7 +52,7 @@
52
52
  "node": ">=20.0.0"
53
53
  },
54
54
  "dependencies": {
55
- "@fluentcommerce/fc-connect-sdk": "^0.1.54",
55
+ "@fluentcommerce/fc-connect-sdk": "^0.1.55",
56
56
  "@modelcontextprotocol/sdk": "^1.27.1",
57
57
  "graphql": "^16.13.1",
58
58
  "zod": "^4.3.6"