feat(mcp): implement MRT Push MCP Tool#110
Conversation
Do you mean package.json? or dw.json? |
Highly recommend using mcp inspector tool here and running the MCP with --log-level trace to see what's going on. It's possible the config loading logic in the MCP is not correct. |
Oops, corrected description. I mean package.json of the test project (retail-react-app) |
yhsieh1
left a comment
There was a problem hiding this comment.
I do not get chance to test it but it looks good.
| 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 */ |
There was a problem hiding this comment.
is this the correct sequence to get origin? do we still have issue read from dw.json?
There was a problem hiding this comment.
The actual sequence is apparently this, but I'm not sure we need his level of detail?
/** MRT API origin URL from --cloud-origin flag (oclif also checks SFCC_MRT_CLOUD_ORIGIN env var), mrtOrigin in dw.json, or default */
There was a problem hiding this comment.
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 origin: this.resolvedConfig.values.mrtOrigin. But this should generally be concerned with the SDK operations not the MCP.
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
There was a problem hiding this comment.
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.
| ...oclifRules, | ||
| }, | ||
| }, | ||
| { |
clavery
left a comment
There was a problem hiding this comment.
happy to look deeper in main. approving to unblock other things
Summary
Provides an implementation for the MCP MRT Bundle Push Tool (
mrt_bundle_push).pushBundleTesting
This was tested in cursor within a folder created with the commands:
To run the MCP we used the mcp.json below with the prompt
run the bundle push tool with message 'from mcp'Note the inclusion of local MCP server path, explicit destination & credentials (see caveats below)
The bundle successfully uploaded and can be seen ready to be deployed in https://runtime-admin-staging.mobify-storefront.com/salesforce-internal/cc-sparks/patrick
However, there are caveats worth further investigation
./buildbut gives a file not found error, then retries with absolute path to build folder and succeeds."b2c": { "mrtProject": "cc-sparks" }.api_keyfrom my~./mobifyfile. For example,{ "username": "patricksullivan@salesforce.com", "api_key": "REDACTED" }pnpm test)pnpm run format)