-
Notifications
You must be signed in to change notification settings - Fork 3
feat(mcp): implement MRT Push MCP Tool #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
494952f
2d7b340
ff98fc5
787c8b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,11 @@ | |
| * 1. `--api-key` flag (oclif also checks `SFCC_MRT_API_KEY` env var) | ||
| * 2. `~/.mobify` config file (or `~/.mobify--[hostname]` if `--cloud-origin` is set) | ||
| * | ||
| * **MRT Origin** (for Managed Runtime API URL): | ||
| * 1. `--cloud-origin` flag (oclif also checks `SFCC_MRT_CLOUD_ORIGIN` env var) | ||
| * 2. `mrtOrigin` field in dw.json | ||
| * 3. Default: `https://cloud.mobify.com` | ||
| * | ||
| * @module services | ||
| */ | ||
|
|
||
|
|
@@ -47,7 +52,7 @@ import type {ResolvedB2CConfig} from '@salesforce/b2c-tooling-sdk/config'; | |
|
|
||
| /** | ||
| * MRT (Managed Runtime) configuration. | ||
| * Groups auth, project, and environment settings. | ||
| * Groups auth, project, environment, and origin settings. | ||
| */ | ||
| export interface MrtConfig { | ||
| /** Pre-resolved auth strategy for MRT API operations */ | ||
|
|
@@ -56,6 +61,8 @@ export interface MrtConfig { | |
| project?: string; | ||
| /** MRT environment from --environment flag or SFCC_MRT_ENVIRONMENT env var */ | ||
| environment?: string; | ||
| /** MRT API origin URL from --cloud-origin flag, SFCC_MRT_CLOUD_ORIGIN env var, or mrtOrigin in dw.json */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this the correct sequence to get origin? do we still have issue read from dw.json?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The actual sequence is apparently this, but I'm not sure we need his level of detail?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The MCP shouldn't be concerned with reading from dw.json or ~/.mobify ever. It is only concerned with flags and env vars (which are tied to the flags anyway in oclif so just flags). Those are passed into the config resolution logic if we have it and you get We do have an annoying issue were it's called mrtOrigin and cloudOrigin interchangably. But since this isn't a customer need it's not a huge deal
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also the MRT operations in the SDK are inconsistent in signature patterns (some take a client some create it internally). We identified this in another PR. I'll probably do a refactoring pass on those at some point. |
||
| origin?: string; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -94,7 +101,7 @@ export class Services { | |
| public readonly b2cInstance?: B2CInstance; | ||
|
|
||
| /** | ||
| * Pre-resolved MRT configuration (auth, project, environment). | ||
| * Pre-resolved MRT configuration (auth, project, environment, origin). | ||
| * Resolved once at server startup from MrtCommand flags and ~/.mobify. | ||
| */ | ||
| public readonly mrtConfig: MrtConfig; | ||
|
|
@@ -122,6 +129,7 @@ export class Services { | |
| auth: config.hasMrtConfig() ? config.createMrtAuth() : undefined, | ||
| project: config.values.mrtProject, | ||
| environment: config.values.mrtEnvironment, | ||
| origin: config.values.mrtOrigin, | ||
| }; | ||
|
|
||
| // Build B2C instance using factory method | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding it.