This is page 1 of 43. Use http://codebase.md/taurgis/sfcc-dev-mcp?page={x} to view the full context. # Directory Structure ``` ├── .DS_Store ├── .github │ ├── dependabot.yml │ ├── instructions │ │ ├── mcp-node-tests.instructions.md │ │ └── mcp-yml-tests.instructions.md │ ├── ISSUE_TEMPLATE │ │ ├── bug_report.yml │ │ ├── config.yml │ │ ├── documentation.yml │ │ ├── feature_request.yml │ │ └── question.yml │ ├── PULL_REQUEST_TEMPLATE │ │ ├── bug_fix.md │ │ ├── documentation.md │ │ └── new_tool.md │ ├── pull_request_template.md │ └── workflows │ ├── ci.yml │ ├── deploy-pages.yml │ ├── publish.yml │ └── update-docs.yml ├── .gitignore ├── .husky │ └── pre-commit ├── aegis.config.docs-only.json ├── aegis.config.json ├── aegis.config.with-dw.json ├── AGENTS.md ├── ai-instructions │ ├── claude-desktop │ │ └── claude_custom_instructions.md │ ├── cursor │ │ └── .cursor │ │ └── rules │ │ ├── debugging-workflows.mdc │ │ ├── hooks-development.mdc │ │ ├── isml-templates.mdc │ │ ├── job-framework.mdc │ │ ├── performance-optimization.mdc │ │ ├── scapi-endpoints.mdc │ │ ├── security-patterns.mdc │ │ ├── sfcc-development.mdc │ │ ├── sfra-controllers.mdc │ │ ├── sfra-models.mdc │ │ ├── system-objects.mdc │ │ └── testing-patterns.mdc │ └── github-copilot │ └── copilot-instructions.md ├── CHANGELOG.md ├── CONTRIBUTING.md ├── docs │ ├── best-practices │ │ ├── cartridge_creation.md │ │ ├── isml_templates.md │ │ ├── job_framework.md │ │ ├── localserviceregistry.md │ │ ├── ocapi_hooks.md │ │ ├── performance.md │ │ ├── scapi_custom_endpoint.md │ │ ├── scapi_hooks.md │ │ ├── security.md │ │ ├── sfra_client_side_js.md │ │ ├── sfra_controllers.md │ │ ├── sfra_models.md │ │ └── sfra_scss.md │ ├── dw_campaign │ │ ├── ABTest.md │ │ ├── ABTestMgr.md │ │ ├── ABTestSegment.md │ │ ├── AmountDiscount.md │ │ ├── ApproachingDiscount.md │ │ ├── BonusChoiceDiscount.md │ │ ├── BonusDiscount.md │ │ ├── Campaign.md │ │ ├── CampaignMgr.md │ │ ├── CampaignStatusCodes.md │ │ ├── Coupon.md │ │ ├── CouponMgr.md │ │ ├── CouponRedemption.md │ │ ├── CouponStatusCodes.md │ │ ├── Discount.md │ │ ├── DiscountPlan.md │ │ ├── FixedPriceDiscount.md │ │ ├── FixedPriceShippingDiscount.md │ │ ├── FreeDiscount.md │ │ ├── FreeShippingDiscount.md │ │ ├── PercentageDiscount.md │ │ ├── PercentageOptionDiscount.md │ │ ├── PriceBookPriceDiscount.md │ │ ├── Promotion.md │ │ ├── PromotionMgr.md │ │ ├── PromotionPlan.md │ │ ├── SlotContent.md │ │ ├── SourceCodeGroup.md │ │ ├── SourceCodeInfo.md │ │ ├── SourceCodeStatusCodes.md │ │ └── TotalFixedPriceDiscount.md │ ├── dw_catalog │ │ ├── Catalog.md │ │ ├── CatalogMgr.md │ │ ├── Category.md │ │ ├── CategoryAssignment.md │ │ ├── CategoryLink.md │ │ ├── PriceBook.md │ │ ├── PriceBookMgr.md │ │ ├── Product.md │ │ ├── ProductActiveData.md │ │ ├── ProductAttributeModel.md │ │ ├── ProductAvailabilityLevels.md │ │ ├── ProductAvailabilityModel.md │ │ ├── ProductInventoryList.md │ │ ├── ProductInventoryMgr.md │ │ ├── ProductInventoryRecord.md │ │ ├── ProductLink.md │ │ ├── ProductMgr.md │ │ ├── ProductOption.md │ │ ├── ProductOptionModel.md │ │ ├── ProductOptionValue.md │ │ ├── ProductPriceInfo.md │ │ ├── ProductPriceModel.md │ │ ├── ProductPriceTable.md │ │ ├── ProductSearchHit.md │ │ ├── ProductSearchModel.md │ │ ├── ProductSearchRefinementDefinition.md │ │ ├── ProductSearchRefinements.md │ │ ├── ProductSearchRefinementValue.md │ │ ├── ProductVariationAttribute.md │ │ ├── ProductVariationAttributeValue.md │ │ ├── ProductVariationModel.md │ │ ├── Recommendation.md │ │ ├── SearchModel.md │ │ ├── SearchRefinementDefinition.md │ │ ├── SearchRefinements.md │ │ ├── SearchRefinementValue.md │ │ ├── SortingOption.md │ │ ├── SortingRule.md │ │ ├── Store.md │ │ ├── StoreGroup.md │ │ ├── StoreInventoryFilter.md │ │ ├── StoreInventoryFilterValue.md │ │ ├── StoreMgr.md │ │ ├── Variant.md │ │ └── VariationGroup.md │ ├── dw_content │ │ ├── Content.md │ │ ├── ContentMgr.md │ │ ├── ContentSearchModel.md │ │ ├── ContentSearchRefinementDefinition.md │ │ ├── ContentSearchRefinements.md │ │ ├── ContentSearchRefinementValue.md │ │ ├── Folder.md │ │ ├── Library.md │ │ ├── MarkupText.md │ │ └── MediaFile.md │ ├── dw_crypto │ │ ├── CertificateRef.md │ │ ├── CertificateUtils.md │ │ ├── Cipher.md │ │ ├── Encoding.md │ │ ├── JWE.md │ │ ├── JWEHeader.md │ │ ├── JWS.md │ │ ├── JWSHeader.md │ │ ├── KeyRef.md │ │ ├── Mac.md │ │ ├── MessageDigest.md │ │ ├── SecureRandom.md │ │ ├── Signature.md │ │ ├── WeakCipher.md │ │ ├── WeakMac.md │ │ ├── WeakMessageDigest.md │ │ ├── WeakSignature.md │ │ └── X509Certificate.md │ ├── dw_customer │ │ ├── AddressBook.md │ │ ├── AgentUserMgr.md │ │ ├── AgentUserStatusCodes.md │ │ ├── AuthenticationStatus.md │ │ ├── Credentials.md │ │ ├── Customer.md │ │ ├── CustomerActiveData.md │ │ ├── CustomerAddress.md │ │ ├── CustomerCDPData.md │ │ ├── CustomerContextMgr.md │ │ ├── CustomerGroup.md │ │ ├── CustomerList.md │ │ ├── CustomerMgr.md │ │ ├── CustomerPasswordConstraints.md │ │ ├── CustomerPaymentInstrument.md │ │ ├── CustomerStatusCodes.md │ │ ├── EncryptedObject.md │ │ ├── ExternalProfile.md │ │ ├── OrderHistory.md │ │ ├── ProductList.md │ │ ├── ProductListItem.md │ │ ├── ProductListItemPurchase.md │ │ ├── ProductListMgr.md │ │ ├── ProductListRegistrant.md │ │ ├── Profile.md │ │ └── Wallet.md │ ├── dw_extensions.applepay │ │ ├── ApplePayHookResult.md │ │ └── ApplePayHooks.md │ ├── dw_extensions.facebook │ │ ├── FacebookFeedHooks.md │ │ └── FacebookProduct.md │ ├── dw_extensions.paymentrequest │ │ ├── PaymentRequestHookResult.md │ │ └── PaymentRequestHooks.md │ ├── dw_extensions.payments │ │ ├── SalesforceBancontactPaymentDetails.md │ │ ├── SalesforceCardPaymentDetails.md │ │ ├── SalesforceEpsPaymentDetails.md │ │ ├── SalesforceIdealPaymentDetails.md │ │ ├── SalesforceKlarnaPaymentDetails.md │ │ ├── SalesforcePaymentDetails.md │ │ ├── SalesforcePaymentIntent.md │ │ ├── SalesforcePaymentMethod.md │ │ ├── SalesforcePaymentRequest.md │ │ ├── SalesforcePaymentsHooks.md │ │ ├── SalesforcePaymentsMgr.md │ │ ├── SalesforcePaymentsSiteConfiguration.md │ │ ├── SalesforcePayPalOrder.md │ │ ├── SalesforcePayPalOrderAddress.md │ │ ├── SalesforcePayPalOrderPayer.md │ │ ├── SalesforcePayPalPaymentDetails.md │ │ ├── SalesforceSepaDebitPaymentDetails.md │ │ └── SalesforceVenmoPaymentDetails.md │ ├── dw_extensions.pinterest │ │ ├── PinterestAvailability.md │ │ ├── PinterestFeedHooks.md │ │ ├── PinterestOrder.md │ │ ├── PinterestOrderHooks.md │ │ └── PinterestProduct.md │ ├── dw_io │ │ ├── CSVStreamReader.md │ │ ├── CSVStreamWriter.md │ │ ├── File.md │ │ ├── FileReader.md │ │ ├── FileWriter.md │ │ ├── InputStream.md │ │ ├── OutputStream.md │ │ ├── PrintWriter.md │ │ ├── RandomAccessFileReader.md │ │ ├── Reader.md │ │ ├── StringWriter.md │ │ ├── Writer.md │ │ ├── XMLIndentingStreamWriter.md │ │ ├── XMLStreamConstants.md │ │ ├── XMLStreamReader.md │ │ └── XMLStreamWriter.md │ ├── dw_job │ │ ├── JobExecution.md │ │ └── JobStepExecution.md │ ├── dw_net │ │ ├── FTPClient.md │ │ ├── FTPFileInfo.md │ │ ├── HTTPClient.md │ │ ├── HTTPRequestPart.md │ │ ├── Mail.md │ │ ├── SFTPClient.md │ │ ├── SFTPFileInfo.md │ │ ├── WebDAVClient.md │ │ └── WebDAVFileInfo.md │ ├── dw_object │ │ ├── ActiveData.md │ │ ├── CustomAttributes.md │ │ ├── CustomObject.md │ │ ├── CustomObjectMgr.md │ │ ├── Extensible.md │ │ ├── ExtensibleObject.md │ │ ├── Note.md │ │ ├── ObjectAttributeDefinition.md │ │ ├── ObjectAttributeGroup.md │ │ ├── ObjectAttributeValueDefinition.md │ │ ├── ObjectTypeDefinition.md │ │ ├── PersistentObject.md │ │ ├── SimpleExtensible.md │ │ └── SystemObjectMgr.md │ ├── dw_order │ │ ├── AbstractItem.md │ │ ├── AbstractItemCtnr.md │ │ ├── Appeasement.md │ │ ├── AppeasementItem.md │ │ ├── Basket.md │ │ ├── BasketMgr.md │ │ ├── BonusDiscountLineItem.md │ │ ├── CouponLineItem.md │ │ ├── CreateAgentBasketLimitExceededException.md │ │ ├── CreateBasketFromOrderException.md │ │ ├── CreateCouponLineItemException.md │ │ ├── CreateOrderException.md │ │ ├── CreateTemporaryBasketLimitExceededException.md │ │ ├── GiftCertificate.md │ │ ├── GiftCertificateLineItem.md │ │ ├── GiftCertificateMgr.md │ │ ├── GiftCertificateStatusCodes.md │ │ ├── Invoice.md │ │ ├── InvoiceItem.md │ │ ├── LineItem.md │ │ ├── LineItemCtnr.md │ │ ├── Order.md │ │ ├── OrderAddress.md │ │ ├── OrderItem.md │ │ ├── OrderMgr.md │ │ ├── OrderPaymentInstrument.md │ │ ├── OrderProcessStatusCodes.md │ │ ├── PaymentCard.md │ │ ├── PaymentInstrument.md │ │ ├── PaymentMethod.md │ │ ├── PaymentMgr.md │ │ ├── PaymentProcessor.md │ │ ├── PaymentStatusCodes.md │ │ ├── PaymentTransaction.md │ │ ├── PriceAdjustment.md │ │ ├── PriceAdjustmentLimitTypes.md │ │ ├── ProductLineItem.md │ │ ├── ProductShippingCost.md │ │ ├── ProductShippingLineItem.md │ │ ├── ProductShippingModel.md │ │ ├── Return.md │ │ ├── ReturnCase.md │ │ ├── ReturnCaseItem.md │ │ ├── ReturnItem.md │ │ ├── Shipment.md │ │ ├── ShipmentShippingCost.md │ │ ├── ShipmentShippingModel.md │ │ ├── ShippingLineItem.md │ │ ├── ShippingLocation.md │ │ ├── ShippingMethod.md │ │ ├── ShippingMgr.md │ │ ├── ShippingOrder.md │ │ ├── ShippingOrderItem.md │ │ ├── SumItem.md │ │ ├── TaxGroup.md │ │ ├── TaxItem.md │ │ ├── TaxMgr.md │ │ ├── TrackingInfo.md │ │ └── TrackingRef.md │ ├── dw_order.hooks │ │ ├── CalculateHooks.md │ │ ├── OrderHooks.md │ │ ├── PaymentHooks.md │ │ ├── ReturnHooks.md │ │ └── ShippingOrderHooks.md │ ├── dw_rpc │ │ ├── SOAPUtil.md │ │ ├── Stub.md │ │ └── WebReference.md │ ├── dw_suggest │ │ ├── BrandSuggestions.md │ │ ├── CategorySuggestions.md │ │ ├── ContentSuggestions.md │ │ ├── CustomSuggestions.md │ │ ├── ProductSuggestions.md │ │ ├── SearchPhraseSuggestions.md │ │ ├── SuggestedCategory.md │ │ ├── SuggestedContent.md │ │ ├── SuggestedPhrase.md │ │ ├── SuggestedProduct.md │ │ ├── SuggestedTerm.md │ │ ├── SuggestedTerms.md │ │ ├── Suggestions.md │ │ └── SuggestModel.md │ ├── dw_svc │ │ ├── FTPService.md │ │ ├── FTPServiceDefinition.md │ │ ├── HTTPFormService.md │ │ ├── HTTPFormServiceDefinition.md │ │ ├── HTTPService.md │ │ ├── HTTPServiceDefinition.md │ │ ├── LocalServiceRegistry.md │ │ ├── Result.md │ │ ├── Service.md │ │ ├── ServiceCallback.md │ │ ├── ServiceConfig.md │ │ ├── ServiceCredential.md │ │ ├── ServiceDefinition.md │ │ ├── ServiceProfile.md │ │ ├── ServiceRegistry.md │ │ ├── SOAPService.md │ │ └── SOAPServiceDefinition.md │ ├── dw_system │ │ ├── AgentUserStatusCodes.md │ │ ├── Cache.md │ │ ├── CacheMgr.md │ │ ├── HookMgr.md │ │ ├── InternalObject.md │ │ ├── JobProcessMonitor.md │ │ ├── Log.md │ │ ├── Logger.md │ │ ├── LogNDC.md │ │ ├── OrganizationPreferences.md │ │ ├── Pipeline.md │ │ ├── PipelineDictionary.md │ │ ├── RemoteInclude.md │ │ ├── Request.md │ │ ├── RequestHooks.md │ │ ├── Response.md │ │ ├── RESTErrorResponse.md │ │ ├── RESTResponseMgr.md │ │ ├── RESTSuccessResponse.md │ │ ├── SearchStatus.md │ │ ├── Session.md │ │ ├── Site.md │ │ ├── SitePreferences.md │ │ ├── Status.md │ │ ├── StatusItem.md │ │ ├── System.md │ │ └── Transaction.md │ ├── dw_util │ │ ├── ArrayList.md │ │ ├── Assert.md │ │ ├── BigInteger.md │ │ ├── Bytes.md │ │ ├── Calendar.md │ │ ├── Collection.md │ │ ├── Currency.md │ │ ├── DateUtils.md │ │ ├── Decimal.md │ │ ├── FilteringCollection.md │ │ ├── Geolocation.md │ │ ├── HashMap.md │ │ ├── HashSet.md │ │ ├── Iterator.md │ │ ├── LinkedHashMap.md │ │ ├── LinkedHashSet.md │ │ ├── List.md │ │ ├── Locale.md │ │ ├── Map.md │ │ ├── MapEntry.md │ │ ├── MappingKey.md │ │ ├── MappingMgr.md │ │ ├── PropertyComparator.md │ │ ├── SecureEncoder.md │ │ ├── SecureFilter.md │ │ ├── SeekableIterator.md │ │ ├── Set.md │ │ ├── SortedMap.md │ │ ├── SortedSet.md │ │ ├── StringUtils.md │ │ ├── Template.md │ │ └── UUIDUtils.md │ ├── dw_value │ │ ├── EnumValue.md │ │ ├── MimeEncodedText.md │ │ ├── Money.md │ │ └── Quantity.md │ ├── dw_web │ │ ├── ClickStream.md │ │ ├── ClickStreamEntry.md │ │ ├── Cookie.md │ │ ├── Cookies.md │ │ ├── CSRFProtection.md │ │ ├── Form.md │ │ ├── FormAction.md │ │ ├── FormElement.md │ │ ├── FormElementValidationResult.md │ │ ├── FormField.md │ │ ├── FormFieldOption.md │ │ ├── FormFieldOptions.md │ │ ├── FormGroup.md │ │ ├── FormList.md │ │ ├── FormListItem.md │ │ ├── Forms.md │ │ ├── HttpParameter.md │ │ ├── HttpParameterMap.md │ │ ├── LoopIterator.md │ │ ├── PageMetaData.md │ │ ├── PageMetaTag.md │ │ ├── PagingModel.md │ │ ├── Resource.md │ │ ├── URL.md │ │ ├── URLAction.md │ │ ├── URLParameter.md │ │ ├── URLRedirect.md │ │ ├── URLRedirectMgr.md │ │ └── URLUtils.md │ ├── sfra │ │ ├── account.md │ │ ├── address.md │ │ ├── billing.md │ │ ├── cart.md │ │ ├── categories.md │ │ ├── content.md │ │ ├── locale.md │ │ ├── order.md │ │ ├── payment.md │ │ ├── price-default.md │ │ ├── price-range.md │ │ ├── price-tiered.md │ │ ├── product-bundle.md │ │ ├── product-full.md │ │ ├── product-line-items.md │ │ ├── product-search.md │ │ ├── product-tile.md │ │ ├── querystring.md │ │ ├── render.md │ │ ├── request.md │ │ ├── response.md │ │ ├── server.md │ │ ├── shipping.md │ │ ├── store.md │ │ ├── stores.md │ │ └── totals.md │ └── TopLevel │ ├── APIException.md │ ├── arguments.md │ ├── Array.md │ ├── ArrayBuffer.md │ ├── BigInt.md │ ├── Boolean.md │ ├── ConversionError.md │ ├── DataView.md │ ├── Date.md │ ├── Error.md │ ├── ES6Iterator.md │ ├── EvalError.md │ ├── Fault.md │ ├── Float32Array.md │ ├── Float64Array.md │ ├── Function.md │ ├── Generator.md │ ├── global.md │ ├── Int16Array.md │ ├── Int32Array.md │ ├── Int8Array.md │ ├── InternalError.md │ ├── IOError.md │ ├── Iterable.md │ ├── Iterator.md │ ├── JSON.md │ ├── Map.md │ ├── Math.md │ ├── Module.md │ ├── Namespace.md │ ├── Number.md │ ├── Object.md │ ├── QName.md │ ├── RangeError.md │ ├── ReferenceError.md │ ├── RegExp.md │ ├── Set.md │ ├── StopIteration.md │ ├── String.md │ ├── Symbol.md │ ├── SyntaxError.md │ ├── SystemError.md │ ├── TypeError.md │ ├── Uint16Array.md │ ├── Uint32Array.md │ ├── Uint8Array.md │ ├── Uint8ClampedArray.md │ ├── URIError.md │ ├── WeakMap.md │ ├── WeakSet.md │ ├── XML.md │ ├── XMLList.md │ └── XMLStreamError.md ├── docs-site │ ├── .gitignore │ ├── App.tsx │ ├── components │ │ ├── Badge.tsx │ │ ├── BreadcrumbSchema.tsx │ │ ├── CodeBlock.tsx │ │ ├── Collapsible.tsx │ │ ├── ConfigBuilder.tsx │ │ ├── ConfigHero.tsx │ │ ├── ConfigModeTabs.tsx │ │ ├── icons.tsx │ │ ├── Layout.tsx │ │ ├── LightCodeContainer.tsx │ │ ├── NewcomerCTA.tsx │ │ ├── NextStepsStrip.tsx │ │ ├── OnThisPage.tsx │ │ ├── Search.tsx │ │ ├── SEO.tsx │ │ ├── Sidebar.tsx │ │ ├── StructuredData.tsx │ │ ├── ToolCard.tsx │ │ ├── ToolFilters.tsx │ │ ├── Typography.tsx │ │ └── VersionBadge.tsx │ ├── constants.tsx │ ├── index.html │ ├── main.tsx │ ├── metadata.json │ ├── package-lock.json │ ├── package.json │ ├── pages │ │ ├── AIInterfacesPage.tsx │ │ ├── ConfigurationPage.tsx │ │ ├── DevelopmentPage.tsx │ │ ├── ExamplesPage.tsx │ │ ├── FeaturesPage.tsx │ │ ├── HomePage.tsx │ │ ├── SecurityPage.tsx │ │ ├── ToolsPage.tsx │ │ └── TroubleshootingPage.tsx │ ├── postcss.config.js │ ├── public │ │ ├── .well-known │ │ │ └── security.txt │ │ ├── 404.html │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-512x512.png │ │ ├── apple-touch-icon.png │ │ ├── explain-product-pricing-methods-no-mcp.png │ │ ├── explain-product-pricing-methods.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ ├── llms.txt │ │ ├── robots.txt │ │ ├── site.webmanifest │ │ └── sitemap.xml │ ├── README.md │ ├── scripts │ │ ├── generate-search-index.js │ │ ├── generate-sitemap.js │ │ └── search-dev.js │ ├── src │ │ └── styles │ │ ├── input.css │ │ └── prism-theme.css │ ├── tailwind.config.js │ ├── tsconfig.json │ ├── types.ts │ ├── utils │ │ ├── search.ts │ │ └── toolsData.ts │ └── vite.config.ts ├── eslint.config.js ├── jest.config.js ├── LICENSE ├── package-lock.json ├── package.json ├── README.md ├── scripts │ └── convert-docs.js ├── SECURITY.md ├── server.json ├── src │ ├── clients │ │ ├── base │ │ │ ├── http-client.ts │ │ │ ├── oauth-token.ts │ │ │ └── ocapi-auth-client.ts │ │ ├── best-practices-client.ts │ │ ├── cartridge-generation-client.ts │ │ ├── docs │ │ │ ├── class-content-parser.ts │ │ │ ├── class-name-resolver.ts │ │ │ ├── documentation-scanner.ts │ │ │ ├── index.ts │ │ │ └── referenced-types-extractor.ts │ │ ├── docs-client.ts │ │ ├── log-client.ts │ │ ├── logs │ │ │ ├── index.ts │ │ │ ├── log-analyzer.ts │ │ │ ├── log-client.ts │ │ │ ├── log-constants.ts │ │ │ ├── log-file-discovery.ts │ │ │ ├── log-file-reader.ts │ │ │ ├── log-formatter.ts │ │ │ ├── log-processor.ts │ │ │ ├── log-types.ts │ │ │ └── webdav-client-manager.ts │ │ ├── ocapi │ │ │ ├── code-versions-client.ts │ │ │ ├── site-preferences-client.ts │ │ │ └── system-objects-client.ts │ │ ├── ocapi-client.ts │ │ └── sfra-client.ts │ ├── config │ │ ├── configuration-factory.ts │ │ └── dw-json-loader.ts │ ├── core │ │ ├── handlers │ │ │ ├── abstract-log-tool-handler.ts │ │ │ ├── base-handler.ts │ │ │ ├── best-practices-handler.ts │ │ │ ├── cartridge-handler.ts │ │ │ ├── client-factory.ts │ │ │ ├── code-version-handler.ts │ │ │ ├── docs-handler.ts │ │ │ ├── job-log-handler.ts │ │ │ ├── job-log-tool-config.ts │ │ │ ├── log-handler.ts │ │ │ ├── log-tool-config.ts │ │ │ ├── sfra-handler.ts │ │ │ ├── system-object-handler.ts │ │ │ └── validation-helpers.ts │ │ ├── server.ts │ │ └── tool-definitions.ts │ ├── index.ts │ ├── main.ts │ ├── services │ │ ├── file-system-service.ts │ │ ├── index.ts │ │ └── path-service.ts │ ├── tool-configs │ │ ├── best-practices-tool-config.ts │ │ ├── cartridge-tool-config.ts │ │ ├── code-version-tool-config.ts │ │ ├── docs-tool-config.ts │ │ ├── job-log-tool-config.ts │ │ ├── log-tool-config.ts │ │ ├── sfra-tool-config.ts │ │ └── system-object-tool-config.ts │ ├── types │ │ └── types.ts │ └── utils │ ├── cache.ts │ ├── job-log-tool-config.ts │ ├── job-log-utils.ts │ ├── log-cache.ts │ ├── log-tool-config.ts │ ├── log-tool-constants.ts │ ├── log-tool-utils.ts │ ├── logger.ts │ ├── ocapi-url-builder.ts │ ├── path-resolver.ts │ ├── query-builder.ts │ ├── utils.ts │ └── validator.ts ├── tests │ ├── __mocks__ │ │ ├── docs-client.ts │ │ ├── src │ │ │ └── clients │ │ │ └── base │ │ │ └── http-client.js │ │ └── webdav.js │ ├── base-handler.test.ts │ ├── base-http-client.test.ts │ ├── best-practices-handler.test.ts │ ├── cache.test.ts │ ├── cartridge-handler.test.ts │ ├── class-content-parser.test.ts │ ├── class-name-resolver.test.ts │ ├── client-factory.test.ts │ ├── code-version-handler.test.ts │ ├── code-versions-client.test.ts │ ├── config.test.ts │ ├── configuration-factory.test.ts │ ├── docs-handler.test.ts │ ├── documentation-scanner.test.ts │ ├── file-system-service.test.ts │ ├── job-log-handler.test.ts │ ├── job-log-utils.test.ts │ ├── log-client.test.ts │ ├── log-handler.test.ts │ ├── log-processor.test.ts │ ├── logger.test.ts │ ├── mcp │ │ ├── AGENTS.md │ │ ├── node │ │ │ ├── activate-code-version-advanced.full-mode.programmatic.test.js │ │ │ ├── code-versions.full-mode.programmatic.test.js │ │ │ ├── generate-cartridge-structure.docs-only.programmatic.test.js │ │ │ ├── get-available-best-practice-guides.docs-only.programmatic.test.js │ │ │ ├── get-available-sfra-documents.programmatic.test.js │ │ │ ├── get-best-practice-guide.docs-only.programmatic.test.js │ │ │ ├── get-hook-reference.docs-only.programmatic.test.js │ │ │ ├── get-job-execution-summary.full-mode.programmatic.test.js │ │ │ ├── get-job-log-entries.full-mode.programmatic.test.js │ │ │ ├── get-latest-debug.full-mode.programmatic.test.js │ │ │ ├── get-latest-error.full-mode.programmatic.test.js │ │ │ ├── get-latest-info.full-mode.programmatic.test.js │ │ │ ├── get-latest-job-log-files.full-mode.programmatic.test.js │ │ │ ├── get-latest-warn.full-mode.programmatic.test.js │ │ │ ├── get-log-file-contents.full-mode.programmatic.test.js │ │ │ ├── get-sfcc-class-documentation.docs-only.programmatic.test.js │ │ │ ├── get-sfcc-class-info.docs-only.programmatic.test.js │ │ │ ├── get-sfra-categories.docs-only.programmatic.test.js │ │ │ ├── get-sfra-document.programmatic.test.js │ │ │ ├── get-sfra-documents-by-category.docs-only.programmatic.test.js │ │ │ ├── get-system-object-definition.full-mode.programmatic.test.js │ │ │ ├── get-system-object-definitions.docs-only.programmatic.test.js │ │ │ ├── get-system-object-definitions.full-mode.programmatic.test.js │ │ │ ├── list-log-files.full-mode.programmatic.test.js │ │ │ ├── list-sfcc-classes.docs-only.programmatic.test.js │ │ │ ├── search-best-practices.docs-only.programmatic.test.js │ │ │ ├── search-custom-object-attribute-definitions.full-mode.programmatic.test.js │ │ │ ├── search-job-logs-by-name.full-mode.programmatic.test.js │ │ │ ├── search-job-logs.full-mode.programmatic.test.js │ │ │ ├── search-logs.full-mode.programmatic.test.js │ │ │ ├── search-sfcc-classes.docs-only.programmatic.test.js │ │ │ ├── search-sfcc-methods.docs-only.programmatic.test.js │ │ │ ├── search-sfra-documentation.docs-only.programmatic.test.js │ │ │ ├── search-site-preferences.full-mode.programmatic.test.js │ │ │ ├── search-system-object-attribute-definitions.full-mode.programmatic.test.js │ │ │ ├── search-system-object-attribute-groups.full-mode.programmatic.test.js │ │ │ ├── summarize-logs.full-mode.programmatic.test.js │ │ │ ├── tools.docs-only.programmatic.test.js │ │ │ └── tools.full-mode.programmatic.test.js │ │ ├── README.md │ │ ├── test-fixtures │ │ │ └── dw.json │ │ └── yaml │ │ ├── activate-code-version.docs-only.test.mcp.yml │ │ ├── activate-code-version.full-mode.test.mcp.yml │ │ ├── get_latest_error.test.mcp.yml │ │ ├── get-available-best-practice-guides.docs-only.test.mcp.yml │ │ ├── get-available-best-practice-guides.full-mode.test.mcp.yml │ │ ├── get-available-sfra-documents.docs-only.test.mcp.yml │ │ ├── get-available-sfra-documents.full-mode.test.mcp.yml │ │ ├── get-best-practice-guide.docs-only.test.mcp.yml │ │ ├── get-best-practice-guide.full-mode.test.mcp.yml │ │ ├── get-code-versions.docs-only.test.mcp.yml │ │ ├── get-code-versions.full-mode.test.mcp.yml │ │ ├── get-hook-reference.docs-only.test.mcp.yml │ │ ├── get-hook-reference.full-mode.test.mcp.yml │ │ ├── get-job-execution-summary.full-mode.test.mcp.yml │ │ ├── get-job-log-entries.full-mode.test.mcp.yml │ │ ├── get-latest-debug.full-mode.test.mcp.yml │ │ ├── get-latest-error.full-mode.test.mcp.yml │ │ ├── get-latest-info.full-mode.test.mcp.yml │ │ ├── get-latest-job-log-files.full-mode.test.mcp.yml │ │ ├── get-latest-warn.full-mode.test.mcp.yml │ │ ├── get-log-file-contents.full-mode.test.mcp.yml │ │ ├── get-sfcc-class-documentation.docs-only.test.mcp.yml │ │ ├── get-sfcc-class-documentation.full-mode.test.mcp.yml │ │ ├── get-sfcc-class-info.docs-only.test.mcp.yml │ │ ├── get-sfcc-class-info.full-mode.test.mcp.yml │ │ ├── get-sfra-categories.docs-only.test.mcp.yml │ │ ├── get-sfra-categories.full-mode.test.mcp.yml │ │ ├── get-sfra-document.docs-only.test.mcp.yml │ │ ├── get-sfra-document.full-mode.test.mcp.yml │ │ ├── get-sfra-documents-by-category.docs-only.test.mcp.yml │ │ ├── get-sfra-documents-by-category.full-mode.test.mcp.yml │ │ ├── get-system-object-definition.docs-only.test.mcp.yml │ │ ├── get-system-object-definition.full-mode.test.mcp.yml │ │ ├── get-system-object-definitions.docs-only.test.mcp.yml │ │ ├── get-system-object-definitions.full-mode.test.mcp.yml │ │ ├── list-log-files.full-mode.test.mcp.yml │ │ ├── list-sfcc-classes.docs-only.test.mcp.yml │ │ ├── list-sfcc-classes.full-mode.test.mcp.yml │ │ ├── search-best-practices.docs-only.test.mcp.yml │ │ ├── search-best-practices.full-mode.test.mcp.yml │ │ ├── search-custom-object-attribute-definitions.docs-only.test.mcp.yml │ │ ├── search-custom-object-attribute-definitions.test.mcp.yml │ │ ├── search-job-logs-by-name.full-mode.test.mcp.yml │ │ ├── search-job-logs.full-mode.test.mcp.yml │ │ ├── search-logs.full-mode.test.mcp.yml │ │ ├── search-sfcc-classes.docs-only.test.mcp.yml │ │ ├── search-sfcc-classes.full-mode.test.mcp.yml │ │ ├── search-sfcc-methods.docs-only.test.mcp.yml │ │ ├── search-sfcc-methods.full-mode.test.mcp.yml │ │ ├── search-sfra-documentation.docs-only.test.mcp.yml │ │ ├── search-sfra-documentation.full-mode.test.mcp.yml │ │ ├── search-site-preferences.docs-only.test.mcp.yml │ │ ├── search-site-preferences.full-mode.test.mcp.yml │ │ ├── search-system-object-attribute-definitions.docs-only.test.mcp.yml │ │ ├── search-system-object-attribute-definitions.full-mode.test.mcp.yml │ │ ├── search-system-object-attribute-groups.docs-only.test.mcp.yml │ │ ├── search-system-object-attribute-groups.full-mode.test.mcp.yml │ │ ├── summarize-logs.full-mode.test.mcp.yml │ │ ├── tools.docs-only.test.mcp.yml │ │ └── tools.full-mode.test.mcp.yml │ ├── oauth-token.test.ts │ ├── ocapi-auth-client.test.ts │ ├── ocapi-client.test.ts │ ├── path-service.test.ts │ ├── query-builder.test.ts │ ├── referenced-types-extractor.test.ts │ ├── servers │ │ ├── sfcc-mock-server │ │ │ ├── mock-data │ │ │ │ └── ocapi │ │ │ │ ├── code-versions.json │ │ │ │ ├── custom-object-attributes-customapi.json │ │ │ │ ├── custom-object-attributes-globalsettings.json │ │ │ │ ├── custom-object-attributes-versionhistory.json │ │ │ │ ├── site-preferences-ccv.json │ │ │ │ ├── site-preferences-fastforward.json │ │ │ │ ├── site-preferences-sfra.json │ │ │ │ ├── site-preferences-storefront.json │ │ │ │ ├── site-preferences-system.json │ │ │ │ ├── system-object-attribute-groups-campaign.json │ │ │ │ ├── system-object-attribute-groups-category.json │ │ │ │ ├── system-object-attribute-groups-order.json │ │ │ │ ├── system-object-attribute-groups-product.json │ │ │ │ ├── system-object-attribute-groups-sitepreferences.json │ │ │ │ ├── system-object-attributes-customeraddress.json │ │ │ │ ├── system-object-attributes-product-expanded.json │ │ │ │ ├── system-object-attributes-product.json │ │ │ │ ├── system-object-definition-category.json │ │ │ │ ├── system-object-definition-customer.json │ │ │ │ ├── system-object-definition-customeraddress.json │ │ │ │ ├── system-object-definition-order.json │ │ │ │ ├── system-object-definition-product.json │ │ │ │ ├── system-object-definitions-old.json │ │ │ │ └── system-object-definitions.json │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── README.md │ │ │ ├── scripts │ │ │ │ └── setup-logs.js │ │ │ ├── server.js │ │ │ └── src │ │ │ ├── app.js │ │ │ ├── config │ │ │ │ └── server-config.js │ │ │ ├── middleware │ │ │ │ ├── auth.js │ │ │ │ ├── cors.js │ │ │ │ └── logging.js │ │ │ ├── routes │ │ │ │ ├── ocapi │ │ │ │ │ ├── code-versions-handler.js │ │ │ │ │ ├── oauth-handler.js │ │ │ │ │ ├── ocapi-error-utils.js │ │ │ │ │ ├── ocapi-utils.js │ │ │ │ │ ├── site-preferences-handler.js │ │ │ │ │ └── system-objects-handler.js │ │ │ │ ├── ocapi.js │ │ │ │ └── webdav.js │ │ │ └── utils │ │ │ ├── mock-data-loader.js │ │ │ └── webdav-xml.js │ │ └── sfcc-mock-server-manager.ts │ ├── sfcc-mock-server.test.ts │ ├── site-preferences-client.test.ts │ ├── system-objects-client.test.ts │ ├── utils.test.ts │ ├── validation-helpers.test.ts │ └── validator.test.ts ├── tsconfig.json └── tsconfig.test.json ``` # Files -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- ``` /node_modules/ /dist/ /.idea/ /docs-site-old/.bundle /docs-site-old/_site /docs-site-old/vendor tests/servers/sfcc-mock-server/mock-data/logs/ tests/servers/webdav/node_modules/ tests/servers/ocapi/node_modules/ tests/servers/sfcc-mock-server/node_modules/ tmp/ ``` -------------------------------------------------------------------------------- /docs-site/.gitignore: -------------------------------------------------------------------------------- ``` # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* lerna-debug.log* node_modules dist dist-ssr *.local # Generated CSS files /public/index.css # Auto-generated search index /src/generated-search-index.ts # Editor directories and files .vscode/* !.vscode/extensions.json .idea .DS_Store *.suo *.ntvs* *.njsproj *.sln *.sw? ``` -------------------------------------------------------------------------------- /docs-site/README.md: -------------------------------------------------------------------------------- ```markdown # SFCC Development MCP Server Documentation Site A modern React-based documentation site for the SFCC Development MCP Server built with Vite and TailwindCSS. ## Features - **React 19** with TypeScript - **Vite** for fast development and building - **TailwindCSS** for styling (locally configured) - **React Router** with Hash routing for GitHub Pages compatibility - **Responsive design** with mobile-first approach ## Development ### Prerequisites - Node.js 18+ - npm ### Setup 1. Install dependencies: ```bash npm install ``` 2. Start development server: ```bash npm run dev ``` The site will be available at `http://localhost:5173/` ### Building for Production ```bash npm run build ``` This will: 1. Generate optimized TailwindCSS from used classes 2. Build the React application with Vite 3. Output production files to `dist/` ### TailwindCSS Configuration TailwindCSS is configured locally with: - **Config**: `tailwind.config.js` - **PostCSS**: `postcss.config.js` - **Input CSS**: `src/styles/input.css` - **Output CSS**: `public/index.css` (generated) ### Available Scripts - `npm run dev` - Start development server with CSS generation - `npm run build` - Build for production (includes CSS generation) - `npm run preview` - Preview production build - `npm run build:css` - Generate TailwindCSS once - `npm run build:css:watch` - Generate TailwindCSS in watch mode ### File Structure ``` docs-site-v2/ ├── public/ │ └── index.css # Generated TailwindCSS (gitignored) ├── src/ │ └── styles/ │ └── input.css # TailwindCSS source ├── components/ # React components ├── pages/ # Page components ├── index.html # Main HTML template ├── index.tsx # React application entry ├── tailwind.config.js # TailwindCSS configuration ├── postcss.config.js # PostCSS configuration ├── vite.config.ts # Vite configuration └── package.json # Dependencies and scripts ``` ## Deployment ### GitHub Pages The site is automatically deployed to GitHub Pages when changes are pushed to the `main` branch in the `docs-site-v2/` directory. **Deployment Process:** 1. GitHub Actions workflow triggers on push to `main` 2. Node.js 18 environment is set up 3. Dependencies are installed with `npm ci` 4. Site is built with `NODE_ENV=production npm run build` 5. Generated `dist/` folder is deployed to GitHub Pages **Configuration:** - Base path: `/` (configured for subdomain deployment) - Build artifacts: `dist/` directory - Workflow: `.github/workflows/deploy-docs.yml` ### Manual Deployment For other static hosting services, use: ```bash npm run build ``` The `dist/` folder contains all files needed for deployment to any static hosting service. ## Notes - The generated CSS file (`public/index.css`) is excluded from version control - TailwindCSS is configured to only include classes actually used in the project - CSS is automatically generated before development and build processes ``` -------------------------------------------------------------------------------- /tests/servers/sfcc-mock-server/README.md: -------------------------------------------------------------------------------- ```markdown # SFCC Mock Server A unified mock server combining WebDAV and OCAPI functionality for SFCC (Salesforce B2C Commerce Cloud) development testing. This server provides a single endpoint for both log file access (WebDAV) and OCAPI API simulation, eliminating the need to run multiple servers during development. ## Features - 🔄 **Unified Architecture**: Single server handling both WebDAV and OCAPI requests - 📁 **WebDAV Support**: Mock log file access with PROPFIND and range request support - 🔐 **OCAPI Simulation**: OAuth authentication and system object/site preferences APIs - 🚀 **Express.js Based**: Modern, maintainable architecture with modular design - ⚙️ **Configurable**: Enable/disable features, custom ports, development mode - 🔧 **Developer Friendly**: Comprehensive logging and error handling ## Quick Start ```bash # Install dependencies npm install # Start server in development mode npm run dev # Start server on custom port npm run start:port # Start with custom configuration npm run start:custom ``` ## Usage ### Basic Usage ```bash # Start with default settings (port 3000) node server.js # Development mode with verbose logging node server.js --dev # Custom port and host node server.js --port 4000 --host 0.0.0.0 # Enable only WebDAV (disable OCAPI) node server.js --no-ocapi # Enable only OCAPI (disable WebDAV) node server.js --no-webdav ``` ### Command Line Options | Option | Description | Default | |--------|-------------|---------| | `--port <number>` | Server port | 3000 | | `--host <string>` | Server host | localhost | | `--dev` | Enable development mode | false | | `--no-webdav` | Disable WebDAV functionality | enabled | | `--no-ocapi` | Disable OCAPI functionality | enabled | | `--no-cors` | Disable CORS headers | enabled | | `--mock-data <path>` | Custom mock data directory | ./mock-data | | `--help` | Show help message | - | ## Endpoints ### Health & Info - `GET /health` - Server health check - `GET /info` - Server information and configuration ### WebDAV Endpoints - `PROPFIND|GET /on/demandware.servlet/webdav/Sites/Logs/` - SFCC WebDAV path - `PROPFIND|GET /Logs/` - Direct logs access - `GET /Logs/jobs/` - Job logs directory ### OCAPI Endpoints - `POST /dw/oauth2/access_token` - OAuth token endpoint - `GET /s/-/dw/data/v23_2/system_object_definitions` - System objects - `POST /s/-/dw/data/v23_2/system_object_definition_search` - Search system objects - `GET /s/-/dw/data/v23_2/code_versions` - Code versions - `POST /s/-/dw/data/v23_2/code_versions/:id/activate` - Activate code version ## Authentication ### OCAPI OAuth Credentials For testing OCAPI endpoints, use these credentials: - **Client ID**: `test-client-id` - **Client Secret**: `test-client-secret` - **Grant Type**: `client_credentials` ### Example OAuth Request ```bash curl -X POST http://localhost:3000/dw/oauth2/access_token \\ -H "Authorization: Basic $(echo -n 'test-client-id:test-client-secret' | base64)" \\ -H "Content-Type: application/x-www-form-urlencoded" \\ -d "grant_type=client_credentials" ``` ## Mock Data ### Directory Structure ``` mock-data/ ├── logs/ # WebDAV log files │ ├── error-blade-*.log # Error logs │ ├── warn-blade-*.log # Warning logs │ ├── info-blade-*.log # Info logs │ ├── debug-blade-*.log # Debug logs │ └── jobs/ # Job logs │ └── JobName/ │ └── Job-*.log └── ocapi/ # OCAPI mock responses ├── system-object-definitions.json ├── code-versions.json └── [other-mock-files].json ``` ### Customizing Mock Data 1. Edit JSON files in `mock-data/ocapi/` for OCAPI responses 2. Add log files to `mock-data/logs/` for WebDAV content 3. Use `--mock-data <path>` to specify custom data directory ## Development ### Architecture The server follows modular architecture principles: ``` src/ ├── config/ # Configuration management ├── middleware/ # Express middleware (auth, CORS, logging) ├── routes/ # Route handlers (webdav, ocapi) └── utils/ # Utility functions (data loading, XML generation) ``` ### Key Classes - **ServerConfig**: Configuration management and validation - **SFCCMockApp**: Express application setup and routing - **WebDAVRouteHandler**: WebDAV request handling with PROPFIND support - **OCAPIRouteHandler**: OCAPI endpoint simulation with authentication - **AuthenticationManager**: OAuth token generation and validation ### Adding New Features 1. **New OCAPI Endpoints**: Add routes in `src/routes/ocapi.js` 2. **WebDAV Extensions**: Modify `src/routes/webdav.js` 3. **Middleware**: Add to `src/middleware/` 4. **Mock Data**: Add JSON files to `mock-data/ocapi/` ## Testing The server is designed to work with the SFCC Development MCP Server test suite: ```bash # Run with the unified server for testing node server.js --dev --port 3000 # Test WebDAV functionality curl -X PROPFIND http://localhost:3000/Logs/ # Test OCAPI functionality curl -X POST http://localhost:3000/dw/oauth2/access_token \\ -H "Authorization: Basic $(echo -n 'test-client-id:test-client-secret' | base64)" \\ -d "grant_type=client_credentials" ``` ## Troubleshooting ### Common Issues 1. **Port already in use**: Use `--port <different-port>` 2. **Missing mock data**: Ensure `mock-data/` directory exists with proper structure 3. **CORS errors**: Enable CORS with `--cors` (enabled by default) 4. **Authentication failing**: Verify OAuth credentials match test values ### Debug Mode Enable development mode for detailed logging: ```bash node server.js --dev ``` This will show: - All incoming requests with headers and body - All outgoing responses with status codes - File system operations and path mappings - Authentication token generation and validation ## Contributing 1. Follow the modular architecture patterns 2. Add tests for new functionality 3. Update documentation for new endpoints or features 4. Ensure backward compatibility with existing tests ## License MIT License - See LICENSE file for details ``` -------------------------------------------------------------------------------- /tests/mcp/README.md: -------------------------------------------------------------------------------- ```markdown # MCP Testing Documentation This document describes the MCP (Model Context Protocol) tests for the SFCC Development MCP Server. ## Overview The project includes comprehensive MCP tests using both **YAML** and **Node.js** approaches with the [mcp-aegis](https://aegis.rhino-inquisitor.com/) testing library. The tests verify both **documentation-only mode** and **full mode with credentials**. ## Test Structure ``` tests/mcp/ ├── AGENTS.md # AI agent guide for MCP testing ├── yaml/ │ ├── AGENTS.md # YAML-specific agent guide │ ├── docs-only.test.mcp.yml # Documentation-only mode YAML tests │ └── full-mode.test.mcp.yml # Full mode YAML tests ├── node/ │ ├── AGENTS.md # Node.js-specific agent guide │ ├── docs-only.programmatic.test.js # Documentation-only mode Node.js tests │ └── full-mode.programmatic.test.js # Full mode Node.js tests └── test-fixtures/ └── dw.json # Test SFCC credentials configuration ``` ## Configuration Files ### Documentation-Only Mode - **File**: `aegis.config.docs-only.json` - **Command**: `node dist/index.js` (no credentials) - **Tools**: 15 tools (documentation, best practices, SFRA, cartridge generation) ### Full Mode with Credentials - **File**: `aegis.config.with-dw.json` - **Command**: `node dist/index.js --dw-json ./tests/mcp/test-fixtures/dw.json` - **Tools**: 36 tools (includes log analysis, system objects, job logs, code versions) ## Available Test Commands ### YAML Testing ```bash # Documentation-only mode npm run test:mcp:yaml # Full mode with credentials (requires valid SFCC instance) npm run test:mcp:yaml:full # Manual execution with specific config aegis 'tests/mcp/yaml/*.test.mcp.yml' --config './aegis.config.docs-only.json' ``` ### Node.js Programmatic Testing ```bash # All programmatic tests npm run test:mcp:node # Manual execution node --test 'tests/mcp/node/*.programmatic.test.js' ``` ### Combined Testing ```bash # All MCP tests npm run test:mcp:all # All project tests (Jest + MCP) npm run test:all # CI-friendly format with JSON output npm run test:mcp:ci ``` ## Test Categories ### 1. Protocol Compliance Tests - **Tools list validation**: Ensures tools are properly registered - **JSON-RPC 2.0 compliance**: Validates request/response format - **Error handling**: Tests invalid tool calls and missing parameters ### 2. Documentation-Only Mode Tests - **SFCC Documentation Tools** (5 tools): Class info, search, method discovery - **Best Practices Tools** (4 tools): Guides, search, hook references - **SFRA Documentation Tools** (5 tools): Documents, search, categories - **Cartridge Generation Tools** (1 tool): Structure generation - **Tool Availability**: Verifies log/OCAPI tools are NOT available ### 3. Full Mode Tests - **All Documentation Tools**: Same as documentation-only mode - **Log Analysis Tools** (8 tools): Error/warn/info/debug logs, search, summarization - **Job Log Tools** (5 tools): Job log files, entries, search, execution summaries - **System Object Tools** (6 tools): System objects, attributes, site preferences - **Code Version Tools** (2 tools): List and activate code versions - **Authentication Testing**: Graceful handling of connection failures ### 4. Performance and Reliability Tests - **Response Time Validation**: Ensures reasonable performance - **Concurrent Request Handling**: Tests multiple simultaneous requests - **Error Recovery**: Validates graceful failure modes - **Schema Consistency**: Ensures all tools follow MCP standards ## Test Patterns Used ### YAML Pattern Matching - **Type validation**: `"match:type:array"`, `"match:type:string"` - **Content matching**: `"match:contains:expected_text"` - **Array operations**: `"match:arrayContains:item"`, `"match:arrayLength:15"` - **Field extraction**: `"match:extractField: "tools.*.name"` - **Regex patterns**: `"match:regex:[\\s\\S]*pattern[\\s\\S]*"` (multiline safe) - **Negation**: `"match:not:arrayContains:unwanted_item"` ### Node.js Assertions - **Protocol validation**: JSON-RPC 2.0 compliance checking - **Tool schema validation**: Input/output schema verification - **Dynamic testing**: Programmatic test generation and validation - **Error boundary testing**: Exception handling and meaningful error messages ## Running Tests ### Prerequisites ```bash # Ensure project is built npm run build # Install dependencies (already included) npm install ``` ### Documentation-Only Testing (No Credentials Required) ```bash # YAML tests npm run test:mcp:yaml # Programmatic tests npm run test:mcp:node # Both approaches npm run test:mcp:all ``` ### Full Mode Testing (Requires SFCC Instance) To test full functionality: 1. **Update test credentials** in `tests/mcp/test-fixtures/dw.json`: ```json { "version": "1.0.0", "hostname": "your-instance.sandbox.us01.dx.commercecloud.salesforce.com", "username": "your-username", "password": "your-password", "client-id": "your-client-id", "client-secret": "your-client-secret", "code-version": "your-code-version", "cartridgesPath": "./cartridges" } ``` 2. **Run full mode tests**: ```bash npm run test:mcp:yaml:full ``` **Note**: Full mode tests expect connection failures with test credentials and verify graceful error handling. ## Test Coverage ### Tools Tested in Documentation-Only Mode (15 tools) 1. `get_sfcc_class_info` - SFCC class information 2. `search_sfcc_classes` - SFCC class search 3. `search_sfcc_methods` - SFCC method search 4. `list_sfcc_classes` - Complete SFCC class list 5. `get_sfcc_class_documentation` - Raw SFCC class documentation 6. `get_available_best_practice_guides` - Best practices list 7. `get_best_practice_guide` - Specific best practice guide 8. `search_best_practices` - Best practices search 9. `get_hook_reference` - Hook reference tables 10. `get_available_sfra_documents` - SFRA documents list 11. `get_sfra_document` - Specific SFRA document 12. `search_sfra_documentation` - SFRA documentation search 13. `get_sfra_documents_by_category` - SFRA documents by category 14. `get_sfra_categories` - SFRA document categories 15. `generate_cartridge_structure` - Cartridge generation ### Additional Tools in Full Mode (+21 tools = 36 total) **Log Analysis Tools (8)**: - `get_latest_error`, `get_latest_warn`, `get_latest_info`, `get_latest_debug` - `summarize_logs`, `search_logs`, `list_log_files`, `get_log_file_contents` **Job Log Tools (5)**: - `get_latest_job_log_files`, `search_job_logs_by_name`, `get_job_log_entries` - `search_job_logs`, `get_job_execution_summary` **System Object Tools (6)**: - `get_system_object_definitions`, `get_system_object_definition` - `search_system_object_attribute_definitions`, `search_site_preferences` - `search_system_object_attribute_groups`, `search_custom_object_attribute_definitions` **Code Version Tools (2)**: - `get_code_versions`, `activate_code_version` ## Debugging Tests ### Enable Verbose Output ```bash # YAML tests with debugging aegis 'tests/mcp/yaml/*.test.mcp.yml' --config './aegis.config.docs-only.json' --verbose --debug # Check server logs npm run dev -- --debug true ``` ### Common Issues - **Build Required**: Always run `npm run build` before testing - **Tool Count Mismatches**: Verify tool counts with `npx aegis query` - **Connection Failures**: Expected in full mode with test credentials - **Path Issues**: Use absolute paths in aegis config files ## Contributing When adding new tools or modifying existing ones: 1. **Update test files** to include new tools 2. **Verify tool counts** using `npx aegis query` 3. **Test both modes** to ensure proper tool availability 4. **Update documentation** with new tool descriptions 5. **Run full test suite** before committing ## Resources - **[MCP Aegis Documentation](https://aegis.rhino-inquisitor.com/)**: Complete testing framework guide - **[YAML Testing Guide](./yaml/AGENTS.md)**: Declarative testing patterns - **[Node.js Testing Guide](./node/AGENTS.md)**: Programmatic testing patterns - **[MCP Protocol Specification](https://modelcontextprotocol.io/)**: Protocol standards ``` -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- ```markdown # SFCC Development MCP Server [](https://badge.fury.io/js/sfcc-dev-mcp) [](https://opensource.org/licenses/MIT) An AI-powered Model Context Protocol (MCP) server that provides comprehensive access to Salesforce B2C Commerce Cloud development tools, documentation, and best practices. ## ✨ Key Features - **🔍 Complete SFCC Documentation Access** - Search and explore all SFCC API classes and methods - **📚 Best Practices Guides** - Curated development guidelines for cartridges, hooks, controllers, client-side JavaScript, and more - **🏗️ SFRA Documentation** - Enhanced access to Storefront Reference Architecture documentation - **📊 Log Analysis Tools** - Real-time error monitoring, debugging, and job log analysis for SFCC instances - **⚙️ System Object Definitions** - Explore custom attributes and site preferences - **🚀 Cartridge Generation** - Automated cartridge structure creation ## 🚀 Quick Start ### Option 1: Documentation-Only Mode (No SFCC credentials needed) ```json { "mcpServers": { "sfcc-dev": { "command": "npx", "args": ["sfcc-dev-mcp"] } } } ``` ### Option 2: Full Mode (With SFCC credentials for log and job analysis) ```json { "mcpServers": { "sfcc-dev": { "command": "npx", "args": ["sfcc-dev-mcp", "--dw-json", "/path/to/your/dw.json"] } } } ``` Create a `dw.json` file with your SFCC credentials: ```json { "hostname": "your-instance.sandbox.us01.dx.commercecloud.salesforce.com", "username": "your-username", "password": "your-password", "client-id": "your-client-id", "client-secret": "your-client-secret" } ``` ## 🎯 Operating Modes | Mode | Tools Available | SFCC Credentials Required | |------|----------------|---------------------------| | **Documentation-Only** | 15 tools | ❌ No | | **Full Mode** | 36 tools | ✅ Yes | ### Documentation-Only Mode Perfect for learning and development - no SFCC instance required: - Complete SFCC API documentation (5 tools) - Best practices guides (4 tools) – cartridges, client-side JavaScript, controllers, hooks, security/performance - SFRA documentation (5 tools) - Cartridge generation (1 tool) ### Full Mode Complete development experience with live SFCC instance access: - All documentation-only features (15 tools) - Real-time log analysis (13 tools) - System object definitions (6 tools) - Code version management (2 tools) ## � Architecture Overview This server is built around a **capability-gated, modular handler architecture** that cleanly separates tool routing from domain logic: ### Core Layers - **Tool Definitions** (`src/core/tool-definitions.ts`): Declarative schemas grouped by category (documentation, best practices, SFRA, logs, job logs, system objects, cartridge generation, code versions). - **Handlers** (`src/core/handlers/*.ts`): Each category has a handler extending a common base for timing, structured logging, and error normalization (e.g. `log-handler`, `docs-handler`, `system-object-handler`). - **Clients** (`src/clients/`): Encapsulate domain operations (OCAPI, SFRA docs, best practices, modular log analysis). Handlers delegate to these so orchestration and computation remain separate. - **Services** (`src/services/`): Dependency-injected abstractions for filesystem and path operations — improves testability and isolates side effects. - **Modular Log System** (`src/clients/logs/`): Reader (range/tail optimization), discovery, processor (line → structured entry), analyzer (patterns & health), formatter (human output) for maintainable evolution. - **Configuration Factory** (`src/config/configuration-factory.ts`): Determines capabilities (`canAccessLogs`, `canAccessOCAPI`) based on provided credentials and filters exposed tools accordingly (principle of least privilege). ### Why This Matters - **Extensibility**: Adding a new tool usually means adding a schema + minimal handler logic (or a new handler if a new domain). - **Security**: Tools that require credentials are never exposed when capability flags are false. - **Testability**: Unit tests target clients & modules; integration/MCP tests validate handler routing and response structure. - **Performance**: Tail log reads + lightweight caching (`cache.ts`, `log-cache.ts`) reduce unnecessary I/O. ### Adding a New Tool (High-Level) 1. Add schema object to the correct exported array in `tool-definitions.ts`. 2. Implement domain logic in a client/service (avoid bloating handlers). 3. Extend an existing handler or create a new one if it's a new category. 4. (Only for a new category) register the new handler inside `registerHandlers()` in `server.ts`. 5. Discover actual response shape with `npx mcp-aegis query` before writing tests. 6. Add Jest unit tests + YAML MCP tests (docs vs full mode if credentials required). 7. Update documentation (Development Guide + README counts if changed). > For a deeper internal view, see the Development Guide in the docs site. ## �🤖 AI Interface Setup Choose your preferred AI assistant: | Interface | Best For | Setup Guide | |-----------|----------|-------------| | **Claude Desktop** | Multi-turn conversations, debugging | [📖 Setup Guide](https://taurgis.github.io/sfcc-dev-mcp/ai-interfaces#claude-desktop) | | **GitHub Copilot** | VS Code integration, inline suggestions | [📖 Setup Guide](https://taurgis.github.io/sfcc-dev-mcp/ai-interfaces#github-copilot) | | **Cursor** | Modern AI-powered editor | [📖 Setup Guide](https://taurgis.github.io/sfcc-dev-mcp/ai-interfaces#cursor) | ## 📦 Installation ### Using npx (Recommended) > Tip: Add `-y` (or `--yes`) to suppress the interactive prompt npx shows before downloading a package. This prevents AI clients (Claude Desktop, Copilot, Cursor) from hanging waiting for confirmation. ```bash # Test the server npx -y sfcc-dev-mcp # Use with your configuration npx -y sfcc-dev-mcp --dw-json /path/to/your/dw.json ``` ### Global Installation ```bash npm install -g sfcc-dev-mcp sfcc-dev-mcp --dw-json /path/to/your/dw.json ``` ## 🐛 Debug Mode & Logging ### Enable Debug Logging ```bash # Enable debug mode for detailed logging npx -y sfcc-dev-mcp --debug # Or with configuration file npx -y sfcc-dev-mcp --dw-json /path/to/your/dw.json --debug ``` ### Log File Locations The server writes logs to your system's temporary directory: - **macOS**: `/var/folders/{user-id}/T/sfcc-mcp-logs/` - **Linux**: `/tmp/sfcc-mcp-logs/` - **Windows**: `%TEMP%\sfcc-mcp-logs\` **Log Files Created:** - `sfcc-mcp-info.log` - General application logs and startup messages - `sfcc-mcp-debug.log` - Detailed debug information (only when `--debug` is enabled) - `sfcc-mcp-error.log` - Error messages and stack traces - `sfcc-mcp-warn.log` - Warning messages ### Finding Your Log Directory ```javascript // The exact path varies by system - to find yours: node -e "console.log(require('os').tmpdir() + '/sfcc-mcp-logs')" ## 📖 Documentation **📚 [Complete Documentation](https://taurgis.github.io/sfcc-dev-mcp/)** - Comprehensive guides and references Quick Links: - **[Installation Guide](https://taurgis.github.io/sfcc-dev-mcp/installation)** - Detailed installation options - **[AI Interface Setup](https://taurgis.github.io/sfcc-dev-mcp/ai-interfaces)** - Configure Claude Desktop, GitHub Copilot, or Cursor - **[Configuration Guide](https://taurgis.github.io/sfcc-dev-mcp/configuration)** - SFCC credentials and Data API setup - **[Available Tools](https://taurgis.github.io/sfcc-dev-mcp/tools)** - Complete tool reference - **[Examples](https://taurgis.github.io/sfcc-dev-mcp/examples)** - Real-world usage patterns - **[Troubleshooting](https://taurgis.github.io/sfcc-dev-mcp/troubleshooting)** - Common issues and solutions ## 🛠️ Example AI Interactions ``` 🧑💻 "Create a new SFCC controller for product search" 🤖 Generates complete controller with proper imports, route handling, and SFRA patterns 🧑💻 "What's wrong with my checkout flow? Check the logs" 🤖 Analyzes recent error logs, identifies issues, and suggests fixes 🧑💻 "Show me how to implement OCAPI hooks for order validation" 🤖 Provides best practices guide with complete hook implementation examples ``` ## 🔒 Security Notes - **Local Development Focus**: Designed for individual developer use on local machines - **Credential Protection**: dw.json files should never be committed to version control - **Network Security**: All API calls use HTTPS with proper authentication - **No Data Storage**: Server doesn't persist any SFCC data locally ## 🔮 Future Plans We're continuously improving the SFCC Development MCP Server with exciting new features planned: ### 🎯 Upcoming Enhancements - **🧠 Smarter Log Fetching** - Enhanced log analysis with intelligent filtering, pattern recognition, and contextual error correlation - **🚀 Deployment Tools** - Integration with SFCC deployment processes and code version management ### 🤝 We Welcome Your Contributions! Have ideas for new features or improvements? We'd love to hear from you! - **💡 Feature Requests**: Open an issue to discuss your ideas - **🐛 Bug Reports**: Help us improve by reporting any issues you encounter - **🔧 Pull Requests**: Contribute code, documentation, or examples - **📚 Documentation**: Help expand our guides and best practices Check out our [Contributing Guide](CONTRIBUTING.md) to get started, or browse our [open issues](https://github.com/taurgis/sfcc-dev-mcp/issues) to see where you can help. **Your expertise and feedback make this tool better for the entire SFCC community!** ## 🤝 Contributing We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details. ## 📄 License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. --- **🚀 Ready to supercharge your SFCC development with AI?** **[📖 Get Started with the Full Documentation](https://taurgis.github.io/sfcc-dev-mcp/)** ``` -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- ```markdown # Security Policy ## Supported Versions We actively maintain and provide security updates for the following versions: | Version | Supported | | ------- | ------------------ | | 1.x.x | :white_check_mark: | | < 1.0 | :x: | ## Reporting a Vulnerability We take the security of the SFCC Development MCP Server seriously. If you discover a security vulnerability, please follow these steps: ### 🔒 Private Disclosure **Please do NOT report security vulnerabilities through public GitHub issues.** Instead, please report security vulnerabilities by: 1. **GitHub Security Advisories**: Use GitHub's private vulnerability reporting feature at [https://github.com/taurgis/sfcc-dev-mcp/security/advisories](https://github.com/taurgis/sfcc-dev-mcp/security/advisories) ### 📋 What to Include When reporting a vulnerability, please include: - **Description**: Clear description of the vulnerability - **Impact**: Potential impact and attack scenarios - **Reproduction**: Step-by-step instructions to reproduce the issue - **Environment**: Version, operating system, and configuration details - **Evidence**: Screenshots, logs, or proof-of-concept code (if applicable) ### ⏰ Response Timeline We are committed to addressing security vulnerabilities promptly: - **Initial Response**: Within 48 hours of report - **Acknowledgment**: Within 7 days with initial assessment - **Resolution**: Security patches released within 30 days for high-severity issues - **Disclosure**: Coordinated disclosure after patch is available ## Security Considerations ### 🎯 Scope This security policy covers vulnerabilities in: - **Core MCP Server**: Authentication, data handling, API access - **SFCC Integration**: OAuth flows, credential management, data exposure - **Documentation Access**: Information disclosure, access control - **Log Analysis**: Sensitive data exposure, injection vulnerabilities - **Dependencies**: Third-party package vulnerabilities ### ⚠️ What We Consider Security Issues - **Authentication bypass** in SFCC credential handling - **Sensitive data exposure** in logs or responses - **Code injection** through tool parameters - **Unauthorized access** to SFCC instances - **Credential leakage** in configuration or cache - **Path traversal** in file operations - **Denial of service** through resource exhaustion - **Dependency vulnerabilities** with exploitable impact ### ✅ What We Don't Consider Security Issues - **Rate limiting** on local development tools - **Information disclosure** of public SFCC documentation - **Resource usage** in normal operation scenarios - **Configuration errors** by end users - **Network connectivity** issues - **Feature requests** or usability improvements ## Security Best Practices ### 🔐 For Users 1. **Credential Protection**: - Store SFCC credentials securely in `dw.json` - Use environment variables for sensitive configuration - Regularly rotate API credentials - Never commit credentials to version control 2. **Network Security**: - Use HTTPS connections to SFCC instances - Verify SSL certificates in production - Restrict network access to development instances 3. **Local Security**: - Keep the MCP server updated - Review log outputs for sensitive data - Use proper file permissions on configuration files ### 🛡️ For Developers 1. **Input Validation**: - Validate all tool parameters - Sanitize user inputs before processing - Use type-safe parameter parsing 2. **Data Handling**: - Minimize sensitive data in logs - Implement proper error handling - Use secure HTTP clients with proper timeouts 3. **Dependency Management**: - Regularly update dependencies - Monitor for security advisories - Use `npm audit` to check for vulnerabilities ## Security Features ### 🔒 Built-in Security - **OAuth 2.0 Authentication** for SFCC OCAPI access - **Secure credential storage** with local file protection - **Input validation** on all tool parameters - **Rate limiting** on external API calls - **Secure HTTP clients** with proper error handling - **Minimal privilege principle** for SFCC permissions ### 📊 Security Monitoring - **Dependency scanning** via GitHub Dependabot - **Code quality checks** in CI/CD pipeline - **Security-focused linting** rules - **Regular security audits** of dependencies ## Responsible Disclosure We believe in responsible disclosure and will work with security researchers to: 1. **Acknowledge** your contribution 2. **Keep you informed** of our progress 3. **Credit you appropriately** (unless you prefer to remain anonymous) 4. **Coordinate timing** of public disclosure ## Contact For security-related questions or concerns: - **GitHub**: [@taurgis](https://github.com/taurgis) - **Project**: [sfcc-dev-mcp](https://github.com/taurgis/sfcc-dev-mcp) --- Thank you for helping keep the SFCC Development MCP Server and its users safe! 🛡️ ``` -------------------------------------------------------------------------------- /tests/mcp/AGENTS.md: -------------------------------------------------------------------------------- ```markdown # MCP Aegis - AI Agent Guide **Target Audience**: AI coding assistants, automated testing agents, and AI-powered development tools ## Overview # MCP Aegis - AI Agent Guide ## 🎯 About This Project This project uses **MCP Aegis** for testing Model Context Protocol (MCP) servers. **MCP Aegis** is a comprehensive Node.js testing library for Model Context Protocol (MCP) servers. It provides both **declarative YAML-based testing** and **programmatic JavaScript/TypeScript testing** with 35+ verified pattern matching capabilities including exact numeric equality, floating-point tolerance, decimal precision validation, modular arithmetic, and comprehensive date/timestamp validation. ## 📁 Dedicated Agent Guides This guide has been restructured into focused, dedicated guides for each testing approach: ### **[YAML Testing Guide](./yaml/AGENTS.md)** - **Focus**: Declarative, human-readable test files - **Best For**: Protocol compliance, basic tool testing, maintainable test suites - **Audience**: Agents generating `.test.mcp.yml` files - **Key Features**: 35+ pattern matching types including exact numeric equality, floating-point tolerance, decimal precision validation, modular arithmetic, and date/timestamp validation, CLI debugging, no programming required ### **[Programmatic Testing Guide](./node/AGENTS.md)** - **Focus**: JavaScript/TypeScript API integration - **Best For**: Complex validation, existing test suites, multi-step workflows - **Audience**: Agents generating `.programmatic.test.js` files - **Key Features**: Jest/Mocha integration, dynamic validation, performance testing ## Quick Decision Matrix | Use Case | YAML Testing | Programmatic Testing | |----------|--------------|---------------------| | **Protocol compliance** | ✅ Excellent | ✅ Excellent | | **Simple tool testing** | ✅ Perfect | ⚠️ Overkill | | **Pattern matching** | ✅ 29+ built-in types | ⚠️ Manual assertions | | **Complex validation** | ⚠️ Limited logic | ✅ Full JavaScript | | **Multi-step workflows** | ❌ Not supported | ✅ Perfect | | **Existing test suites** | ❌ Separate runner | ✅ Jest/Mocha/Node.js | | **CI/CD integration** | ✅ JSON output | ✅ Standard test runners | | **Maintenance** | ✅ Declarative | ⚠️ Code maintenance | ## 📚 Additional Resources ### Documentation - **[Complete Documentation](https://aegis.rhino-inquisitor.com/)** - Full guide and reference - **[Installation](https://aegis.rhino-inquisitor.com/installation.html)** | **[Quick Start](https://aegis.rhino-inquisitor.com/quick-start.html)** - **[Pattern Matching](https://aegis.rhino-inquisitor.com/pattern-matching.html)** | **[Examples](https://aegis.rhino-inquisitor.com/examples.html)** ### MCP Architecture for AI Agents ``` AI Agent → MCP Client → MCP Server → Tools/Services ↓ MCP Aegis → Test Validation → Quality Assurance ``` **Common Tool Categories**: Data retrieval, content generation, external services, analysis tools, component libraries, knowledge bases ## Universal Setup Both testing approaches require initial configuration: ### 1. Installation ```bash npm install -g mcp-aegis # OR npm install --save-dev mcp-aegis # OR use init to auto-install npx mcp-aegis init ``` ### 2. Configuration File (`aegis.config.json`) ```json { "name": "My MCP Server", "command": "node", "args": ["./server.js"], "startupTimeout": 5000, "env": { "NODE_ENV": "test" } } ``` ### 3. Test Execution ```bash # YAML Testing aegis "tests/**/*.test.mcp.yml" --config "aegis.config.json" # Programmatic Testing node --test "tests/**/*.programmatic.test.js" # Interactive debugging (NEW): Test individual tools without files aegis query --config "aegis.config.json" # List tools aegis query tool_name '{"param": "value"}' --config "config.json" # Test tool ``` ## When to Use Each Approach ### Choose YAML Testing When: - Testing basic MCP protocol compliance - Validating simple tool executions - Creating maintainable test suites for non-developers - Using built-in pattern matching is sufficient - CI/CD needs declarative test definitions ### Choose Programmatic Testing When: - Integration with existing JavaScript/TypeScript test suites - Complex validation logic required - Multi-step agent workflows need testing - Dynamic test case generation needed - Performance testing and monitoring required ### Use Query Command For: - **Rapid development**: Test tools immediately during development - **Server validation**: Verify server behavior before writing comprehensive tests - **Tool discovery**: Explore available tools and understand their signatures - **Debugging**: Inspect exact responses and error conditions - **Prototyping**: Quick validation during MCP server development ## Integration Examples ### GitHub Copilot Integration Add to `.github/copilot-instructions.md`: ```markdown ## MCP Testing Standards 1. Use MCP Aegis for all MCP server testing 2. Create both YAML (protocol) and programmatic (complex) tests 3. Reference dedicated guides: - YAML: ./AGENTS/yaml/AGENTS.md - Code: ./AGENTS/node/AGENTS.md 4. Follow 35+ verified pattern matching types including numeric comparisons 5. Ensure JSON-RPC 2.0 compliance ``` ### NPM Scripts Integration ```json { "scripts": { "test:mcp:yaml": "aegis 'tests/**/*.test.mcp.yml' --config './aegis.config.json'", "test:mcp:code": "node --test 'tests/**/*.programmatic.test.js'", "test:mcp:all": "npm run test:mcp:yaml && npm run test:mcp:code", "test:mcp:ci": "npm run test:mcp:yaml -- --json && npm run test:mcp:code", "debug:mcp:tools": "aegis query --config './aegis.config.json'", "debug:mcp:tool": "aegis query" } } ``` **Usage examples**: ```bash npm run test:mcp:all # Run all tests npm run debug:mcp:tools # List available tools npm run debug:mcp:tool read_file '{"path": "test.txt"}' # Test specific tool ``` --- **For detailed implementation guidance, see the dedicated guides:** - **[YAML Testing Guide](./yaml/AGENTS.md)** - Pattern matching, CLI options, real examples - **[Programmatic Testing Guide](./node/AGENTS.md)** - API reference, frameworks, advanced scenarios ``` -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- ```markdown # Contributing to SFCC Development MCP Server Thank you for your interest in contributing to the SFCC Development MCP Server! This project provides MCP tools for Salesforce B2C Commerce Cloud development assistance, including documentation access, best practices guides, log analysis, and system object definitions. ## Table of Contents - [Getting Started](#getting-started) - [Development Setup](#development-setup) - [Project Structure](#project-structure) - [Contributing Guidelines](#contributing-guidelines) - [Types of Contributions](#types-of-contributions) - [Development Workflow](#development-workflow) - [Testing](#testing) - [Code Style](#code-style) - [Documentation](#documentation) - [Submitting Changes](#submitting-changes) - [Release Process](#release-process) ## Getting Started ### Prerequisites - Node.js (version 18 or higher) - npm or yarn - Git - SFCC instance access (for testing full mode features) ### Fork and Clone 1. Fork the repository on GitHub 2. Clone your fork locally: ```bash git clone https://github.com/YOUR_USERNAME/sfcc-dev-mcp.git cd sfcc-dev-mcp ``` ## Development Setup 1. Install dependencies: ```bash npm install ``` 2. Build the project: ```bash npm run build ``` 3. Run in development mode: ```bash npm run dev ``` 4. Test with MCP Inspector: ```bash npm run inspector ``` ### Environment Configuration For testing full mode features, create a `dw.json` file in the project root: ```json { "hostname": "your-instance.sandbox.us01.dx.commercecloud.salesforce.com", "username": "your-username", "password": "your-password", "client-id": "your-client-id", "client-secret": "your-client-secret" } ``` **Note**: Never commit this file. It's already in `.gitignore`. ## Project Structure ``` src/ ├── main.ts # Entry point ├── server.ts # MCP server implementation ├── tool-definitions.ts # MCP tool definitions ├── types.ts # TypeScript type definitions ├── config.ts # Configuration management ├── best-practices-client.ts # Best practices guide client ├── docs-client.ts # SFCC documentation client ├── log-client.ts # SFCC log analysis client ├── ocapi-client.ts # OCAPI system object client └── utils.ts # Utility functions docs/ ├── best-practices/ # Best practice guides └── dw_*/ # SFCC API documentation tests/ # Test files scripts/ # Build and utility scripts ``` ## Contributing Guidelines ### Code of Conduct - Be respectful and inclusive - Focus on constructive feedback - Help maintain a welcoming environment for all contributors ### Before Contributing 1. Check existing issues and pull requests 2. Open an issue to discuss major changes 3. Ensure your contribution aligns with project goals ## Types of Contributions ### 1. Bug Fixes - Fix bugs in existing functionality - Improve error handling - Fix documentation inconsistencies ### 2. Feature Enhancements - Add new MCP tools - Improve existing tool functionality - Enhance SFCC API coverage ### 3. Documentation - Update best practice guides - Add new SFCC API documentation - Improve code comments and README ### 4. Testing - Add unit tests - Improve test coverage - Add integration tests ### 5. Performance Improvements - Optimize API calls - Improve caching mechanisms - Reduce memory usage ## Development Workflow ### 1. Create a Branch ```bash git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix ``` ### 2. Make Changes - Follow the existing code style - Add tests for new functionality - Update documentation as needed ### 3. Test Your Changes ```bash # Run tests npm test # Run linting npm run lint # Test with MCP Inspector npm run inspector ``` ### 4. Commit Changes ```bash git add . git commit -m "feat: add new SFCC tool for product management" ``` Use conventional commit messages: - `feat:` for new features - `fix:` for bug fixes - `docs:` for documentation changes - `test:` for test additions/changes - `refactor:` for code refactoring - `chore:` for maintenance tasks ## Testing ### Running Tests ```bash # Run all tests npm test # Run tests in watch mode npm run test:watch # Run tests with coverage npm run test:coverage ``` ### Writing Tests - Place test files in the `tests/` directory - Use the `.test.ts` suffix - Follow existing test patterns - Aim for good test coverage of new functionality ### Test Categories 1. **Unit Tests**: Test individual functions and classes 2. **Integration Tests**: Test MCP tool functionality 3. **Mock Tests**: Use mocks for external SFCC API calls ## Code Style ### ESLint Configuration The project uses ESLint for code style enforcement: ```bash # Check for linting issues npm run lint # Auto-fix linting issues npm run lint:fix ``` ### TypeScript - Use TypeScript for all new code - Provide proper type definitions - Avoid `any` types when possible - Use interfaces for object shapes ### Formatting - Use 2 spaces for indentation - Use single quotes for strings - Add trailing commas in objects and arrays - Follow existing code patterns ## Documentation ### Best Practice Guides When adding or updating guides in `docs/best-practices/`: 1. Follow the existing markdown structure 2. Include practical examples 3. Reference relevant SFCC APIs 4. Provide security considerations ### API Documentation When updating SFCC API docs: 1. Use the conversion script: `npm run convert-docs` 2. Ensure proper markdown formatting 3. Include complete method signatures 4. Add usage examples where helpful ### Code Comments - Comment complex business logic - Explain non-obvious implementation decisions - Use JSDoc for public APIs - Keep comments up to date with code changes ## Submitting Changes ### Pull Request Process 1. Push your branch to your fork 2. Create a pull request against the main branch 3. Fill out the pull request template 4. Link any related issues ### Pull Request Guidelines - Provide a clear description of changes - Include the motivation for the change - List any breaking changes - Add screenshots for UI changes (if applicable) - Ensure all tests pass - Update documentation as needed ### Review Process - At least one maintainer review is required - Address any feedback promptly - Keep the pull request focused and atomic - Rebase if requested to maintain clean history ## Release Process ### Versioning The project follows [Semantic Versioning](https://semver.org/): - **MAJOR**: Breaking changes - **MINOR**: New features (backward compatible) - **PATCH**: Bug fixes (backward compatible) ### Release Steps 1. Update version in `package.json` 2. Update CHANGELOG.md 3. Create a release tag 4. Publish to npm registry ## Getting Help ### Communication Channels - GitHub Issues: For bug reports and feature requests - GitHub Discussions: For questions and general discussion - Pull Request Comments: For code review discussions ### Documentation Resources - [MCP Documentation](https://modelcontextprotocol.io/) - [SFCC API Documentation](https://documentation.b2c.commercecloud.salesforce.com/) - [TypeScript Documentation](https://www.typescriptlang.org/docs/) ## Recognition Contributors will be recognized in: - GitHub contributor list - Release notes for significant contributions - Special mentions for outstanding contributions Thank you for contributing to the SFCC Development MCP Server! Your contributions help make SFCC development more accessible and efficient for the entire community. ``` -------------------------------------------------------------------------------- /docs/best-practices/security.md: -------------------------------------------------------------------------------- ```markdown # Salesforce B2C Commerce Cloud: Secure Coding Best Practices This document provides a concise guide to security best practices for Salesforce B2C Commerce Cloud development, focusing on SFRA Controllers, OCAPI/SCAPI Hooks, and Custom SCAPI Endpoints. ----- ## Core Security Principles - **Shared Responsibility**: Salesforce secures the cloud infrastructure. You, the developer, are responsible for securing the custom code you write *in* the cloud. - **Defense-in-Depth**: Security is layered. Do not rely on a single control (like a WAF). Your code must be independently secure. - **OWASP Top 10**: All development should align with OWASP principles to mitigate common web application vulnerabilities. - **Server-Side Validation**: Always validate and sanitize all user input on the server. Client-side validation is for user experience only and provides no security. Use an allowlist approach. - **Secrets Management**: Never hardcode secrets (API keys, credentials). Store them in Custom Site Preferences. - **Secure Cryptography**: Use the `dw.crypto` package for all cryptographic operations. Avoid deprecated `Weak*` classes like `WeakCipher`. - **HTTP Security Headers**: Configure security headers like `Content-Security-Policy`, `X-Frame-Options`, and `Strict-Transport-Security` in the `httpHeaders.json` file. ----- ## 1\. Securing SFRA Controllers Controllers are the entry point for storefront logic. Security here is paramount. ### Authentication & Authorization Always verify **who** the user is (authentication) and **what** they are allowed to do (authorization). There are off course anonymous users, but authenticated users must be verified before accessing protected resources such as the profile, basket, or order history. - **Authentication**: Use the `userLoggedIn` middleware to ensure a shopper is logged in. - **Authorization**: After authenticating, verify the user owns the data they are trying to access or modify (e.g., check if `basket.customerNo` matches `req.currentCustomer.profile.customerNo`). ```javascript var server = require('server'); var userLoggedIn = require('\*/cartridge/scripts/middleware/userLoggedIn'); var CustomerMgr = require('dw/customer/CustomerMgr'); // The 'userLoggedIn.validateLoggedIn' middleware handles authentication. server.post('UpdateProfile', userLoggedIn.validateLoggedIn, function (req, res, next) { // Authorization MUST be performed inside the controller logic. var profileForm = server.forms.getForm('profile'); var customer = CustomerMgr.getCustomerByCustomerNumber( req.currentCustomer.profile.customerNo ); // Example Authorization Check: Does the logged-in user own this data? if (customer.profile.email!== profileForm.email.value) { res.setStatusCode(403); res.json({ error: 'Forbidden' }); return next(); } //... proceed with business logic... res.json({ success: true }); next(); }); module.exports = server.exports(); ```` ### Cross-Site Request Forgery (CSRF) Protection Use the `csrfProtection` middleware for any state-changing POST request. [12, 13] 1. **Generate Token**: Use `csrfProtection.generateToken` when rendering the form page. 2. **Validate Token**: Use `csrfProtection.validateRequest` when processing the form submission. ```isml <form action="${URLUtils.url('Account-HandleProfileUpdate')}" method="POST"> ... <input type="hidden" name="${pdict.csrf.tokenName}" value="${pdict.csrf.token}"/> <button type="submit">Save</button> </form> ```` ```javascript // In your controller var csrfProtection = require('*/cartridge/scripts/middleware/csrf'); // 1. Generate token for the form page server.get('EditProfile', csrfProtection.generateToken, function(req, res, next) { //... render page... }); // 2. Validate token on form submission server.post('HandleProfileUpdate', csrfProtection.validateRequest, function(req, res, next) { // If execution reaches here, the token was valid. //... process form... }); ``` #### CRITICAL: CSRF Middleware Automation **❌ COMMON MISTAKE**: Manually adding CSRF tokens to viewData ```javascript // ❌ WRONG - Don't do this! server.get('ShowForm', csrfProtection.generateToken, function(req, res, next) { res.render('myForm', { csrf: { tokenName: req.csrf.tokenName, // ❌ Redundant token: req.csrf.token // ❌ Redundant } }); }); ``` **✅ CORRECT APPROACH**: Let middleware handle it automatically ```javascript // ✅ CORRECT - Middleware automatically adds CSRF to pdict server.get('ShowForm', csrfProtection.generateToken, function(req, res, next) { res.render('myForm', { // No need to manually add CSRF - middleware does this pageTitle: 'My Form', otherData: 'value' }); // pdict.csrf.tokenName and pdict.csrf.token are automatically available }); ``` ### Remote Include Security (server.middleware.include) Remote includes (`<isinclude url="...">`) invoke an entirely NEW request created by the Web Adapter – they DO NOT inherit the authentication context of the parent page. Treat every remote include endpoint as PUBLIC unless you explicitly secure it. | Risk Vector | Description | Mitigation | |-------------|-------------|------------| | Authentication Bypass | Endpoint renders user‑specific data but no login check runs on include request | Add `userLoggedIn.validateLoggedIn` AFTER `server.middleware.include` | | Sensitive Data in URL | All params are query string → logged, bookmarkable, cache key | Pass only minimal identifiers; never PII, secrets, tokens | | Cache Poisoning | Unique per-user params (e.g., session IDs) fragment cache & may expose personalized fragments | Keep URL stable; use surrogate keys / vary headers where needed | | Excessive Fragment Count | Many includes amplify attack surface & performance risk | Keep < 20 per page; consolidate where feasible | | Nested Includes Depth Abuse | Recursive fragment chains complicate security review & tracing | Avoid nesting beyond depth 2 | #### Mandatory Middleware Order ```javascript server.get('AccountWidget', server.middleware.include, // 1. Gatekeeper – blocks direct access without include flag userLoggedIn.validateLoggedIn, // 2. Re-establish authenticated context if user data needed cache.applyShortPromotionSensitiveCache, // 3. Explicit cache policy (or disable) function (req, res, next) { // SAFE: now in controlled context res.render('components/account/widget'); next(); } ); ``` NEVER put `userLoggedIn.validateLoggedIn` before `server.middleware.include` – bots probing the route directly would still trigger authentication logic (unnecessary overhead) and you’d miss the explicit architectural contract. #### Identifying Remote Include Requests `req.includeRequest === true` inside the controller. Log defensively: ```javascript if (!req.includeRequest) { // Unexpected direct access attempt Logger.warn('Blocked direct access to remote include endpoint: {0}', request.httpPath); res.setStatusCode(404); return next(); } ``` #### What NOT to Expose via Remote Include - Full order history snippets - Payment method lists / masked credit cards - Personally identifying profile composites - Any fragment whose output differs materially per authenticated user unless properly protected #### Logging & Forensics Use extended request ID format (`baseId-depth-index`) to correlate parent + fragment in logs. Example: `Xa12Bc-0-00` (page), `Xa12Bc-1-02` (third fragment). This enables rapid blast-radius analysis during incident response. #### Security Review Checklist ```text [ ] server.middleware.include first in chain [ ] Auth middleware present if user / sensitive data [ ] No secrets / PII in query params [ ] Cache TTL appropriate (0 for volatile personal data) [ ] Fragment count on target pages audited (<20) [ ] No deep nesting (depth <= 2) [ ] Logging on unexpected direct access attempts ``` If any checklist item fails, remediate before deployment. #### How CSRF Middleware Works **`csrfProtection.generateToken` automatically:** - Generates a secure token - Adds `csrf.tokenName` and `csrf.token` to the response's viewData - Makes them available in templates as `${pdict.csrf.tokenName}` and `${pdict.csrf.token}` **Templates access tokens directly:** ```isml <!-- ✅ Tokens available automatically --> <input type="hidden" name="${pdict.csrf.tokenName}" value="${pdict.csrf.token}"/> ``` **`csrfProtection.validateRequest` automatically:** - Validates the submitted token - Handles failures (logout/redirect) - Allows controller to proceed only if valid **Key Principle**: Never manually add CSRF data to viewData - the middleware handles this completely. Manually adding CSRF tokens is redundant and can lead to inconsistencies or security issues. ### Server-Side Validation & Output Encoding - **Validation**: Define validation rules (e.g., `mandatory`, `regexp`, `max-length`) in your form definition XML. SFRA automatically enforces these on the server when the form is processed. [14] - **Output Encoding**: Always use `encoding="on"` in `<isprint>` tags to prevent XSS. This is the default and should not be turned off without a specific, secure reason. [9] <!-- end list --> ```xml <field formid="email" type="string" mandatory="true" max-length="50" regexp="^[\w.%+-]+@[\w.-]+\.[\w]{2,6}$" parse-error="error.message.parse.email" /> ``` ```isml <div>Your email: <isprint value="${pdict.profileForm.email.value}" encoding="on" /></div> ``` ----- ## 2\. Securing OCAPI/SCAPI Hooks Hooks are powerful but dangerous. They run in a privileged context *after* initial gateway authentication but *before* business-level authorization. [15, 16] **Primary Rule**: Never trust the request. Always re-validate authorization inside the hook script. Check that the authenticated user owns the object being modified. [16] ### Authorization Example (`beforePATCH` hook) ```javascript 'use strict'; var Status = require('dw/system/Status'); var Logger = require('dw/system/Logger'); exports.beforePATCH = function (basket, productItem, productItemDocument) { // The gateway authenticated the client, but we MUST authorize the action. if (customer.authenticated) { // CRITICAL AUTHORIZATION CHECK: if (basket.customerNo!== customer.profile.customerNo) { Logger.getLogger('Security').warn('Auth failure: Customer {0} tried to modify basket {1}', customer.profile.customerNo, basket.basketNo); // Return an error to block the operation. return new Status(Status.ERROR, 'AUTH_ERROR', 'Request could not be processed.'); } } //... additional validation on productItemDocument... return new Status(Status.OK); // Allow operation }; ``` ### Hook Best Practices - **Performance**: Keep hook logic simple and fast. Avoid making new database calls (e.g., `ProductMgr.getProduct()`). [17, 18, 19] - **Error Handling**: Wrap logic in `try-catch` blocks. Return generic `dw.system.Status` errors to the client. Log detailed, non-sensitive error information for debugging. [16, 20] ----- ## 3\. Securing Custom SCAPI Endpoints Custom SCAPI Endpoints use a "contract-first" security model. The OpenAPI Specification (OAS) 3.0 YAML file is an active, enforceable security policy. [21, 22] ### Contract-First Security The platform validates requests against the OAS contract at the edge, *before* your script runs. Any request with undefined parameters, headers, or body structures is automatically rejected. [23, 24] ### Security Schemes & Scopes Define security in the OAS contract using `securitySchemes` and apply them to endpoints. Each endpoint must have exactly one custom scope (prefixed with `c_`). [21, 25] - **`ShopperToken`**: For customer-facing APIs. Uses SLAS JWTs. [25] - **`AmOAuth2`**: For admin/back-office APIs. Uses Account Manager tokens. [25] <!-- end list --> ```yaml openapi: 3.0.0 info: title: Custom Loyalty API version: "1.0.0" servers: - url: https://{shortCode}.api.commercecloud.salesforce.com paths: /c_loyalty/v1/organizations/{organizationId}/shoppers/me/points: get: summary: Get Loyalty Points for the current Shopper operationId: getLoyaltyPointsForShopper # This endpoint requires a ShopperToken with the 'c_loyalty.read' scope. security: - ShopperToken: [c_loyalty.read] responses: '200': description: Success. /c_loyalty/v1/organizations/{organizationId}/customers/{customerId}/points_adjustment: post: summary: Adjust Loyalty Points for a specific customer (Admin Only) operationId: adjustCustomerLoyaltyPoints # This endpoint requires an Admin token with the 'c_loyalty.write' scope. security: - AmOAuth2: [c_loyalty.write] responses: '204': description: Success. # Reusable security scheme definitions components: securitySchemes: # Definition for Shopper APIs ShopperToken: type: http scheme: bearer bearerFormat: JWT description: "Requires a Shopper Access Token (SLAS) with c_ scopes." # Definition for Admin APIs AmOAuth2: type: oauth2 description: "Requires an Account Manager token with c_ scopes." flows: clientCredentials: tokenUrl: [https://account.demandware.com/dwsso/oauth2/access_token](https://account.demandware.com/dwsso/oauth2/access_token) scopes: c_loyalty.read: "Read shopper loyalty data." c_loyalty.write: "Modify shopper loyalty data." ``` ## 4\. Advanced Secrets Management Hardcoding secrets such as API keys, credentials, or encryption keys in source code is a severe vulnerability. The platform provides specific, secure locations for storing different types of secrets: - **Service Credentials (`dw.svc.ServiceCredential`)**: The most secure and appropriate method for storing secrets used to authenticate to external services (e.g., payment gateways, tax providers, shipping services). Credentials are created and managed in Business Manager (`Administration > Operations > Services`). In code, they are accessed as a read-only `dw.svc.ServiceCredential` object, and their values are never exposed in logs or to the client. This should be the default choice for any third-party integration credential. - **Encrypted Custom Object Attributes**: For storing other types of sensitive data that are not service credentials, create a custom attribute on a system or custom object and set its type to `PASSWORD`. The platform automatically encrypts the value of this attribute at rest. - **Custom Site Preferences**: Suitable for storing non-secret configuration values, such as feature toggles, endpoint URLs, or less sensitive identifiers. While a vast improvement over hardcoding, they are not encrypted in the same way as `ServiceCredential` or `PASSWORD` attributes and should not be the first choice for highly sensitive secrets like private keys or primary authentication credentials. ## 5. Modern Cryptography with dw.crypto All cryptographic operations must be performed using the APIs provided in the dw.crypto package. This package provides access to industry-standard, Salesforce-maintained cryptographic libraries. A critical security mandate is to avoid all deprecated Weak* classes, such as WeakCipher, WeakMac, and WeakMessageDigest. These classes use outdated and insecure algorithms that are vulnerable to attack. Some older third-party cartridges may still contain references to them; these cartridges must be updated or replaced. All new development must use the modern classes like dw.crypto.Cipher. The following is a secure example of symmetric encryption using AES with a GCM block mode, which provides both confidentiality and authenticity. ```javascript var Cipher = require('dw/crypto/Cipher'); var Encoding = require('dw/crypto/Encoding'); var SecureRandom = require('dw/crypto/SecureRandom'); // Key must be a securely generated, Base64-encoded 256-bit (32-byte) key. // It should be stored securely using Service Credentials or an encrypted attribute. var base64Key = 'YOUR_SECURE_BASE64_ENCODED_KEY_HERE'; // Plaintext to be encrypted var plainText = 'This is sensitive data.'; // 1. Generate a cryptographically secure random Initialization Vector (IV). // For AES/GCM, a 12-byte (96-bit) IV is recommended. var ivBytes = new SecureRandom().nextBytes(12); var ivBase64 = Encoding.toBase64(ivBytes); // 2. Encrypt the data using a strong, authenticated encryption algorithm. var aesGcmCipher = new Cipher(); var encryptedBase64 = aesGcmCipher.encrypt(plainText, base64Key, 'AES/GCM/NoPadding', ivBase64, 0); // To decrypt, you need the encrypted data, the key, and the same IV. // var decryptedText = aesGcmCipher.decrypt(encryptedBase64, base64Key, 'AES/GCM/NoPadding', ivBase64, 0); ``` ### Cryptographic Best Practices - **Use Strong Algorithms**: Always use AES with GCM mode for symmetric encryption, RSA with OAEP padding for asymmetric encryption, and SHA-256 or higher for hashing. - **Generate Secure Random Values**: Use `dw.crypto.SecureRandom` for generating cryptographically secure random numbers, IVs, and salts. - **Proper Key Management**: Store encryption keys securely using Service Credentials or encrypted custom object attributes. Never hardcode keys in source code. - **Use Authenticated Encryption**: Prefer AES/GCM mode which provides both confidentiality and authenticity, preventing tampering with encrypted data. - **Unique IVs**: Always generate a unique, random IV for each encryption operation. Never reuse IVs with the same key. - **Avoid Weak Classes**: Never use WeakCipher, WeakMac, WeakMessageDigest, or any other deprecated cryptographic classes. ``` -------------------------------------------------------------------------------- /AGENTS.md: -------------------------------------------------------------------------------- ```markdown # AGENTS.md – SFCC Development MCP Server (AI Coding Agent Instructions) This file provides authoritative, agent-focused operational guidelines. It complements `README.md` by documenting build/test workflows, architectural conventions, and maintenance rules that would clutter a human-facing introduction. Goals of `AGENTS.md`: - Give any AI coding agent (Copilot, Cursor, Claude, Gemini, Aider, Factory, Ona, Devin, Zed, etc.) a predictable place to load project instructions - Separate contributor onboarding (README) from deep operational detail (here) - Encourage portable, open, plain-Markdown instructions (no proprietary schema) Agent Operating Principles (Quick Commit Rules): 1. Verify reality first (counts, structures) with commands—never guess 2. Make surgical diffs—no drive‑by formatting or unrelated refactors 3. Validate after every substantive change (build + lint + relevant tests) 4. Prefer explicit, readable code & docs over clever abstractions 5. Surface ambiguity or risky instructions with safer alternatives 6. Keep `AGENTS.md` ↔ `README.md` in sync where they overlap (update both or neither) 7. Discover actual tool response formats with `npx aegis query` before writing tests 8. Treat security (credentials, paths, network) as a first‑class concern—assume local but protect anyway 9. Defer performance tuning unless a measurable issue exists; avoid premature micro‑optimizations 10. Fail loud & clear: actionable error messages, user vs system error distinction ## 🤖 Unified Engineering Principles & Persona Operate as a senior TypeScript / Node.js engineer with deep MCP + SFCC (OCAPI, SCAPI, WebDAV, logs, system objects, preferences) domain knowledge. Apply the following unified principles (consolidates former Persona, Professional Standards, Development Approach, and Development Guidelines): ### Core Competencies - MCP protocol compliance & tool schema rigor - SFCC integration breadth: logs, job logs, OCAPI auth, system objects, site preferences - Strong TypeScript typing, safe narrowing, interface-driven design - OAuth + token lifecycle correctness - Log & job execution analysis (parsing, summarization, health signals) - Documentation ingestion (scan → parse → resolve → extract types) - Multi-layer test strategy: Jest (unit) + Aegis YAML (declarative) + Node programmatic (stateful) ### Quality & Safety - Intentional, maintainable code; small reversible changes - Security first: never leak credentials, avoid accidental network exfiltration, sanitize paths - Explicit error modeling: distinguish user input errors vs system/internal failures - Deterministic + cache-aware logic; avoid hidden side effects - Respect local dev constraints—opt for lightweight operations ### Documentation Discipline - Update BOTH `AGENTS.md` & `README.md` for: tool count changes, new handlers, structural moves, added operating modes, configuration shifts - Quantify before asserting (grep / awk / find) – no hand-waved counts - Keep architectural diagrams & tool categories consistent with `src/core/tool-definitions.ts` ### Testing Strategy - Always discover real response shape with `npx aegis query` (success, empty, error variants) before writing tests - Unit tests: core utilities, parsing, validation, token & client logic - YAML tests: broad tool surface, schema/shape validation, edge cases - Programmatic tests: multi-step flows, stderr management, stateful sequences - Performance assertions: CI‑tolerant (<500ms typical, variation <50×) – functional correctness first ### Implementation Workflow 1. Define or adjust tool schema (if new) in `core/tool-definitions.ts` 2. Implement / extend handler (or add new) with clear separation of concerns 3. Add / update clients & services with DI-friendly patterns (`ClientFactory` + interfaces) 4. Run targeted Aegis discovery (success + edge) to capture real output 5. Write/adjust tests (unit + YAML/programmatic where appropriate) 6. Verify counts & update docs (both files) atomically 7. Run lint + tests; address failures before further edits 8. Commit with concise, scope-focused message ### YAML Test Development (Critical Process) **MANDATORY for all YAML test modifications**: Before writing or modifying ANY YAML test: 1. **Discovery First**: Use `npx aegis query [tool_name] '[params]' --config "[config.json]"` to discover actual response formats 2. **Test Success & Failure**: Query both successful and failure scenarios to understand all response variations 3. **Document Findings**: Add comments to YAML tests showing discovery commands and expected formats 4. **Choose Correct Patterns**: Use patterns that match the actual response structure, not assumptions **Common Mistakes to Avoid**: - Using `arrayLength` on JSON strings instead of actual arrays - Complex regex patterns instead of simpler `contains` or `regex` patterns - Assuming response structure without verification - Writing tests before understanding what the tool actually returns **Example Discovery Process**: ```bash # Discover actual response npx aegis query get_available_best_practice_guides '{}' --config "./aegis.config.docs-only.json" # Response: {"content": [{"type": "text", "text": "[{\"name\":\"guide1\",...}]"}], "isError": false} # Pattern: text: "match:contains:guide1" (not arrayLength since it's a JSON string) ``` ### Performance & Stability - Optimize only after measuring; instrument where ambiguity exists - Use caching deliberately; document invalidation triggers - Keep handler execution time predictable; stream or range-read logs where possible ### When In Doubt - Pause and gather empirical data - Prefer minimal, additive change over speculative refactor - Escalate ambiguity via explicit options rather than guessing --- ## 📋 Project Overview The **SFCC Development MCP Server** is a **local development** Model Context Protocol server that provides AI agents with comprehensive access to Salesforce B2C Commerce Cloud development tools and resources. This project bridges the gap between AI assistants and SFCC development workflows **for individual developers working on their local machines**. ### 🎯 Project Goals 1. **Enable AI-Assisted SFCC Development**: Provide AI agents with real-time access to SFCC documentation, logs, and system objects **during local development** 2. **Reduce Development Time**: Eliminate the need to manually search through documentation or logs **while coding** 3. **Improve Code Quality**: Provide access to current best practices and development guidelines **for personal projects** 4. **Enhance Local Debugging**: Offer real-time log analysis and error investigation tools **for developer sandbox instances** 5. **Support Multiple Use Cases**: Work in both documentation-only and full-credential modes **for different development scenarios** ### 🏗️ Project Structure ``` sfcc-dev-mcp/ ├── src/ # Core TypeScript source code │ ├── main.ts # CLI entry point and argument parsing │ ├── index.ts # Package exports and compatibility │ ├── core/ # Core MCP server functionality │ │ ├── server.ts # Main MCP server implementation │ │ ├── tool-definitions.ts # MCP tool schema definitions │ │ └── handlers/ # Modular tool handlers │ │ ├── base-handler.ts # Abstract base handler with common functionality │ │ ├── client-factory.ts # Centralized client creation with dependency injection │ │ ├── validation-helpers.ts # Common validation utilities for handlers │ │ ├── docs-handler.ts # SFCC documentation tool handler │ │ ├── best-practices-handler.ts # Best practices tool handler │ │ ├── sfra-handler.ts # SFRA documentation tool handler │ │ ├── log-handler.ts # Log analysis tool handler │ │ ├── system-object-handler.ts # System object tool handler │ │ ├── code-version-handler.ts # Code version tool handler │ │ └── cartridge-handler.ts # Cartridge generation tool handler │ ├── clients/ # API clients for different services │ │ ├── base/ # Base client classes and shared functionality │ │ │ ├── http-client.ts # Base HTTP client with authentication │ │ │ ├── ocapi-auth-client.ts # OCAPI OAuth authentication client │ │ │ └── oauth-token.ts # OAuth token management for OCAPI │ │ ├── ocapi/ # Specialized OCAPI clients │ │ │ ├── site-preferences-client.ts # Site preferences management │ │ │ └── system-objects-client.ts # System object definitions │ │ ├── logs/ # Modular log analysis system │ │ │ ├── log-client.ts # Main log client orchestrator │ │ │ ├── webdav-client-manager.ts # WebDAV setup & authentication │ │ │ ├── log-file-reader.ts # File reading with range requests │ │ │ ├── log-file-discovery.ts # File listing & filtering │ │ │ ├── log-processor.ts # Log parsing & entry processing │ │ │ ├── log-analyzer.ts # Analysis & summarization │ │ │ ├── log-formatter.ts # Output formatting │ │ │ ├── log-constants.ts # Constants & configuration │ │ │ ├── log-types.ts # TypeScript interfaces │ │ │ └── index.ts # Module exports │ │ ├── docs/ # Modular SFCC documentation system │ │ │ ├── documentation-scanner.ts # Documentation file discovery and class listing │ │ │ ├── class-content-parser.ts # Markdown parsing and content extraction │ │ │ ├── class-name-resolver.ts # Class name normalization and resolution │ │ │ ├── referenced-types-extractor.ts # Type extraction from documentation content │ │ │ └── index.ts # Module exports │ │ ├── cartridge-generation-client.ts # Cartridge structure generation client │ │ ├── log-client.ts # Log client compatibility wrapper │ │ ├── docs-client.ts # SFCC documentation client orchestrator │ │ ├── sfra-client.ts # SFRA documentation client │ │ ├── ocapi-client.ts # Main OCAPI client coordinator │ │ └── best-practices-client.ts # Best practices guide client │ ├── services/ # Service layer with clean abstractions │ │ ├── index.ts # Service exports and type definitions │ │ ├── file-system-service.ts # File system operations service │ │ └── path-service.ts # Path manipulation service │ ├── config/ # Configuration management │ │ ├── configuration-factory.ts # Config factory for different modes │ │ └── dw-json-loader.ts # dw.json configuration loader │ ├── tool-configs/ # Tool configuration definitions │ │ ├── best-practices-tool-config.ts # Best practices tools configuration │ │ ├── cartridge-tool-config.ts # Cartridge generation tools configuration │ │ ├── code-version-tool-config.ts # Code version tools configuration │ │ ├── docs-tool-config.ts # Documentation tools configuration │ │ ├── job-log-tool-config.ts # Job log tools configuration │ │ ├── log-tool-config.ts # Log analysis tools configuration │ │ ├── sfra-tool-config.ts # SFRA documentation tools configuration │ │ └── system-object-tool-config.ts # System object tools configuration │ ├── utils/ # Utility functions and helpers │ │ ├── cache.ts # Caching layer for API responses │ │ ├── logger.ts # Structured logging system │ │ ├── utils.ts # Common utility functions │ │ ├── validator.ts # Input validation utilities │ │ ├── query-builder.ts # Query string building utilities │ │ └── path-resolver.ts # File path resolution utilities │ └── types/ # TypeScript type definitions │ └── types.ts # Comprehensive type definitions ├── docs/ # SFCC documentation and guides │ ├── best-practices/ # Development best practice guides │ │ ├── cartridge_creation.md │ │ ├── isml_templates.md │ │ ├── job_framework.md │ │ ├── localserviceregistry.md # LocalServiceRegistry integration patterns │ │ ├── ocapi_hooks.md │ │ ├── scapi_hooks.md │ │ ├── sfra_controllers.md │ │ ├── sfra_models.md # SFRA models best practices │ │ ├── sfra_client_side_js.md # SFRA client-side JavaScript patterns │ │ ├── sfra_scss.md # SFRA SCSS override and theming guidance │ │ ├── scapi_custom_endpoint.md │ │ ├── performance.md │ │ └── security.md │ ├── sfra/ # SFRA documentation │ │ ├── server.md │ │ ├── request.md │ │ ├── response.md │ │ ├── querystring.md │ │ └── render.md │ ├── dw_catalog/ # SFCC Catalog API documentation │ ├── dw_customer/ # SFCC Customer API documentation │ ├── dw_order/ # SFCC Order API documentation │ ├── dw_system/ # SFCC System API documentation │ └── [other dw_* namespaces] # Complete SFCC API documentation ├── docs-site/ # React documentation website │ ├── App.tsx # Main React application component │ ├── main.tsx # React application entry point │ ├── index.html # HTML template with SEO and structured data │ ├── constants.tsx # Application constants and configuration │ ├── metadata.json # Site metadata configuration │ ├── types.ts # TypeScript type definitions │ ├── package.json # Node.js dependencies and scripts │ ├── vite.config.ts # Vite build configuration │ ├── tailwind.config.js # Tailwind CSS configuration │ ├── postcss.config.js # PostCSS configuration │ ├── tsconfig.json # TypeScript configuration │ ├── README.md # Documentation site specific README │ ├── components/ # Reusable React components │ │ ├── Badge.tsx # Badge component for status/categories │ │ ├── CodeBlock.tsx # Syntax highlighted code blocks │ │ ├── Collapsible.tsx # Collapsible content sections │ │ ├── ConfigBuilder.tsx # Configuration builder component │ │ ├── ConfigHero.tsx # Configuration page hero section │ │ ├── ConfigModeTabs.tsx # Configuration mode tab switcher │ │ ├── Layout.tsx # Main layout wrapper component │ │ ├── NewcomerCTA.tsx # Call-to-action for new users │ │ ├── NextStepsStrip.tsx # Next steps guidance component │ │ ├── OnThisPage.tsx # Table of contents component │ │ ├── Search.tsx # Search functionality component │ │ ├── Sidebar.tsx # Site navigation sidebar │ │ ├── ToolCard.tsx # Tool display card component │ │ ├── ToolFilters.tsx # Tool filtering controls │ │ ├── Typography.tsx # Typography components (H1, H2, etc.) │ │ ├── VersionBadge.tsx # Version display badge │ │ └── icons.tsx # Icon components library │ ├── pages/ # Page components for routing │ │ ├── HomePage.tsx # Homepage with quick start guide │ │ ├── AIInterfacesPage.tsx # AI interface setup guides │ │ ├── ConfigurationPage.tsx # Configuration documentation │ │ ├── DevelopmentPage.tsx # Development guidelines │ │ ├── ExamplesPage.tsx # Usage examples │ │ ├── FeaturesPage.tsx # Feature documentation │ │ ├── SecurityPage.tsx # Security considerations │ │ ├── ToolsPage.tsx # Available tools documentation │ │ └── TroubleshootingPage.tsx # Troubleshooting guide │ ├── src/ # Source assets and generated files │ │ ├── generated-search-index.ts # Generated search index │ │ └── styles/ # CSS and styling files │ ├── utils/ # Utility functions │ │ ├── search.ts # Search functionality utilities │ │ └── toolsData.ts # Tools data management │ ├── scripts/ # Build and utility scripts │ │ ├── generate-search-index.js # Search index generation script │ │ ├── generate-sitemap.js # Sitemap generation script │ │ └── search-dev.js # Development search utilities │ ├── public/ # Static assets │ │ ├── 404.html # Custom 404 error page │ │ ├── robots.txt # Search engine crawling instructions │ │ ├── sitemap.xml # Site map for search engines │ │ ├── llms.txt # LLM-specific instructions │ │ ├── favicon.ico # Website favicon │ │ ├── favicon-16x16.png # 16x16 favicon variant │ │ ├── favicon-32x32.png # 32x32 favicon variant │ │ ├── apple-touch-icon.png # Apple touch icon │ │ ├── android-chrome-192x192.png # Android Chrome icon 192x192 │ │ ├── android-chrome-512x512.png # Android Chrome icon 512x512 │ │ ├── site.webmanifest # Web app manifest │ │ ├── index.css # Global CSS styles │ │ ├── explain-product-pricing-methods.png # Demo screenshot with MCP │ │ └── explain-product-pricing-methods-no-mcp.png # Demo screenshot without MCP │ ├── dist/ # Built website output (Vite build) │ └── node_modules/ # Node.js dependencies ├── ai-instructions/ # AI instruction files for different platforms │ ├── claude-desktop/ # Claude Desktop specific instructions │ │ └── claude_custom_instructions.md │ ├── cursor/ # Cursor editor specific instructions │ └── github-copilot/ # GitHub Copilot specific instructions │ └── copilot-instructions.md ├── tests/ # Comprehensive test suite │ ├── __mocks__/ # Mock implementations for testing │ │ └── src/ # Source code mocks │ ├── mcp/ # MCP-specific testing tools │ │ ├── node/ # Programmatic JavaScript/TypeScript testing │ │ ├── yaml/ # YAML-based declarative testing │ │ └── test-fixtures/ # Test fixtures and sample data │ ├── servers/ # Test server implementations │ │ └── webdav/ # WebDAV server mocks │ ├── *.test.ts # Individual test files for components │ └── [various test files] # Unit and integration tests ├── scripts/ # Build and documentation scripts └── package.json # Node.js package configuration ``` ### 🔧 Key Components #### **MCP Server Core** (`core/server.ts`) - Implements the Model Context Protocol specification - Handles tool registration and request routing - Manages configuration modes (documentation-only vs. full) - Provides error handling and response formatting - Orchestrates modular tool handlers for different functionality areas #### **Tool Handler Architecture** (`core/handlers/`) - **BaseToolHandler** (`base-handler.ts`): Abstract base class providing common handler functionality, standardized response formatting, execution timing, and error handling patterns - **ClientFactory** (`client-factory.ts`): Centralized client creation with dependency injection support for testing and clean architecture - **ValidationHelpers** (`validation-helpers.ts`): Common validation utilities shared across all handlers - **DocsToolHandler** (`docs-handler.ts`): Handles SFCC documentation tools including class information, method search, and API discovery - **BestPracticesToolHandler** (`best-practices-handler.ts`): Manages best practice guides, security recommendations, and hook reference tables - **SFRAToolHandler** (`sfra-handler.ts`): Processes SFRA documentation requests with dynamic discovery and smart categorization - **LogToolHandler** (`log-handler.ts`): Handles real-time log analysis, error monitoring, and system health summarization - **SystemObjectToolHandler** (`system-object-handler.ts`): Manages system object definitions, custom attributes, and site preferences - **CodeVersionToolHandler** (`code-version-handler.ts`): Handles code version listing, activation, and deployment management - **CartridgeToolHandler** (`cartridge-handler.ts`): Processes cartridge generation requests with complete project setup using dependency injection #### **Client Architecture** ##### **Base Client Infrastructure** (`clients/base/`) - **BaseHttpClient** (`http-client.ts`): Abstract base class providing HTTP operations, authentication handling, and error recovery - **OCAPIAuthClient** (`ocapi-auth-client.ts`): OCAPI-specific OAuth authentication with token management and automatic renewal - **TokenManager** (`oauth-token.ts`): Singleton OAuth token manager for SFCC OCAPI authentication with automatic expiration handling ##### **Specialized OCAPI Clients** (`clients/ocapi/`) - **OCAPISitePreferencesClient** (`site-preferences-client.ts`): Manages site preference searches and configuration discovery - **OCAPISystemObjectsClient** (`system-objects-client.ts`): Provides system object definitions, attribute schemas, and custom object exploration ##### **Modular Log Analysis System** (`clients/logs/`) - **SFCCLogClient** (`log-client.ts`): Main orchestrator that composes specialized log modules for comprehensive log analysis including job logs from deeper folder structures - **WebDAVClientManager** (`webdav-client-manager.ts`): WebDAV authentication and client setup with OAuth and basic auth support - **LogFileReader** (`log-file-reader.ts`): File reading with range request optimization (200KB tail reading) and comprehensive fallback mechanisms - **LogFileDiscovery** (`log-file-discovery.ts`): File listing, filtering by date/level, metadata operations, chronological sorting, and job log discovery from `/Logs/jobs/[job name ID]/` folder structure - **LogProcessor** (`log-processor.ts`): Log parsing, entry extraction, data manipulation, pattern processing, and job log processing (handles all log levels in single files) - **LogAnalyzer** (`log-analyzer.ts`): Advanced analysis including pattern detection, health scoring, trend analysis, and recommendation generation - **LogFormatter** (`log-formatter.ts`): Output formatting, presentation logic, user-friendly message templates, and job execution summaries - **LogConstants** (`log-constants.ts`): Centralized constants, configuration values, message templates, and job log patterns - **LogTypes** (`log-types.ts`): Comprehensive TypeScript interfaces for all log operations including job log types ##### **Modular SFCC Documentation System** (`clients/docs/`) - **DocumentationScanner** (`documentation-scanner.ts`): File discovery and class listing across all SFCC namespaces, scanning Markdown documentation files and building comprehensive class inventories - **ClassContentParser** (`class-content-parser.ts`): Markdown parsing and content extraction, processing class documentation to extract methods, properties, constants, and inheritance information - **ClassNameResolver** (`class-name-resolver.ts`): Class name normalization and resolution, handling various naming patterns and ensuring consistent class identification across the documentation system - **ReferencedTypesExtractor** (`referenced-types-extractor.ts`): Type extraction from documentation content with circular reference protection, identifying SFCC types used in method signatures and class relationships ##### **Service Clients** (`clients/`) - **DocsClient** (`docs-client.ts`): Main orchestrator for SFCC documentation processing that coordinates specialized modules for documentation scanning, content parsing, class name resolution, and type extraction across all namespaces - **LogClient** (`log-client.ts`): Backward compatibility wrapper that re-exports the modular log system - **SFRAClient** (`sfra-client.ts`): Provides comprehensive SFRA (Storefront Reference Architecture) documentation access including Server, Request, Response, QueryString, and render module documentation with method and property details - **OCAPIClient** (`ocapi-client.ts`): Main OCAPI coordinator that orchestrates specialized clients and provides unified interface - **BestPracticesClient** (`best-practices-client.ts`): Serves curated development guides including cartridge creation, ISML templates with security and performance guidelines, job framework development, LocalServiceRegistry service integrations with OAuth patterns and reusable module design, OCAPI/SCAPI hooks, SFRA controllers, SFRA models with JSON object layer design and architecture patterns, SFRA client-side JavaScript architecture (AJAX flows, validation, accessibility), custom endpoints, security recommendations, and performance optimization strategies with hook reference tables - **CartridgeGenerationClient** (`cartridge-generation-client.ts`): Generates complete cartridge structures with clean dependency injection for file system and path operations #### **Configuration Management** (`config/`) - **Configuration Factory** (`configuration-factory.ts`): Creates configurations for different modes - **Config Loader** (`dw-json-loader.ts`): Handles dw.json and environment variable loading #### **Service Layer** (`services/`) - **Service Interfaces** (`index.ts`): Exports clean abstractions for system operations (IFileSystemService, IPathService) - **FileSystemService** (`file-system-service.ts`): Production implementation of file system operations with Node.js fs module - **PathService** (`path-service.ts`): Production implementation of path manipulation with Node.js path module - **Mock Services**: Test implementations providing controlled behavior for unit testing without real file system access #### **Utilities** (`utils/`) - **Caching System** (`cache.ts`): Efficient caching for API responses and documentation - **Logging** (`logger.ts`): Structured logging with debug capabilities - **Path Resolution** (`path-resolver.ts`): Secure file path handling - **Common Utilities** (`utils.ts`): Shared utility functions #### **Tool Categories** 1. **SFCC Documentation Tools** (5 tools) - Class information and method documentation - API search and discovery - Complete SFCC namespace coverage 2. **Best Practices Guides** (4 tools) - Curated development guidelines - Security and performance recommendations - SFRA client-side JavaScript architecture (AJAX, validation, accessibility) - Hook reference tables and examples 3. **Enhanced SFRA Documentation Tools** (5 tools) - **Dynamic Discovery**: Automatically finds all 26+ SFRA documents including core classes, extensive model documentation - **Smart Categorization**: Organizes documents into 7 logical categories (core, product, order, customer, pricing, store, other) - **Advanced Search**: Relevance-scored search across all documents with context highlighting - **Category Filtering**: Explore documents by functional areas for efficient discovery - **Complete Coverage**: Core SFRA classes (Server, Request, Response, QueryString, render) plus comprehensive model documentation (account, cart, products, pricing, billing, shipping, store, customer management, totals, categories, content, locale, addresses, and more) 4. **Cartridge Generation Tools** (1 tool) - Automated cartridge structure creation with direct file generation - Complete project setup with all necessary configuration files - Proper directory organization and file structure 5. **Log Analysis Tools** (8 tools) - Real-time error monitoring - Log search and pattern matching - System health summarization 6. **Job Log Tools** (5 tools) - Job log analysis and debugging - Job execution summaries - Custom job step monitoring 7. **System Object Tools** (6 tools) - Custom attribute discovery - Site preference management - System object schema exploration - Custom object attribute definitions search 8. **Code Version Tools** (2 tools) - Code version listing and management - Code version activation for deployment fixes ### 🚀 Operating Modes #### **Documentation-Only Mode** - No SFCC credentials required - Access to all documentation and best practices - Perfect for learning and reference #### **Full Mode** - Requires SFCC instance credentials - Complete access to logs, job logs, and system objects - Real-time debugging and monitoring capabilities ### 🎯 Development Guidelines (Consolidated Above) Legacy duplication removed. See Unified Engineering Principles section for the authoritative list. - Configuration options or operating modes - Development workflows or best practices - Tool categories or counts - Installation or setup procedures ### 📝 Documentation Maintenance Requirements **Critical**: When making any structural or functional changes to the codebase, you **MUST** update the relevant sections in **BOTH** `AGENTS.md` and `README.md`: #### **Always Verify Counts with Command Line Tools:** Before updating any documentation with tool counts or quantitative information, **ALWAYS** verify the actual numbers using command line tools: ```bash # Total tool count verification grep -c "name: '" src/core/tool-definitions.ts # Individual section counts awk '/export const SFCC_DOCUMENTATION_TOOLS/,/^];/' src/core/tool-definitions.ts | grep -c "name: '" awk '/export const BEST_PRACTICES_TOOLS/,/^];/' src/core/tool-definitions.ts | grep -c "name: '" awk '/export const SFRA_DOCUMENTATION_TOOLS/,/^];/' src/core/tool-definitions.ts | grep -c "name: '" awk '/export const LOG_TOOLS/,/^];/' src/core/tool-definitions.ts | grep -c "name: '" awk '/export const SYSTEM_OBJECT_TOOLS/,/^];/' src/core/tool-definitions.ts | grep -c "name: '" awk '/export const CARTRIDGE_GENERATION_TOOLS/,/^];/' src/core/tool-definitions.ts | grep -c "name: '" awk '/export const CODE_VERSION_TOOLS/,/^];/' src/core/tool-definitions.ts | grep -c "name: '" # Verify file structure changes find src -name "*.ts" -type f | wc -l # Count TypeScript files find docs -name "*.md" -type f | wc -l # Count documentation files ``` **Never assume or estimate counts** - always verify with actual command line verification before updating documentation. #### **Required Updates For:** - **File Renames/Moves**: Update project structure diagram and component descriptions in AGENTS.md; update any file references in README.md - **New Classes/Modules**: Add descriptions to the Key Components section in AGENTS.md; update feature lists in README.md if user-facing - **Changed Responsibilities**: Modify class/module purpose descriptions in AGENTS.md; update feature descriptions in README.md - **New Tools**: Update tool categories and counts in **both** files; add tool descriptions to README.md features section - **Configuration Changes**: Update Operating Modes and Configuration Management sections in AGENTS.md; update configuration examples in README.md - **New Development Patterns**: Add to Common Development Tasks in AGENTS.md - **Architecture Changes**: Update Client Architecture and Key Components sections in AGENTS.md - **Installation/Setup Changes**: Update installation and configuration sections in README.md - **New Operating Modes**: Update both files with new mode descriptions and requirements - **Tool Count Changes**: Update the "Available Tools by Mode" table in README.md and tool category counts in copilot-instructions.md #### **Documentation Standards:** - **copilot-instructions.md**: Focus on technical architecture, development guidelines, and internal structure - **README.md**: Focus on user-facing features, installation, configuration, and usage examples - Use clear, descriptive language that helps developers understand the codebase - Include specific file paths and references where relevant - Maintain consistency with existing documentation style and structure - Provide context for why changes were made when updating architectural decisions - Keep tool counts and feature lists accurate and current in both files #### **When to Update:** - **Immediately after** making structural changes (file renames, moves, deletions) - **Before completing** feature development that adds new capabilities - **During refactoring** that changes class responsibilities or module purposes - **After adding** new tools, clients, or major functionality - **When modifying** configuration systems or authentication flows - **When changing** installation procedures or setup requirements - **After updating** tool categories or operating modes #### **Specific File Responsibilities:** **AGENTS.md Updates:** - Project structure diagram - Key Components descriptions - Tool Categories and counts - Operating Modes technical details - Development Guidelines - Common Development Tasks - Client Architecture descriptions **README.md Updates:** - Feature lists and descriptions - Available Tools by Mode table - Installation and setup instructions - Configuration examples and options - Usage examples and quick start guides - Tool descriptions for end users **Remember**: These documentation files serve as the primary source of truth for understanding the project. `AGENTS.md` guides development practices and architecture, while `README.md` serves users and contributors. Keeping both current ensures consistent understanding across all stakeholders and maintains professional project standards. ### 🔧 Common Development Tasks (Streamlined) - **Adding New Tools**: Define schema in `core/tool-definitions.ts`, implement handler in appropriate handler class in `core/handlers/`, or create new handler extending `BaseToolHandler` - **Creating New Handlers**: Extend `BaseToolHandler` class, implement `canHandle()` and `handle()` methods, register in `server.ts` - **Using ClientFactory**: Create clients using `ClientFactory` for centralized creation and dependency injection support - **Implementing Services**: Create service interfaces in `services/index.ts`, implement production versions, and provide mock implementations for testing - **Dependency Injection**: Use constructor injection for services, leverage `ClientFactory` for client creation with optional service injection - **Updating Documentation**: Modify files in `docs/` and run conversion scripts - **Enhancing Authentication**: Update `clients/base/oauth-token.ts` and client authentication logic - **Improving Caching**: Enhance `utils/cache.ts` for better performance and data freshness - **Adding Configuration Options**: Update `config/` modules for new configuration capabilities - **Adding Tests**: Create comprehensive test coverage in the `tests/` directory with proper service mocking - **MCP Test Execution**: Use `node --test` for individual MCP programmatic tests, NOT `npm test -- file.js` (which runs Jest) - **Test Types**: Jest for unit tests (`src/` directory), Node.js test runner for MCP programmatic tests (`tests/mcp/node/`), Aegis for YAML tests (`tests/mcp/yaml/`) - **Adding Utilities**: Extend `utils/` modules for shared functionality - **Handler Development**: Follow the modular handler pattern - each handler is responsible for a specific tool category with clear separation of concerns - **Cartridge Generation**: Use `generate_cartridge_structure` tool for automated cartridge creation with direct file generation - **Job Log Analysis**: Use job log tools for debugging custom job steps - `get_latest_job_log_files`, `get_job_log_entries`, `search_job_logs`, `search_job_logs_by_name`, `get_job_execution_summary` - **Modular Log Development**: Work with individual log modules in `clients/logs/` for specific functionality - modify `log-analyzer.ts` for analysis improvements, `log-formatter.ts` for output changes, or `log-file-reader.ts` for reading optimizations - **Modular Documentation Development**: Work with individual documentation modules in `clients/docs/` for specific functionality - modify `documentation-scanner.ts` for file discovery improvements, `class-content-parser.ts` for parsing enhancements, `class-name-resolver.ts` for name resolution logic, or `referenced-types-extractor.ts` for type extraction algorithms - **Documentation Verification**: Use verification commands (see Maintenance) before changing numeric counts or structure claims - **CI-Friendly Performance Testing**: When writing performance tests, use lenient timeouts (500ms+) and variation ratios (50x+) to account for GitHub Actions CI environment variability. Prioritize functional validation over strict timing requirements to prevent flaky failures due to infrastructure differences. ### 🔍 Testing & Validation (Consolidated Summary) Detailed testing guidance lives in: - `tests/mcp/AGENTS.md` (umbrella & decision matrix) - `tests/mcp/yaml/AGENTS.md` (YAML discovery-first workflow & pattern catalog) - `tests/mcp/node/AGENTS.md` (programmatic multi-step, stderr management, performance tolerances) Essentials: - Always discover success + empty/no-result + error responses with `npx aegis query` before writing tests. - Prefer YAML for broad coverage; use programmatic tests for stateful or multi-step logic. - Keep performance assertions lenient (<500ms typical; <50× variance) unless you have empirical baselines. Cheat Sheet: ```bash # List tools npx aegis query --config ./aegis.config.docs-only.json # Discovery examples npx aegis query search_sfcc_classes 'query:catalog' --config ./aegis.config.docs-only.json npx aegis query get_sfra_document 'documentName:server' --config ./aegis.config.docs-only.json npx aegis query get_system_object_definitions '' --config ./aegis.config.with-dw.json # Complex dotted parameters npx aegis query search_system_object_attribute_definitions 'objectType:Product|searchRequest.query.match_all_query:{}' --config ./aegis.config.with-dw.json # Test suites npm run test:mcp:yaml # YAML (docs-only) npm run test:mcp:yaml:full # YAML (full mode) npm run test:mcp:node # Programmatic jest # Unit tests npm test # Full suite # Single programmatic test node --test tests/mcp/node/get-latest-debug.full-mode.programmatic.test.js ``` Troubleshooting Quick Tips: - Mismatch schema: re-run discovery; update both test + docs. - Flaky stderr assertions: ensure `client.clearStderr()` in programmatic tests (see node guide). - Empty arrays vs objects: record actual shape before choosing regex pattern. #### **Debugging Tool Responses** When developing or debugging tools, use aegis to inspect actual response formats: ```bash # Capture full response structure for test validation (pipe format) npx aegis query search_sfcc_classes 'query:catalog' --config ./aegis.config.docs-only.json | head -50 # Traditional method format (still supported) npx aegis query --config ./aegis.config.docs-only.json --method "tools/call" --params '{"name": "[tool-name]", "arguments": [args]}' | head -50 # Test error handling (pipe format) npx aegis query search_sfcc_classes 'query:' --config ./aegis.config.docs-only.json # Verify JSON response structure (pipe format) npx aegis query get_sfcc_class_info 'className:dw.catalog.Product' --config ./aegis.config.docs-only.json | jq '.' ``` #### **Development Workflow Integration** 1. **Tool Development**: After implementing a new tool, immediately test with aegis before writing unit tests 2. **Response Validation**: Use aegis to capture actual response structures when writing test assertions 3. **Error Testing**: Verify error handling behavior with invalid parameters through aegis 4. **Configuration Testing**: Test both docs-only and full modes to ensure proper tool availability 5. **Integration Testing**: Validate tool interactions and data flow using aegis before automated tests #### **Critical: Response Format Discovery Before Writing Tests** **ALWAYS use aegis query to understand actual response formats before writing YAML tests.** This prevents test failures due to incorrect assumptions about response structure. ##### **Essential Pre-Test Discovery Process:** 1. **Query the tool with sample arguments** to see actual response format: ```bash npx aegis query search_sfcc_classes 'query:catalog' --config ./aegis.config.docs-only.json ``` 2. **Test edge cases** (empty results, errors) to understand all response variations: ```bash npx aegis query search_sfcc_classes 'query:zzznothingfound' --config ./aegis.config.docs-only.json npx aegis query search_sfcc_classes 'query:' --config ./aegis.config.docs-only.json ``` 3. **Document the actual response structure** before writing test expectations: - Is it a JSON object with metadata fields like `{classes: [], totalCount: 5, searchTerm: "query"}`? - Or a simple JSON array like `["dw.catalog.Product", "dw.catalog.Catalog"]`? - Does it return `[]` for no results or `{classes: [], totalCount: 0}`? 4. **Use the correct validation patterns** based on actual responses: ```yaml # For JSON array responses text: "match:regex:\\[[\\s\\S]*\\]" # For empty array responses text: "match:regex:^\\[\\s*\\]$" # For JSON object responses text: "match:regex:\\{[\\s\\S]*\\}" # For specific content validation text: "match:contains:dw.catalog.Product" ``` ##### **Common Testing Mistakes to Avoid:** - **Assuming JSON structure without verification**: Don't expect `{classes: [], totalCount: 5}` if tool returns `["class1", "class2"]` - **Wrong empty result validation**: Using `match:exact:[]` instead of `match:regex:^\\[\\s*\\]$` - **Missing edge case testing**: Not testing empty queries, invalid parameters, or no-result scenarios - **Incorrect pattern syntax**: Using `contains:classes` instead of `match:contains:classes` ##### **Response Format Discovery Examples:** ```bash # Discover structure for class search (pipe format) npx aegis query search_sfcc_classes 'query:catalog' --config ./aegis.config.docs-only.json # Result: ["dw.catalog.Catalog", "dw.catalog.Product", ...] (simple array) # Discover empty result format (pipe format) npx aegis query search_sfcc_classes 'query:zzznothingfound' --config ./aegis.config.docs-only.json # Result: [] (empty array) # Discover error response format (pipe format) npx aegis query search_sfcc_classes 'query:' --config ./aegis.config.docs-only.json # Result: {"content": [{"type": "text", "text": "Error: ..."}], "isError": true} ``` **Remember**: The time spent discovering actual response formats with aegis saves hours of debugging failed tests later. Always query first, then write tests based on reality, not assumptions. #### **Troubleshooting with Aegis** - **Tool Not Found**: Check configuration mode (docs-only vs full) and ensure tool is properly registered - **Invalid Arguments**: Use aegis to test parameter validation and see exact error messages - **Response Issues**: Compare aegis output with programmatic test expectations to identify format mismatches - **Performance Issues**: Use aegis timing information to identify slow tools - **Authentication Problems**: Test full-mode tools with aegis to validate OCAPI/WebDAV connections #### **Best Practices** - **CRITICAL: Always discover response formats first** - Use aegis query to understand actual response structure before writing any tests - **Always test new tools** with aegis before writing automated tests - **Use aegis output** to write accurate test assertions rather than guessing response formats - **Test both success and error cases** with aegis during development - **Verify tool availability** in different configuration modes using aegis - **Debug programmatic test failures** by comparing with aegis CLI results - **Test parameter validation** using aegis with various input combinations - **Document actual response formats** in test file comments for future reference - **Test edge cases comprehensively** - empty results, invalid inputs, missing parameters - **Use correct YAML pattern syntax** - always prefix with `match:` for validation patterns #### **CI-Friendly Performance Testing Guidelines** When writing performance-related tests, especially for GitHub Actions CI environments, follow these critical guidelines: - **Use Lenient Timeouts**: Set timeout thresholds of **500ms or higher** instead of strict values (50ms-250ms). CI environments are slower and less predictable than local development machines. - **Account for Environment Variability**: CI runners experience resource contention, cold starts, network latency, and I/O scheduling delays that can significantly impact timing. - **Performance Variation Ratios**: For tests comparing min/max performance, use ratios of **50x or higher** instead of strict ratios (15x). CI environments can have extreme variations due to: - Resource sharing with other processes - JIT compilation and garbage collection delays - Network and file system variability - Container initialization overhead - **Scaling Calculations**: When calculating expected performance based on result count, use generous base times (100ms+) and scaling factors (2ms+ per item) rather than tight calculations. - **Focus on Functional Validation**: Prioritize correctness over strict performance requirements. Performance tests should catch major regressions, not minor timing variations. - **Example CI-Friendly Assertions**: ```javascript // ❌ Too strict for CI assert.ok(duration < 50, `Response time should be under 50ms`); assert.ok(variationRatio < 15, `Performance variation should be under 15x`); // ✅ CI-friendly assert.ok(duration < 500, `Response time should be under 500ms`); assert.ok(variationRatio < 50, `Performance variation should be under 50x`); ``` **Remember**: The goal is reliable CI builds that catch real issues without flaky failures due to infrastructure timing differences. #### **Comprehensive Testing Documentation** For comprehensive MCP testing guidance, refer to the specialized AGENTS.md files in the testing directories: ##### **YAML-Based Declarative Testing** The primary testing approach using human-readable YAML files with advanced pattern matching: - **30+ Advanced Pattern Matching**: String patterns, numeric comparisons, date validation, array operations, field extraction, cross-field validation, and pattern negation - **Declarative YAML Testing**: Human-readable test files with sophisticated validation patterns - **Interactive Tool Testing**: Quick commands for testing tools interactively with the aegis CLI - **Debugging Workflows**: Step-by-step approaches for troubleshooting test failures and server issues - **Real-World Examples**: Complete test suites for filesystem servers, multi-tool servers, and API testing scenarios - **Performance Testing**: Patterns for validating response times and system performance - **Error Handling Validation**: Comprehensive approaches to testing error scenarios and edge cases ##### **Programmatic JavaScript/TypeScript Testing** For complex testing scenarios requiring programmatic logic and integration with existing test suites: - **JavaScript/TypeScript API**: Full programmatic access to MCP server testing capabilities - **Advanced Workflows**: Multi-step testing, state management, and dynamic validation logic - **Framework Integration**: Jest, Mocha, and Node.js test runner integration patterns - **Performance Monitoring**: Built-in metrics collection and performance analysis - **Buffer Management**: Critical guidance on preventing test interference with proper `clearStderr()` usage - **Error Recovery Testing**: Comprehensive error handling and resilience validation - **TypeScript Support**: Full type safety for enterprise testing environments **Quick Interactive Testing Commands:** ```bash # List all available tools aegis query --config ./aegis.config.docs-only.json # Test specific tool with arguments - Multiple formats supported: # Pipe format (recommended for CLI) aegis query read_file 'path:test.txt' --config ./aegis.config.docs-only.json aegis query calculator 'operation:add|a:5|b:3' --config ./aegis.config.docs-only.json # JSON format (complex structures) aegis query complex_tool '{"config": {"host": "localhost"}, "data": [1,2,3]}' --config ./aegis.config.docs-only.json # Method syntax with pipe format aegis query --method tools/call --params 'name:read_file|arguments.path:test.txt' --config ./aegis.config.docs-only.json # Debug with verbose output aegis query read_file 'path:test.txt' --config ./aegis.config.docs-only.json --verbose ``` **For AI Agents**: Both AGENTS.md files are specifically designed for AI assistants to understand how to create and execute comprehensive test suites for MCP servers. Choose YAML-based testing for declarative scenarios or programmatic testing for complex logic requirements. Both approaches can be directly applied to validate this SFCC Dev MCP server's functionality. ### 🧱 Architecture Advantages (Consolidated) Unified benefits of the directory structure, handler model, dependency injection, modular log system, and modular documentation system: | Concern | Key Advantages | |---------|----------------| | Directory Structure | Clear ownership, scalable growth, minimal cross-module coupling | | Handlers | Category isolation, standardized lifecycle (canHandle/handle), centralized error & timing, easy extension | | Dependency Injection | Swappable services, simplified testing (mock interfaces), boundary clarity, reduced coupling | | Log Modules | SRP per stage (discover→read→process→analyze→format), range-tail efficiency, extensible analysis & output, backward compatibility wrapper | | Documentation Modules | Streamlined pipeline (scan→parse→resolve→extract), focused optimizations, circular reference protection, type-safe expansion | Cross-cutting wins: - Strong typing across all layers - Deterministic testability in isolation - Backward compatibility through orchestrator wrappers (`log-client.ts`, `docs-client.ts`) - Predictable extension points (add handler, client, or module without ripple) - Low-risk refactoring zones due to SRP boundaries Result: Faster iteration, safer modifications, and clearer mental model for both humans and AI agents. ``` -------------------------------------------------------------------------------- /docs-site/postcss.config.js: -------------------------------------------------------------------------------- ```javascript export default { plugins: { tailwindcss: {}, autoprefixer: {}, }, }; ``` -------------------------------------------------------------------------------- /aegis.config.docs-only.json: -------------------------------------------------------------------------------- ```json { "name": "sfcc-dev-mcp", "command": "node", "args": [ "dist/index.js" ], "cwd": "./", "startupTimeout": 10000 } ``` -------------------------------------------------------------------------------- /aegis.config.json: -------------------------------------------------------------------------------- ```json { "name": "sfcc-dev-mcp-docs-only", "command": "node", "args": [ "dist/index.js" ], "cwd": "./", "startupTimeout": 10000, "env": { "NODE_ENV": "test" } } ``` -------------------------------------------------------------------------------- /tests/servers/sfcc-mock-server/mock-data/ocapi/system-object-attribute-groups-campaign.json: -------------------------------------------------------------------------------- ```json { "_v": "23.2", "_type": "object_attribute_group_search_result", "count": 0, "hits": [], "query": { "match_all_query": { "_type": "match_all_query" } }, "start": 0, "total": 0 } ``` -------------------------------------------------------------------------------- /docs-site/types.ts: -------------------------------------------------------------------------------- ```typescript export interface NavItem { label: string; path: string; } export interface NavGroup { title: string; items: NavItem[]; } export interface TocItem { id: string; label: string; level: number; } ``` -------------------------------------------------------------------------------- /docs/dw_util/Set.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.util # Class Set ## Inheritance Hierarchy - Object - dw.util.Collection - dw.util.Set ## Description Represents a set of objects. ## Properties ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /docs/dw_svc/SOAPServiceDefinition.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.svc # Class SOAPServiceDefinition ## Inheritance Hierarchy - Object - dw.svc.ServiceDefinition - dw.svc.SOAPServiceDefinition ## Description Represents a SOAP WebService definition. ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /aegis.config.with-dw.json: -------------------------------------------------------------------------------- ```json { "name": "sfcc-dev-mcp-with-credentials", "command": "node", "args": [ "dist/index.js", "--dw-json", "./tests/mcp/test-fixtures/dw.json", "--debug" ], "cwd": "./", "startupTimeout": 10000, "env": { "NODE_ENV": "test" } } ``` -------------------------------------------------------------------------------- /tests/mcp/test-fixtures/dw.json: -------------------------------------------------------------------------------- ```json { "version": "1.0.0", "hostname": "localhost:3000", "username": "[email protected]", "password": "test-password", "client-id": "test-client-id", "client-secret": "test-client-secret", "code-version": "test-version", "cartridgesPath": "./cartridges" } ``` -------------------------------------------------------------------------------- /tests/__mocks__/docs-client.ts: -------------------------------------------------------------------------------- ```typescript // Mock for SFCCDocumentationClient export const SFCCDocumentationClient = jest.fn().mockImplementation(() => ({ getClassDetailsExpanded: jest.fn(), getAvailableClasses: jest.fn(), searchClasses: jest.fn(), searchMethods: jest.fn(), getClassDocumentation: jest.fn(), })); ``` -------------------------------------------------------------------------------- /docs/dw_content/ContentSearchRefinementValue.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.content # Class ContentSearchRefinementValue ## Inheritance Hierarchy - Object - dw.catalog.SearchRefinementValue - dw.content.ContentSearchRefinementValue ## Description Represents the value of a content search refinement. ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /docs/TopLevel/StopIteration.md: -------------------------------------------------------------------------------- ```markdown ## Package: TopLevel # Class StopIteration ## Inheritance Hierarchy - Object - StopIteration ## Description A special type of exception that is thrown when an Iterator or Generator sequence is exhausted. ## Constructor Summary StopIteration() ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/dw_campaign/FreeDiscount.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.campaign # Class FreeDiscount ## Inheritance Hierarchy - Object - dw.campaign.Discount - dw.campaign.FreeDiscount ## Description Represents a free discount in the discount plan, for example "Free shipping on all orders $25 or more." ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /docs/dw_svc/HTTPFormServiceDefinition.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.svc # Class HTTPFormServiceDefinition ## Inheritance Hierarchy - Object - dw.svc.ServiceDefinition - dw.svc.HTTPServiceDefinition - dw.svc.HTTPFormServiceDefinition ## Description Represents an HTTP Form POST Service Definition. ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /src/services/index.ts: -------------------------------------------------------------------------------- ```typescript /** * Services Index * * Re-exports all service interfaces and implementations for easy importing */ export { IFileSystemService, FileSystemService, MockFileSystemService, } from './file-system-service.js'; export { IPathService, PathService, MockPathService, } from './path-service.js'; ``` -------------------------------------------------------------------------------- /docs/dw_campaign/FreeShippingDiscount.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.campaign # Class FreeShippingDiscount ## Inheritance Hierarchy - Object - dw.campaign.Discount - dw.campaign.FreeShippingDiscount ## Description Represents a free shipping discount in the discount plan, for example "Free shipping on all iPods." ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /tests/__mocks__/webdav.js: -------------------------------------------------------------------------------- ```javascript // Mock implementation of webdav module const mockWebdavClient = { getDirectoryContents: jest.fn(), getFileContents: jest.fn(), stat: jest.fn(), createReadStream: jest.fn(), }; const createClient = jest.fn(() => mockWebdavClient); module.exports = { createClient, __mockWebdavClient: mockWebdavClient, }; ``` -------------------------------------------------------------------------------- /docs/TopLevel/URIError.md: -------------------------------------------------------------------------------- ```markdown ## Package: TopLevel # Class URIError ## Inheritance Hierarchy - Object - TopLevel.Error - URIError ## Description Represents a URI error. ## Constructor Summary URIError() Constructs the error. URIError(msg : String) Constructs the error with the specified message. ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/TopLevel/TypeError.md: -------------------------------------------------------------------------------- ```markdown ## Package: TopLevel # Class TypeError ## Inheritance Hierarchy - Object - TopLevel.Error - TypeError ## Description Represents a type error. ## Constructor Summary TypeError() Constructs the error. TypeError(msg : String) Constructs the error with the specified message. ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/TopLevel/RangeError.md: -------------------------------------------------------------------------------- ```markdown ## Package: TopLevel # Class RangeError ## Inheritance Hierarchy - Object - TopLevel.Error - RangeError ## Description Represents a range error. ## Constructor Summary RangeError() Constructs the error. RangeError(msg : String) Constructs the error with the specified message. ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/TopLevel/EvalError.md: -------------------------------------------------------------------------------- ```markdown ## Package: TopLevel # Class EvalError ## Inheritance Hierarchy - Object - TopLevel.Error - EvalError ## Description Represents an evaluation error. ## Constructor Summary EvalError() Constructs the error. EvalError(msg : String) Constructs the error with the specified message. ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/TopLevel/SyntaxError.md: -------------------------------------------------------------------------------- ```markdown ## Package: TopLevel # Class SyntaxError ## Inheritance Hierarchy - Object - TopLevel.Error - SyntaxError ## Description Represents a syntax error. ## Constructor Summary SyntaxError() Constructs the error. SyntaxError(msg : String) Constructs the error with the specified message. ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs-site/public/.well-known/security.txt: -------------------------------------------------------------------------------- ``` Contact: https://github.com/taurgis/sfcc-dev-mcp/issues Expires: 2026-09-20T00:00:00.000Z Acknowledgments: https://github.com/taurgis/sfcc-dev-mcp/blob/main/CONTRIBUTING.md Preferred-Languages: en Canonical: https://sfcc-mcp-dev.rhino-inquisitor.com/.well-known/security.txt Policy: https://github.com/taurgis/sfcc-dev-mcp/blob/main/SECURITY.md ``` -------------------------------------------------------------------------------- /docs/TopLevel/InternalError.md: -------------------------------------------------------------------------------- ```markdown ## Package: TopLevel # Class InternalError ## Inheritance Hierarchy - Object - TopLevel.Error - InternalError ## Description Represents the an internal error. ## Constructor Summary InternalError() Constructs the error. InternalError(msg : String) Constructs the error with the specified message. ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/TopLevel/ReferenceError.md: -------------------------------------------------------------------------------- ```markdown ## Package: TopLevel # Class ReferenceError ## Inheritance Hierarchy - Object - TopLevel.Error - ReferenceError ## Description Represents a reference error. ## Constructor Summary ReferenceError() Constructs the error. ReferenceError(msg : String) Constructs the error with the specified message. ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- ```yaml blank_issues_enabled: false contact_links: - name: 📖 Documentation url: https://github.com/taurgis/sfcc-dev-mcp/blob/main/README.md about: Read the project documentation and setup guide - name: 🔒 Security Issues url: https://github.com/taurgis/sfcc-dev-mcp/security/advisories/new about: Report security vulnerabilities privately ``` -------------------------------------------------------------------------------- /docs/TopLevel/ConversionError.md: -------------------------------------------------------------------------------- ```markdown ## Package: TopLevel # Class ConversionError ## Inheritance Hierarchy - Object - TopLevel.Error - ConversionError ## Description Represents a conversion error. ## Constructor Summary ConversionError() Constructs the error. ConversionError(msg : String) Constructs the error with the specified message. ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/dw_order/CreateOrderException.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.order # Class CreateOrderException ## Inheritance Hierarchy - Object - TopLevel.Error - TopLevel.APIException - dw.order.CreateOrderException ## Description This APIException is thrown by method OrderMgr.createOrder(Basket, String) to indicate no Order could be created from the Basket. ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /docs-site/metadata.json: -------------------------------------------------------------------------------- ```json { "name": "SFCC Development MCP Server Docs", "description": "A documentation site for the SFCC Development MCP Server, a comprehensive Model Context Protocol server for Salesforce B2C Commerce Cloud development. The site provides guides for getting started, configuration, tools, and examples for AI-assisted SFCC development.", "requestFramePermissions": [] } ``` -------------------------------------------------------------------------------- /docs-site/public/404.html: -------------------------------------------------------------------------------- ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>SFCC Development MCP Server Docs</title> <script> // For hash routing, redirect 404s to the main page window.location.href = '/'; </script> </head> <body> <p>Redirecting...</p> </body> </html> ``` -------------------------------------------------------------------------------- /docs-site/public/robots.txt: -------------------------------------------------------------------------------- ``` User-agent: * Allow: / # Sitemap Sitemap: https://sfcc-mcp-dev.rhino-inquisitor.com/sitemap.xml # Crawl-delay for respectful crawling Crawl-delay: 1 # Allow all common search engines User-agent: Googlebot Allow: / User-agent: Bingbot Allow: / User-agent: Slurp Allow: / User-agent: DuckDuckBot Allow: / # Block certain paths if needed # Disallow: /temp/ # Disallow: /private/ ``` -------------------------------------------------------------------------------- /docs/TopLevel/arguments.md: -------------------------------------------------------------------------------- ```markdown ## Package: TopLevel # Class arguments ## Inheritance Hierarchy - Object - arguments ## Description The arguments of a function. ## Properties ### callee **Type:** Object A reference to the function that is currently executing. ### length **Type:** Number The number of arguments passed to the function. ## Constructor Summary arguments() ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/dw_system/AgentUserStatusCodes.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.system # Class AgentUserStatusCodes ## Inheritance Hierarchy - Object - dw.customer.AgentUserStatusCodes - dw.system.AgentUserStatusCodes ## Description AgentUserStatusCodes contains constants representing status codes that can be used with a Status object to indicate the success or failure of the agent user login process. ## Constructor Summary AgentUserStatusCodes() ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/dw_svc/HTTPFormService.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.svc # Class HTTPFormService ## Inheritance Hierarchy - Object - dw.svc.Service - dw.svc.HTTPService - dw.svc.HTTPFormService ## Description Represents an HTTP Form POST Service. All arguments passed to the call method will be URL-encoded and set as name/value pairs in the HTTP request body. The HTTP request will be a POST with a content-type of application/x-www-form-urlencoded. ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /src/clients/docs/index.ts: -------------------------------------------------------------------------------- ```typescript /** * Documentation Module Exports * * Exports for the refactored documentation client modules */ export { DocumentationScanner, SFCCClassInfo } from './documentation-scanner.js'; export { ClassContentParser, SFCCClassDetails, SFCCMethod, SFCCProperty, SFCCConstant, } from './class-content-parser.js'; export { ClassNameResolver } from './class-name-resolver.js'; export { ReferencedTypesExtractor } from './referenced-types-extractor.js'; ``` -------------------------------------------------------------------------------- /docs/dw_customer/EncryptedObject.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.customer # Class EncryptedObject ## Inheritance Hierarchy - Object - dw.object.PersistentObject - dw.object.ExtensibleObject - dw.customer.EncryptedObject ## Description Defines a API base class for classes containing encrypted attributes like credit cards. Note: this method handles sensitive financial and card holder data. Pay special attention to PCI DSS v3. requirements 1, 3, 7, and 9. ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /docs-site/main.tsx: -------------------------------------------------------------------------------- ```typescript import { ViteReactSSG } from 'vite-react-ssg'; import { routes } from './App'; import './src/styles/input.css'; export const createRoot = ViteReactSSG( // react-router-dom data routes { routes }, // function to have custom setups ({ router, routes, isClient, initialState }) => { // Custom setup if needed for client-side hydration if (isClient) { // Client-side only initialization console.log('Client-side initialization'); } }, ); ``` -------------------------------------------------------------------------------- /docs/dw_order/CreateAgentBasketLimitExceededException.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.order # Class CreateAgentBasketLimitExceededException ## Inheritance Hierarchy - Object - TopLevel.Error - TopLevel.APIException - dw.order.CreateAgentBasketLimitExceededException ## Description This exception is thrown by BasketMgr.createAgentBasket() to indicate that the open agent basket limit for the current session customer is already reached, and therefore no new agent basket could be created. ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /docs/dw_order/CreateTemporaryBasketLimitExceededException.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.order # Class CreateTemporaryBasketLimitExceededException ## Inheritance Hierarchy - Object - TopLevel.Error - TopLevel.APIException - dw.order.CreateTemporaryBasketLimitExceededException ## Description This exception is thrown by BasketMgr.createTemporaryBasket() to indicate that the open temporary basket limit for the current session customer is already reached, and therefore no new temporary basket could be created. ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- ```json { "compilerOptions": { "target": "ES2022", "module": "ESNext", "moduleResolution": "node", "outDir": "./dist", "rootDir": "./src", "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "allowSyntheticDefaultImports": true, "resolveJsonModule": true, "declaration": true, "declarationMap": true, "sourceMap": true }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"] } ``` -------------------------------------------------------------------------------- /docs/dw_util/UUIDUtils.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.util # Class UUIDUtils ## Inheritance Hierarchy - Object - dw.util.UUIDUtils ## Description Utility methods around generating unique IDs. ## Constructor Summary ## Method Summary ### createUUID **Signature:** `static createUUID() : String` The method generates a unique id. ## Method Detail ## Method Details ### createUUID **Signature:** `static createUUID() : String` **Description:** The method generates a unique id. **Returns:** the generated unique id --- ``` -------------------------------------------------------------------------------- /tsconfig.test.json: -------------------------------------------------------------------------------- ```json { "compilerOptions": { "target": "ES2022", "module": "ESNext", "moduleResolution": "node", "outDir": "./dist", "rootDir": "./src", "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "allowSyntheticDefaultImports": true, "resolveJsonModule": true, "declaration": true, "declarationMap": true, "sourceMap": true }, "include": ["tests/**/*"], "exclude": ["node_modules", "dist"] } ``` -------------------------------------------------------------------------------- /docs/dw_order/CreateBasketFromOrderException.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.order # Class CreateBasketFromOrderException ## Inheritance Hierarchy - Object - TopLevel.Error - TopLevel.APIException - dw.order.CreateBasketFromOrderException ## Description This APIException is thrown by method BasketMgr.createBasketFromOrder(Order) to indicate no Basket could be created from the Order. ## Properties ### errorCode **Type:** String (Read Only) Indicates reason why BasketMgr.createBasketFromOrder(Order) failed. ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /docs/dw_io/FileReader.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.io # Class FileReader ## Inheritance Hierarchy - Object - dw.io.Reader - dw.io.FileReader ## Description File reader class. ## Constructor Summary FileReader(file : File) Constructs the reader. FileReader(file : File, encoding : String) Constructs the reader. ## Method Summary ### close **Signature:** `close() : void` Closes the reader. ## Constructor Detail ## Method Detail ## Method Details ### close **Signature:** `close() : void` **Description:** Closes the reader. --- ``` -------------------------------------------------------------------------------- /docs/dw_web/URLParameter.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.web # Class URLParameter ## Inheritance Hierarchy - Object - dw.web.URLParameter ## Description This class represents a key-value-pair for URL parameters. ## Constructor Summary URLParameter(aName : String, aValue : String) Constructs the parameter using the specified name and value and endocded in the form "name=value". URLParameter(aName : String, aValue : String, encodeName : boolean) Constructs the parameter using the specified name and value. ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/dw_util/HashMap.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.util # Class HashMap ## Inheritance Hierarchy - Object - dw.util.Map - dw.util.HashMap ## Description Represents a hash map of objects. ## Constructor Summary HashMap() Constructs a new HashMap. ## Method Summary ### clone **Signature:** `clone() : HashMap` Returns a shallow copy of this map. ## Constructor Detail ## Method Detail ## Method Details ### clone **Signature:** `clone() : HashMap` **Description:** Returns a shallow copy of this map. **Returns:** a shallow copy of this map. --- ``` -------------------------------------------------------------------------------- /docs-site/tsconfig.json: -------------------------------------------------------------------------------- ```json { "compilerOptions": { "target": "ES2022", "experimentalDecorators": true, "useDefineForClassFields": false, "module": "ESNext", "lib": [ "ES2022", "DOM", "DOM.Iterable" ], "skipLibCheck": true, "types": [ "node" ], "moduleResolution": "bundler", "isolatedModules": true, "moduleDetection": "force", "allowJs": true, "jsx": "react-jsx", "paths": { "@/*": [ "./*" ] }, "allowImportingTsExtensions": true, "noEmit": true } } ``` -------------------------------------------------------------------------------- /src/clients/log-client.ts: -------------------------------------------------------------------------------- ```typescript /** * SFCC log client - now uses modular structure * * This file provides backward compatibility by re-exporting the main log client * from the new modular structure in the logs/ directory. */ export { SFCCLogClient } from './logs/index.js'; export type { LogLevel, LogFileInfo, LogSummary, WebDAVClientConfig } from './logs/index.js'; // Re-export SFCCConfig for backward compatibility export interface SFCCConfig { hostname?: string; username?: string; password?: string; clientId?: string; clientSecret?: string; siteId?: string; } ``` -------------------------------------------------------------------------------- /docs/dw_web/Forms.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.web # Class Forms ## Inheritance Hierarchy - Object - dw.web.Forms ## Description The Forms object provides access to all current forms in the session. The individual forms are retrieved as a dynamic property, for example 'forms.searchform'. It is typically retrieved from the session via Session.getForms(). But it is also available in the PipelineDictionary and can be accessed via 'pdict.CurrentForms'. Note that values stored with a form on the session are deleted if the request locale is changed during the session. ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /docs/dw_io/InputStream.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.io # Class InputStream ## Inheritance Hierarchy - Object - dw.io.InputStream ## Description The class represent a stream of bytes that can be read from the application. The InputStream itself doesn't provide any methods to read the data. Instead the InputStream can be chained with other classes like a XMLStreamReader to read data. ## Constructor Summary ## Method Summary ### close **Signature:** `close() : void` Closes the input stream. ## Method Detail ## Method Details ### close **Signature:** `close() : void` **Description:** Closes the input stream. --- ``` -------------------------------------------------------------------------------- /docs/dw_catalog/SortingRule.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.catalog # Class SortingRule ## Inheritance Hierarchy - Object - dw.object.PersistentObject - dw.catalog.SortingRule ## Description Represents a product sorting rule for use with the ProductSearchModel. ## Properties ### ID **Type:** String (Read Only) The ID of the sorting rule. ## Constructor Summary ## Method Summary ### getID **Signature:** `getID() : String` Returns the ID of the sorting rule. ## Method Detail ## Method Details ### getID **Signature:** `getID() : String` **Description:** Returns the ID of the sorting rule. **Returns:** sorting rule ID --- ``` -------------------------------------------------------------------------------- /server.json: -------------------------------------------------------------------------------- ```json { "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json", "name": "io.github.taurgis/sfcc-dev-mcp", "description": "MCP server for Salesforce B2C Commerce Cloud development assistance", "status": "active", "repository": { "url": "https://github.com/taurgis/sfcc-dev-mcp", "source": "github" }, "version": "1.0.14", "packages": [ { "registry_type": "npm", "registry_base_url": "https://registry.npmjs.org", "identifier": "sfcc-dev-mcp", "version": "1.0.14", "transport": { "type": "stdio" } } ] } ``` -------------------------------------------------------------------------------- /docs/dw_order/ShipmentShippingCost.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.order # Class ShipmentShippingCost ## Inheritance Hierarchy - Object - dw.order.ShipmentShippingCost ## Description Represents shipping cost applied to shipments. Returned by ShipmentShippingModel.getShippingCost(ShippingMethod). ## Properties ### amount **Type:** Money (Read Only) The shipping amount. ## Constructor Summary ## Method Summary ### getAmount **Signature:** `getAmount() : Money` Returns the shipping amount. ## Method Detail ## Method Details ### getAmount **Signature:** `getAmount() : Money` **Description:** Returns the shipping amount. **Returns:** Shipping amount --- ``` -------------------------------------------------------------------------------- /docs/dw_suggest/CustomSuggestions.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.suggest # Class CustomSuggestions ## Inheritance Hierarchy - Object - dw.suggest.Suggestions - dw.suggest.CustomSuggestions ## Description The custom suggestion container provides access to merchant provided search phrases found using the suggested terms as search criteria. The method SearchPhraseSuggestions.getSuggestedPhrases() can be used to get the list of found search phrases. The custom phrases lookup is being executed in the current site. Furthermore the list of suggested terms is accessible through SearchPhraseSuggestions.getSuggestedTerms() method. ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /tests/__mocks__/src/clients/base/http-client.js: -------------------------------------------------------------------------------- ```javascript /** * Mock for BaseHttpClient */ export class BaseHttpClient { constructor(baseUrl) { this.baseUrl = baseUrl; this.logger = { debug: jest.fn(), info: jest.fn(), warn: jest.fn(), error: jest.fn(), }; } async makeRequest() { return { data: 'mocked' }; } async get() { return { data: 'mocked' }; } async post() { return { data: 'mocked' }; } async put() { return { data: 'mocked' }; } async patch() { return { data: 'mocked' }; } async delete() { return { data: 'mocked' }; } async handleAuthError() { // Mock implementation } } ``` -------------------------------------------------------------------------------- /src/clients/logs/index.ts: -------------------------------------------------------------------------------- ```typescript /** * Exports for the modular log client system */ // Main client export { SFCCLogClient } from './log-client.js'; // Specialized modules export { WebDAVClientManager } from './webdav-client-manager.js'; export { LogFileReader } from './log-file-reader.js'; export { LogFileDiscovery } from './log-file-discovery.js'; export { LogProcessor } from './log-processor.js'; export { LogAnalyzer } from './log-analyzer.js'; export { LogFormatter } from './log-formatter.js'; // Constants and types export { LOG_CONSTANTS, LOG_FILE_PATTERNS, LOG_MESSAGES, JOB_LOG_CONSTANTS } from './log-constants.js'; export type * from './log-types.js'; ``` -------------------------------------------------------------------------------- /docs/dw_suggest/BrandSuggestions.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.suggest # Class BrandSuggestions ## Inheritance Hierarchy - Object - dw.suggest.Suggestions - dw.suggest.BrandSuggestions ## Description The brands suggestion container provides access to brands found using the suggested terms. The method SearchPhraseSuggestions.getSuggestedPhrases() can be used to get the list of found brand names. The brand lookup is being executed in the current catalog and locale. Furthermore the list of suggested terms, after processing the original user input search query, is accessible through SearchPhraseSuggestions.getSuggestedTerms() method. ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /docs/dw_util/LinkedHashMap.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.util # Class LinkedHashMap ## Inheritance Hierarchy - Object - dw.util.Map - dw.util.LinkedHashMap ## Description This class implements a HashMap, which guarantees a iteration order according the put-order of the elements in the map. ## Constructor Summary LinkedHashMap() Constructs a new LinkedHashMap. ## Method Summary ### clone **Signature:** `clone() : LinkedHashMap` Returns a shallow copy of this map. ## Constructor Detail ## Method Detail ## Method Details ### clone **Signature:** `clone() : LinkedHashMap` **Description:** Returns a shallow copy of this map. **Returns:** a shallow copy of this map. --- ``` -------------------------------------------------------------------------------- /docs/dw_campaign/SourceCodeStatusCodes.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.campaign # Class SourceCodeStatusCodes ## Inheritance Hierarchy - Object - dw.campaign.SourceCodeStatusCodes ## Description Helper class which contains error result codes returned by the SetSourceCode pipelet. ## Constants ### CODE_INACTIVE **Type:** String = "CODE_INACTIVE" Indicates that the specified source code was found in one or more source-code groups, none of which are active. ### CODE_INVALID **Type:** String = "CODE_INVALID" Indicates that the specified source code is not contained in any source-code group. ## Properties ## Constructor Summary SourceCodeStatusCodes() ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/dw_customer/CustomerStatusCodes.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.customer # Class CustomerStatusCodes ## Inheritance Hierarchy - Object - dw.customer.CustomerStatusCodes ## Description CustomerStatusCodes contains constants representing status codes that can be used with a Status object to indicate the success or failure of an operation. ## Constants ### CUSTOMER_ADDRESS_REFERENCED_BY_PRODUCT_LIST **Type:** String = "CUSTOMER_ADDRESS_REFERENCED_BY_PRODUCT_LIST" Indicates that an error occurred when trying to perform an operation on an address that is currently associated with a product list. ## Properties ## Constructor Summary CustomerStatusCodes() ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /tests/servers/sfcc-mock-server/mock-data/ocapi/system-object-definition-order.json: -------------------------------------------------------------------------------- ```json { "_v": "23.2", "_type": "object_type_definition", "attribute_definition_count": 67, "attribute_group_count": 12, "content_object": false, "creation_date": "2024-02-19T10:18:31.000Z", "description": { "default": "Object type representing orders." }, "display_name": { "de": "Bestellung", "default": "Order", "ja": "注文", "it": "Ordine", "fr": "Commande", "zh-CN": "订单", "es": "Pedido", "nl": "Bestelling" }, "last_modified": "2024-02-19T10:18:31.000Z", "link": "https://localhost:3000/s/-/dw/data/v23_2/system_object_definitions/Order", "object_type": "Order", "queryable": true, "read_only": true } ``` -------------------------------------------------------------------------------- /docs/dw_web/FormListItem.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.web # Class FormListItem ## Inheritance Hierarchy - Object - dw.web.FormElement - dw.web.FormGroup - dw.web.FormListItem ## Description Represents an item in a form list. ## Properties ### itemIndex **Type:** Number (Read Only) The index of this item with the list. ## Constructor Summary ## Method Summary ### getItemIndex **Signature:** `getItemIndex() : Number` Returns the index of this item with the list. ## Method Detail ## Method Details ### getItemIndex **Signature:** `getItemIndex() : Number` **Description:** Returns the index of this item with the list. **Returns:** the index of this item with the list. --- ``` -------------------------------------------------------------------------------- /tests/servers/sfcc-mock-server/mock-data/ocapi/system-object-definition-customer.json: -------------------------------------------------------------------------------- ```json { "_v": "23.2", "_type": "object_type_definition", "attribute_definition_count": 45, "attribute_group_count": 8, "content_object": false, "creation_date": "2024-02-19T10:18:31.000Z", "description": { "default": "Object type representing customers." }, "display_name": { "de": "Kunde", "default": "Customer", "ja": "顧客", "it": "Cliente", "fr": "Client", "zh-CN": "客户", "es": "Cliente", "nl": "Klant" }, "last_modified": "2024-02-19T10:18:31.000Z", "link": "https://localhost:3000/s/-/dw/data/v23_2/system_object_definitions/Customer", "object_type": "Customer", "queryable": true, "read_only": false } ``` -------------------------------------------------------------------------------- /tests/servers/sfcc-mock-server/mock-data/ocapi/system-object-definition-product.json: -------------------------------------------------------------------------------- ```json { "_v": "23.2", "_type": "object_type_definition", "attribute_definition_count": 113, "attribute_group_count": 35, "content_object": true, "creation_date": "2024-02-19T10:18:31.000Z", "description": { "default": "Object type representing products." }, "display_name": { "de": "Produkt", "default": "Product", "ja": "商品", "it": "Prodotto", "fr": "Produit", "zh-CN": "产品", "es": "Producto", "nl": "Product" }, "last_modified": "2024-02-19T10:18:31.000Z", "link": "https://localhost:3000/s/-/dw/data/v23_2/system_object_definitions/Product", "object_type": "Product", "queryable": false, "read_only": false } ``` -------------------------------------------------------------------------------- /docs/dw_util/HashSet.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.util # Class HashSet ## Inheritance Hierarchy - Object - dw.util.Collection - dw.util.Set - dw.util.HashSet ## Description Represents a HashSet ## Constructor Summary HashSet() Constructs a new HashMap. HashSet(collection : Collection) Construct a new HashSet by initializing the HashSet with the elements of the given collection. ## Method Summary ### clone **Signature:** `clone() : HashSet` Returns a shallow copy of this set. ## Constructor Detail ## Method Detail ## Method Details ### clone **Signature:** `clone() : HashSet` **Description:** Returns a shallow copy of this set. **Returns:** a shallow copy of this set. --- ``` -------------------------------------------------------------------------------- /docs/dw_web/FormFieldOptions.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.web # Class FormFieldOptions ## Inheritance Hierarchy - Object - dw.web.FormFieldOptions ## Description The class represents the list of options for a field. The class supports an index style access to the options, e.g. myfield.options[2] or myfield.options.red. ## Properties ### optionsCount **Type:** Number (Read Only) The number of option values. ## Constructor Summary ## Method Summary ### getOptionsCount **Signature:** `getOptionsCount() : Number` Returns the number of option values. ## Method Detail ## Method Details ### getOptionsCount **Signature:** `getOptionsCount() : Number` **Description:** Returns the number of option values. --- ``` -------------------------------------------------------------------------------- /tests/servers/sfcc-mock-server/mock-data/ocapi/system-object-definition-category.json: -------------------------------------------------------------------------------- ```json { "_v": "23.2", "_type": "object_type_definition", "attribute_definition_count": 29, "attribute_group_count": 5, "content_object": true, "creation_date": "2024-02-19T10:18:31.000Z", "description": { "default": "Object type representing product categories." }, "display_name": { "de": "Kategorie", "default": "Category", "ja": "カテゴリ", "it": "Categoria", "fr": "Catégorie", "zh-CN": "类别", "es": "Categoría", "nl": "Categorie" }, "last_modified": "2024-02-19T10:18:31.000Z", "link": "https://localhost:3000/s/-/dw/data/v23_2/system_object_definitions/Category", "object_type": "Category", "queryable": false, "read_only": false } ``` -------------------------------------------------------------------------------- /docs/dw_io/OutputStream.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.io # Class OutputStream ## Inheritance Hierarchy - Object - dw.io.OutputStream ## Description The class represent a stream of bytes that can be written from the application. The OutputStream itself doesn't provide any methods to write the data. Instead the OutputStream can be chained with other classes like a XMLStreamWriter to write data. Note: when this class is used with sensitive data, be careful in persisting sensitive information to disk. ## Constructor Summary ## Method Summary ### close **Signature:** `close() : void` Closes the output stream. ## Method Detail ## Method Details ### close **Signature:** `close() : void` **Description:** Closes the output stream. --- ``` -------------------------------------------------------------------------------- /docs-site/components/VersionBadge.tsx: -------------------------------------------------------------------------------- ```typescript import React from 'react'; // Dynamically require root package.json (relative two levels up from docs-site-v2 when built inside project root) // During build (Vite), this will be statically analyzed; if path changes, adjust. // Using assert { type: 'json' } not needed with Vite's JSON import capability. // We keep it isolated so only Sidebar re-renders on version change. // eslint-disable-next-line @typescript-eslint/no-var-requires import pkg from '../../package.json'; const VersionBadge: React.FC = () => { const version = (pkg as any)?.version || 'v1'; return ( <span className="text-sm text-slate-500 self-start mt-1" title="Library Version"> v{version} </span> ); }; export default VersionBadge; ``` -------------------------------------------------------------------------------- /docs/dw_order/PriceAdjustmentLimitTypes.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.order # Class PriceAdjustmentLimitTypes ## Inheritance Hierarchy - Object - dw.order.PriceAdjustmentLimitTypes ## Description Helper class containing price adjustment limit types. ## Constants ### TYPE_ITEM **Type:** String = "ITEM" Constant for Price Adjustment Limit Type Item. The price adjustment limit was created at the item level. ### TYPE_ORDER **Type:** String = "ORDER" Constant for Price Adjustment Limit Type Order. The price adjustment limit was created at the order level. ### TYPE_SHIPPING **Type:** String = "SHIPPING" Constant for Price Adjustment Limit Type Shipping. The price adjustment limit was created at the shipping item level. ## Properties ## Constructor Summary ## Method Summary ``` -------------------------------------------------------------------------------- /docs/TopLevel/Iterable.md: -------------------------------------------------------------------------------- ```markdown ## Package: TopLevel # Class Iterable ## Inheritance Hierarchy - Iterable ## Description All objects containing the property @@iterator with a function returning an ES6Iterator are said to be an Iterable. ## Constructor Summary ## Method Summary ### @@iterator **Signature:** `@@iterator() : ES6Iterator` Returns an iterator to be used for iterating this object. ## Method Detail ## Method Details ### @@iterator **Signature:** `@@iterator() : ES6Iterator` **Description:** Returns an iterator to be used for iterating this object. Typically returns a new iterator instance. For iterators returns typically the iterator itself. **API Versioned:** From version 21.2. **Returns:** The iterator to be used for iterating this object. --- ``` -------------------------------------------------------------------------------- /tests/servers/sfcc-mock-server/mock-data/ocapi/system-object-definition-customeraddress.json: -------------------------------------------------------------------------------- ```json { "_v": "23.2", "_type": "object_type_definition", "attribute_definition_count": 23, "attribute_group_count": 2, "content_object": false, "creation_date": "2024-02-19T10:18:31.000Z", "description": { "default": "Object type representing customer addresses." }, "display_name": { "de": "Kundenadresse", "default": "Customer Address", "ja": "顧客の住所", "it": "Indirizzo del cliente", "fr": "Adresse du client", "zh-CN": "客户地址", "es": "Dirección de cliente", "nl": "Adres van klant" }, "last_modified": "2024-02-19T10:18:31.000Z", "link": "https://localhost:3000/s/-/dw/data/v23_2/system_object_definitions/CustomerAddress", "object_type": "CustomerAddress", "queryable": false, "read_only": false } ``` -------------------------------------------------------------------------------- /docs/dw_campaign/PriceBookPriceDiscount.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.campaign # Class PriceBookPriceDiscount ## Inheritance Hierarchy - Object - dw.campaign.Discount - dw.campaign.PriceBookPriceDiscount ## Description Discount representing that a product's price has been calculated from a separate sales price book other than the standard price book assigned to the site. ## Properties ### priceBookID **Type:** String (Read Only) The price book identifier. ## Constructor Summary ## Method Summary ### getPriceBookID **Signature:** `getPriceBookID() : String` Returns the price book identifier. ## Method Detail ## Method Details ### getPriceBookID **Signature:** `getPriceBookID() : String` **Description:** Returns the price book identifier. **Returns:** the price book identifier. --- ``` -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- ```javascript export default { preset: 'ts-jest/presets/default-esm', extensionsToTreatAsEsm: ['.ts'], testEnvironment: 'node', testTimeout: process.env.CI ? 30000 : 10000, // 30s for CI, 10s for local roots: ['<rootDir>/src', '<rootDir>/tests'], testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'], transform: { '^.+\\.ts$': ['ts-jest', { useESM: true }], }, transformIgnorePatterns: [ 'node_modules/(?!(webdav|@modelcontextprotocol)/)' ], moduleNameMapper: { '^(\\.{1,2}/.*)\\.js$': '$1', '^webdav$': '<rootDir>/tests/__mocks__/webdav.js' }, collectCoverageFrom: [ 'src/**/*.ts', '!src/main.ts', '!src/index.ts', ], coverageDirectory: 'coverage', coverageReporters: ['text', 'lcov', 'html'], }; ``` -------------------------------------------------------------------------------- /docs/dw_util/MapEntry.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.util # Class MapEntry ## Inheritance Hierarchy - Object - dw.util.MapEntry ## Description The class represent an entry within a Map. ## Properties ### key **Type:** Object (Read Only) The entry's key. ### value **Type:** Object (Read Only) The entry's value. ## Constructor Summary ## Method Summary ### getKey **Signature:** `getKey() : Object` Returns the entry's key. ### getValue **Signature:** `getValue() : Object` Returns the entry's value. ## Method Detail ## Method Details ### getKey **Signature:** `getKey() : Object` **Description:** Returns the entry's key. **Returns:** the entry's key. --- ### getValue **Signature:** `getValue() : Object` **Description:** Returns the entry's value. **Returns:** the entry's value. --- ``` -------------------------------------------------------------------------------- /docs/dw_campaign/TotalFixedPriceDiscount.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.campaign # Class TotalFixedPriceDiscount ## Inheritance Hierarchy - Object - dw.campaign.Discount - dw.campaign.TotalFixedPriceDiscount ## Description Represents a total fix price discount on a group of products in the discount plan. For example: "buy 3 products of type X for a total price of $29.99". ## Properties ### totalFixedPrice **Type:** Number (Read Only) The total fixed price amount. ## Constructor Summary ## Method Summary ### getTotalFixedPrice **Signature:** `getTotalFixedPrice() : Number` Returns the total fixed price amount. ## Method Detail ## Method Details ### getTotalFixedPrice **Signature:** `getTotalFixedPrice() : Number` **Description:** Returns the total fixed price amount. **Returns:** Total fixed price amount --- ``` -------------------------------------------------------------------------------- /docs/dw_util/LinkedHashSet.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.util # Class LinkedHashSet ## Inheritance Hierarchy - Object - dw.util.Collection - dw.util.Set - dw.util.LinkedHashSet ## Description The class LinkedHashSet implements a hash set with a guaranteed iteration order. The elements are iterated in the order they have been added to the HashSet. ## Constructor Summary LinkedHashSet() Constructs a new LinkHashSet. LinkedHashSet(collection : Collection) Constructor for a new LinkedHashSet. ## Method Summary ### clone **Signature:** `clone() : LinkedHashSet` Returns a shallow copy of this set. ## Constructor Detail ## Method Detail ## Method Details ### clone **Signature:** `clone() : LinkedHashSet` **Description:** Returns a shallow copy of this set. **Returns:** a shallow copy of this set. --- ``` -------------------------------------------------------------------------------- /docs-site/components/Typography.tsx: -------------------------------------------------------------------------------- ```typescript import React from 'react'; interface HeadingProps { id: string; children: React.ReactNode; } export const H1: React.FC<HeadingProps> = ({ id, children }) => ( <h1 id={id} className="text-4xl font-extrabold tracking-tight text-slate-900"> {children} </h1> ); export const PageSubtitle: React.FC<{ children: React.ReactNode }> = ({ children }) => ( <p className="mt-4 text-xl text-slate-600 !mb-10"> {children} </p> ); export const H2: React.FC<HeadingProps> = ({ id, children }) => ( <h2 id={id} className="mt-12 mb-4 text-3xl font-bold tracking-tight text-slate-900"> {children} </h2> ); export const H3: React.FC<HeadingProps> = ({ id, children }) => ( <h3 id={id} className="mt-8 mb-3 text-xl font-bold tracking-tight text-slate-900"> {children} </h3> ); ``` -------------------------------------------------------------------------------- /docs-site/components/BreadcrumbSchema.tsx: -------------------------------------------------------------------------------- ```typescript import React from 'react'; interface BreadcrumbItem { name: string; url: string; } interface BreadcrumbSchemaProps { items: BreadcrumbItem[]; } const BreadcrumbSchema: React.FC<BreadcrumbSchemaProps> = ({ items }) => { const baseUrl = 'https://sfcc-mcp-dev.rhino-inquisitor.com'; const breadcrumbList = { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": items.map((item, index) => ({ "@type": "ListItem", "position": index + 1, "name": item.name, "item": item.url.startsWith('http') ? item.url : `${baseUrl}${item.url}` })) }; return ( <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumbList) }} /> ); }; export default BreadcrumbSchema; ``` -------------------------------------------------------------------------------- /docs/dw_util/ArrayList.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.util # Class ArrayList ## Inheritance Hierarchy - Object - dw.util.Collection - dw.util.List - dw.util.ArrayList ## Description The ArrayList class is a container for a list of objects. ## Constructor Summary ArrayList() Constructor for a new ArrayList. ArrayList(collection : Collection) Constructor for a new ArrayList. ArrayList(iterator : Iterator) Constructor for a new ArrayList. ArrayList(values : Object...) Constructor for a new ArrayList. ## Method Summary ### clone **Signature:** `clone() : ArrayList` Returns a shallow copy of this array list. ## Constructor Detail ## Method Detail ## Method Details ### clone **Signature:** `clone() : ArrayList` **Description:** Returns a shallow copy of this array list. **Returns:** a shallow copy of this array list. --- ``` -------------------------------------------------------------------------------- /docs/TopLevel/ES6Iterator.md: -------------------------------------------------------------------------------- ```markdown ## Package: TopLevel # Class ES6Iterator ## Inheritance Hierarchy - ES6Iterator ## Description This isn't a built-in type. It describes the properties an object must have in order to work as an iterator since ECMAScript 2015. ## Constructor Summary ## Method Summary ### next **Signature:** `next() : Object` Returns an iterator result object. ## Method Detail ## Method Details ### next **Signature:** `next() : Object` **Description:** Returns an iterator result object. An iterator result object can have two properties: done and value. If done is false or undefined, then the value property contains an iterator value. The value property may not be present if the value would be undefined. After a call that returns a result where done equals true, all subsequent calls must also return done as true. --- ``` -------------------------------------------------------------------------------- /tests/servers/sfcc-mock-server/src/routes/ocapi/oauth-handler.js: -------------------------------------------------------------------------------- ```javascript /** * OAuth Handler * * Handles OAuth2 token endpoints for OCAPI authentication. * Provides a clean interface for token-related operations. */ const express = require('express'); class OAuthHandler { constructor(authManager) { this.authManager = authManager; this.router = express.Router(); this.setupRoutes(); } setupRoutes() { // OAuth2 token endpoints this.router.post('/dw/oauth2/access_token', (req, res) => { this.authManager.handleOAuthToken(req, res); }); this.router.post('/dwsso/oauth2/access_token', (req, res) => { this.authManager.handleOAuthToken(req, res); }); } /** * Get the configured router */ getRouter() { return this.router; } } module.exports = OAuthHandler; ``` -------------------------------------------------------------------------------- /docs/dw_campaign/CampaignStatusCodes.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.campaign # Class CampaignStatusCodes ## Inheritance Hierarchy - Object - dw.campaign.CampaignStatusCodes ## Description Deprecated. Formerly used to contain the various statuses that a coupon may be in. ## Constants ### COUPON_ALREADY_APPLIED **Type:** String = "COUPON_ALREADY_APPLIED" Indicates that the coupon has already been applied to the basket. ### COUPON_ALREADY_REDEEMED **Type:** String = "COUPON_ALREADY_REDEEMED" Indicates that the coupon has already been redeemed. ### COUPON_NOT_REDEEMABLE **Type:** String = "COUPON_NOT_REDEEMABLE" Indicates that the coupon is not currently redeemable. ### COUPON_UNKNOWN **Type:** String = "COUPON_UNKNOWN" Indicates that the coupon code is not valid. ## Properties ## Constructor Summary CampaignStatusCodes() ## Method Summary ## Constructor Detail ``` -------------------------------------------------------------------------------- /docs/dw_system/InternalObject.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.system # Class InternalObject ## Inheritance Hierarchy - Object - dw.system.InternalObject ## Description Class used to wrap internal objects to hide them from B2C Commerce Script code. ## Constructor Summary ## Method Summary ### toString **Signature:** `toString() : String` Returns a string representation of this object. ### valueOf **Signature:** `valueOf() : String` Returns a string representation of this object. ## Method Detail ## Method Details ### toString **Signature:** `toString() : String` **Description:** Returns a string representation of this object. **Returns:** a string representation of this object. --- ### valueOf **Signature:** `valueOf() : String` **Description:** Returns a string representation of this object. **Returns:** a string representation of this object. --- ``` -------------------------------------------------------------------------------- /docs/dw_order/TaxItem.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.order # Class TaxItem ## Inheritance Hierarchy - Object - dw.order.TaxItem ## Description An item containing tax information allowing a tax breakdown between a number of TaxGroups. ## Properties ### amount **Type:** Money (Read Only) Gets the amount. ### taxGroup **Type:** TaxGroup (Read Only) The tax group. ## Constructor Summary ## Method Summary ### getAmount **Signature:** `getAmount() : Money` Gets the amount. ### getTaxGroup **Signature:** `getTaxGroup() : TaxGroup` Returns the tax group. ## Method Detail ## Method Details ### getAmount **Signature:** `getAmount() : Money` **Description:** Gets the amount. **Returns:** the amount --- ### getTaxGroup **Signature:** `getTaxGroup() : TaxGroup` **Description:** Returns the tax group. **Returns:** the tax rate **See Also:** TaxGroup --- ``` -------------------------------------------------------------------------------- /docs/dw_crypto/CertificateRef.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.crypto # Class CertificateRef ## Inheritance Hierarchy - Object - dw.crypto.CertificateRef ## Description This class is used as a reference to a certificate or public key. Note: this class handles sensitive security-related data. Pay special attention to PCI DSS v3. requirements 2, 4, and 12. ## Constructor Summary CertificateRef(alias : String) Creates a CertificateRef from the passed alias as a reference to a certificate in Business Manager. ## Method Summary ### toString **Signature:** `toString() : String` Returns the string representation of this CertificateRef. ## Constructor Detail ## Method Detail ## Method Details ### toString **Signature:** `toString() : String` **Description:** Returns the string representation of this CertificateRef. **Returns:** The string representation of this CertificateRef. --- ``` -------------------------------------------------------------------------------- /docs/dw_campaign/PercentageOptionDiscount.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.campaign # Class PercentageOptionDiscount ## Inheritance Hierarchy - Object - dw.campaign.Discount - dw.campaign.PercentageOptionDiscount ## Description Represents a percentage-off options discount in the discount plan, for example "50% off monogramming on shirts". ## Properties ### percentage **Type:** Number (Read Only) The percentage discount value, for example 10.00 for a "10% off" discount. ## Constructor Summary ## Method Summary ### getPercentage **Signature:** `getPercentage() : Number` Returns the percentage discount value, for example 10.00 for a "10% off" discount. ## Method Detail ## Method Details ### getPercentage **Signature:** `getPercentage() : Number` **Description:** Returns the percentage discount value, for example 10.00 for a "10% off" discount. **Returns:** Discount percentage value --- ``` -------------------------------------------------------------------------------- /docs/dw_suggest/SuggestedContent.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.suggest # Class SuggestedContent ## Inheritance Hierarchy - Object - dw.suggest.SuggestedContent ## Description This class represents a suggested content page. Use getContent() method to get access to the actual Content object. ## Properties ### content **Type:** Content (Read Only) This method returns the actual Content object corresponding to this suggested content. ## Constructor Summary ## Method Summary ### getContent **Signature:** `getContent() : Content` This method returns the actual Content object corresponding to this suggested content. ## Method Detail ## Method Details ### getContent **Signature:** `getContent() : Content` **Description:** This method returns the actual Content object corresponding to this suggested content. **Returns:** the content object corresponding to this suggested content --- ``` -------------------------------------------------------------------------------- /docs/dw_campaign/AmountDiscount.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.campaign # Class AmountDiscount ## Inheritance Hierarchy - Object - dw.campaign.Discount - dw.campaign.AmountDiscount ## Description Represents an amount-off discount in the discount plan, for example "$10 off all orders $100 or more". ## Properties ### amount **Type:** Number (Read Only) The discount amount, for example 10.00 for a "$10 off" discount. ## Constructor Summary AmountDiscount(amount : Number) Create an amount-discount on the fly. ## Method Summary ### getAmount **Signature:** `getAmount() : Number` Returns the discount amount, for example 10.00 for a "$10 off" discount. ## Constructor Detail ## Method Detail ## Method Details ### getAmount **Signature:** `getAmount() : Number` **Description:** Returns the discount amount, for example 10.00 for a "$10 off" discount. **Returns:** Discount amount --- ``` -------------------------------------------------------------------------------- /docs/dw_content/ContentSearchRefinementDefinition.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.content # Class ContentSearchRefinementDefinition ## Inheritance Hierarchy - Object - dw.object.PersistentObject - dw.object.ExtensibleObject - dw.catalog.SearchRefinementDefinition - dw.content.ContentSearchRefinementDefinition ## Description This class provides an interface to refinement options for content search. ## Properties ### folderRefinement **Type:** boolean (Read Only) Identifies if this is a folder refinement. ## Constructor Summary ## Method Summary ### isFolderRefinement **Signature:** `isFolderRefinement() : boolean` Identifies if this is a folder refinement. ## Method Detail ## Method Details ### isFolderRefinement **Signature:** `isFolderRefinement() : boolean` **Description:** Identifies if this is a folder refinement. **Returns:** true if this is a category refinement, false otherwise. --- ``` -------------------------------------------------------------------------------- /docs/dw_web/Cookies.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.web # Class Cookies ## Inheritance Hierarchy - Object - dw.web.Cookies ## Description The class provides an index and associative array like access to the Cookies of the current request. Cookies can be retrieved by calling dw.system.Request.getHttpCookies(). Note: this class allows access to sensitive security-related data. Pay special attention to PCI DSS v3. requirements 2, 4, and 12. See Request.getHttpCookies(). ## Properties ### cookieCount **Type:** Number (Read Only) The number of known cookies. ## Constructor Summary ## Method Summary ### getCookieCount **Signature:** `getCookieCount() : Number` Returns the number of known cookies. ## Method Detail ## Method Details ### getCookieCount **Signature:** `getCookieCount() : Number` **Description:** Returns the number of known cookies. **Returns:** the number of cookies --- ``` -------------------------------------------------------------------------------- /docs/dw_crypto/KeyRef.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.crypto # Class KeyRef ## Inheritance Hierarchy - Object - dw.crypto.KeyRef ## Description This class is used as a reference to a private key in the keystore which can be managed in the Business Manager. Note: this class handles sensitive security-related data. Pay special attention to PCI DSS v3. requirements 2, 4, and 12. ## Constructor Summary KeyRef(alias : String) Creates a KeyRef from the passed alias. KeyRef(alias : String, password : String) Creates a KeyRef from the passed alias. ## Method Summary ### toString **Signature:** `toString() : String` Returns the string representation of this KeyRef. ## Constructor Detail ## Method Detail ## Method Details ### toString **Signature:** `toString() : String` **Description:** Returns the string representation of this KeyRef. **Returns:** The string representation of this KeyRef. --- ``` -------------------------------------------------------------------------------- /docs/dw_suggest/SuggestedCategory.md: -------------------------------------------------------------------------------- ```markdown ## Package: dw.suggest # Class SuggestedCategory ## Inheritance Hierarchy - Object - dw.suggest.SuggestedCategory ## Description This class represents a suggested catalog category. Use getCategory() method to get access to the actual Category object. ## Properties ### category **Type:** Category (Read Only) This method returns the actual Category object corresponding to this suggested category. ## Constructor Summary ## Method Summary ### getCategory **Signature:** `getCategory() : Category` This method returns the actual Category object corresponding to this suggested category. ## Method Detail ## Method Details ### getCategory **Signature:** `getCategory() : Category` **Description:** This method returns the actual Category object corresponding to this suggested category. **Returns:** the category object corresponding to this suggested category --- ``` -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- ```typescript #!/usr/bin/env node /** * SFCC MCP Server - Entry Point * * This module serves as the main entry point for the SFCC (Salesforce B2C Commerce Cloud) * MCP server. It provides comprehensive development assistance features including log analysis, * debugging tools, and more. This file re-exports the main application entry point for * backwards compatibility and provides a clean interface for the package. */ export { SFCCDevServer } from './core/server.js'; export { SFCCLogClient } from './clients/log-client.js'; export { SFCCDocumentationClient } from './clients/docs-client.js'; export { OCAPIClient } from './clients/ocapi-client.js'; export { TokenManager } from './clients/base/oauth-token.js'; export type { SFCCConfig, LogLevel, LogFileInfo, LogSummary, OCAPIConfig, OAuthToken, OAuthTokenResponse } from './types/types.js'; // For direct execution, delegate to main.ts import './main.js'; ```