@fluentcommerce/fluent-mcp-extn 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,29 +1,29 @@
1
- # Choose one authentication strategy.
2
- # Strategy 1 (recommended for local dev): Fluent CLI profile
3
- # FLUENT_PROFILE=HMDEV
4
- # FLUENT_PROFILE_RETAILER=HM_TEST
5
-
6
- # Strategy 2 (recommended for CI/runtime): OAuth
7
- FLUENT_BASE_URL=https://YOUR_ACCOUNT.sandbox.api.fluentretail.com
8
- FLUENT_RETAILER_ID=YOUR_RETAILER_ID
9
- FLUENT_CLIENT_ID=YOUR_CLIENT_ID
10
- FLUENT_CLIENT_SECRET=YOUR_CLIENT_SECRET
11
- FLUENT_USERNAME=YOUR_USERNAME
12
- FLUENT_PASSWORD=YOUR_PASSWORD
13
-
14
- # Strategy 3 (optional): Token command
15
- # FLUENT_BASE_URL=https://YOUR_ACCOUNT.sandbox.api.fluentretail.com
16
- # FLUENT_RETAILER_ID=YOUR_RETAILER_ID
17
- # TOKEN_COMMAND=vault read -field=token secret/fluent/client-dev
18
-
19
- # Strategy 4 (optional): Static token
20
- # FLUENT_BASE_URL=https://YOUR_ACCOUNT.sandbox.api.fluentretail.com
21
- # FLUENT_RETAILER_ID=YOUR_RETAILER_ID
22
- # FLUENT_ACCESS_TOKEN=YOUR_BEARER_TOKEN
23
-
24
- # Optional resilience tuning
25
- # FLUENT_REQUEST_TIMEOUT_MS=30000
26
- # FLUENT_RETRY_ATTEMPTS=3
27
- # FLUENT_RETRY_INITIAL_DELAY_MS=300
28
- # FLUENT_RETRY_MAX_DELAY_MS=5000
29
- # FLUENT_RETRY_FACTOR=2
1
+ # Choose one authentication strategy.
2
+ # Strategy 1 (recommended for local dev): Fluent CLI profile
3
+ # FLUENT_PROFILE=HMDEV
4
+ # FLUENT_PROFILE_RETAILER=HM_TEST
5
+
6
+ # Strategy 2 (recommended for CI/runtime): OAuth
7
+ FLUENT_BASE_URL=https://YOUR_ACCOUNT.sandbox.api.fluentretail.com
8
+ FLUENT_RETAILER_ID=YOUR_RETAILER_ID
9
+ FLUENT_CLIENT_ID=YOUR_CLIENT_ID
10
+ FLUENT_CLIENT_SECRET=YOUR_CLIENT_SECRET
11
+ FLUENT_USERNAME=YOUR_USERNAME
12
+ FLUENT_PASSWORD=YOUR_PASSWORD
13
+
14
+ # Strategy 3 (optional): Token command
15
+ # FLUENT_BASE_URL=https://YOUR_ACCOUNT.sandbox.api.fluentretail.com
16
+ # FLUENT_RETAILER_ID=YOUR_RETAILER_ID
17
+ # TOKEN_COMMAND=vault read -field=token secret/fluent/client-dev
18
+
19
+ # Strategy 4 (optional): Static token
20
+ # FLUENT_BASE_URL=https://YOUR_ACCOUNT.sandbox.api.fluentretail.com
21
+ # FLUENT_RETAILER_ID=YOUR_RETAILER_ID
22
+ # FLUENT_ACCESS_TOKEN=YOUR_BEARER_TOKEN
23
+
24
+ # Optional resilience tuning
25
+ # FLUENT_REQUEST_TIMEOUT_MS=30000
26
+ # FLUENT_RETRY_ATTEMPTS=3
27
+ # FLUENT_RETRY_INITIAL_DELAY_MS=300
28
+ # FLUENT_RETRY_MAX_DELAY_MS=5000
29
+ # FLUENT_RETRY_FACTOR=2
@@ -1,165 +1,165 @@
1
- # fluent-mcp-extn Handover for GitHub Copilot
2
-
3
- This handover pack explains how to run `fluent-mcp-extn` with:
4
-
5
- 1. GitHub Copilot in VS Code (local MCP server)
6
- 2. GitHub Copilot coding agent on GitHub.com (repository MCP configuration)
7
-
8
- Use the checklists below exactly in order for first-time setup.
9
-
10
- ## Dependencies
11
-
12
- `fluent-mcp-extn` talks directly to Fluent APIs through `@fluentcommerce/fc-connect-sdk`.
13
-
14
- - Runtime dependency on Fluent CLI: **No**
15
- - Runtime dependency on the official `fluent mcp server --stdio`: **No**
16
- - Optional Fluent CLI usage: **Yes**, only if your team chooses CLI-based helpers (for example profile workflows or smoke test shortcuts) — not required for normal MCP runtime
17
-
18
- ## What colleagues need locally
19
-
20
- - Node.js 20+
21
- - npm
22
- - Access to Fluent credentials (profile, OAuth, token command, or static token)
23
- - This repository checked out locally
24
-
25
- ## A) VS Code Copilot (local MCP server)
26
-
27
- ### Step-by-step setup
28
-
29
- 1) Build the server (from repository root):
30
-
31
- ```bash
32
- cd fluent-mcp-extn
33
- npm install
34
- npm run build
35
- ```
36
-
37
- 2) Create local env file:
38
-
39
- Copy `fluent-mcp-extn/docs/HANDOVER_ENV.example` to `fluent-mcp-extn/.env.local` and fill real values.
40
- Both paths are relative to the repository root.
41
-
42
- 3) Configure MCP in VS Code workspace:
43
-
44
- Copy `fluent-mcp-extn/docs/HANDOVER_VSCODE_MCP_JSON.example.json` to `.vscode/mcp.json` (relative to the repository root).
45
-
46
- 4) Restart VS Code window (or reload) so MCP config is re-read.
47
-
48
- 5) Start the MCP server in VS Code:
49
-
50
- 1. Run `MCP: List Servers`
51
- 2. Start `fluentMcpExtn`
52
- 3. Accept trust prompt
53
- 4. Run `MCP: Reset Cached Tools` if tools are stale after upgrades
54
-
55
- 6) Verify in Copilot chat (agent mode), run:
56
-
57
- 1. `config.validate`
58
- 2. `health.ping`
59
- 3. `graphql.query` with `query { __typename }`
60
-
61
- Expected minimum:
62
-
63
- - `config.validate` returns `ok: true`
64
- - `health.ping` returns `status: "ok"`
65
- - GraphQL test returns data without auth/config errors
66
-
67
- If these pass, local setup is complete.
68
-
69
- Operational behavior to know:
70
-
71
- - read operations use retry/backoff for transient failures
72
- - non-idempotent write operations do not auto-retry
73
- - `graphql.query` disables retries automatically when the request is a mutation
74
-
75
- ### Updating after code changes
76
-
77
- When `fluent-mcp-extn` is updated (new tools, bug fixes), rebuild from the repository root:
78
-
79
- ```bash
80
- cd fluent-mcp-extn
81
- npm install
82
- npm run build
83
- ```
84
-
85
- Then restart the MCP server in VS Code (`MCP: List Servers` → stop → start).
86
-
87
- ## B) GitHub Copilot coding agent (GitHub.com)
88
-
89
- ### Step-by-step setup
90
-
91
- 1) Create/use repository environment (for example `copilot`).
92
-
93
- 2) Add environment secrets/variables in that environment with names beginning `COPILOT_MCP_`, such as:
94
-
95
- - `COPILOT_MCP_FLUENT_BASE_URL`
96
- - `COPILOT_MCP_FLUENT_RETAILER_ID`
97
- - `COPILOT_MCP_FLUENT_CLIENT_ID`
98
- - `COPILOT_MCP_FLUENT_CLIENT_SECRET`
99
- - `COPILOT_MCP_FLUENT_USERNAME`
100
- - `COPILOT_MCP_FLUENT_PASSWORD`
101
-
102
- The MCP config maps these names as bare strings in the `env` block. The Copilot coding agent automatically resolves each string value from the repository environment secret/variable of the same name — no `${{ secrets.X }}` syntax is needed.
103
-
104
- 3) Ensure build runs in agent environment:
105
-
106
- Use `.github/workflows/copilot-setup-steps.yml` based on
107
- `docs/HANDOVER_COPILOT_SETUP_STEPS.example.yml`.
108
-
109
- The example includes both `workflow_dispatch` and `push` on `main` so setup can
110
- be run manually and also pre-built on default-branch pushes. If your default
111
- branch is not `main`, change it in the workflow file.
112
-
113
- 4) Add MCP configuration in repository Copilot coding agent settings:
114
-
115
- Use the JSON in `docs/HANDOVER_GITHUB_REPO_MCP_CONFIG.example.json`.
116
-
117
- This configuration uses `type: "local"` and explicitly allowlists tools.
118
-
119
- 5) Validate in a Copilot coding agent session:
120
-
121
- - trigger an agent task in the repository
122
- - open session logs and confirm MCP server start step succeeds
123
- - confirm tools are discovered (for example `config.validate`, `graphql.query`)
124
-
125
- ### Updating after code changes
126
-
127
- The `copilot-setup-steps.yml` workflow runs `npm ci && npm run build` automatically, so the agent always uses the latest committed code. No manual rebuild is needed on GitHub — just push the updated `fluent-mcp-extn/` source.
128
-
129
- ## Synchronous fulfilment options support
130
-
131
- `graphql.query` supports live checkout-style synchronous fulfilment options calls, for example:
132
-
133
- - `createFulfilmentOption(..., executionMode: AWAIT_ORCHESTRATION)`
134
-
135
- Important runtime requirement:
136
-
137
- - The target environment must have matching workflow(s), e.g. `FULFILMENT_OPTIONS::<type>`.
138
- - If missing, you will get:
139
- - `Workflow [FULFILMENT_OPTIONS::<type>] not found`
140
-
141
- ## Common first-run issues
142
-
143
- - `sdk adapter: not configured`
144
- - check env values are present and mapped correctly
145
- - `AUTH_ERROR`
146
- - verify client credentials/user password/token source
147
- - `FLUENT_CLIENT_ID` is the Fluent **Account ID** (the same value used as `client_id` in the OAuth token request). Do not confuse it with a separate application client identifier.
148
- - `Workflow [FULFILMENT_OPTIONS::<type>] not found`
149
- - deploy matching fulfilment options workflow for the selected retailer/type
150
- - webhook signature mismatch
151
- - provide exact `rawBody` to `webhook.validate` (signature checks are byte-sensitive)
152
-
153
- ## Security notes
154
-
155
- - Never commit real secrets to `.mcp.json`, `mcp.json`, or docs.
156
- - Prefer `envFile` locally (`.env.local`) and secret-backed values in GitHub environments.
157
- - Rotate credentials immediately if accidentally exposed.
158
-
159
- ## Files in this handover pack
160
-
161
- - `HANDOVER_GITHUB_COPILOT.md` (this guide)
162
- - `HANDOVER_ENV.example`
163
- - `HANDOVER_VSCODE_MCP_JSON.example.json`
164
- - `HANDOVER_GITHUB_REPO_MCP_CONFIG.example.json`
165
- - `HANDOVER_COPILOT_SETUP_STEPS.example.yml`
1
+ # fluent-mcp-extn Handover for GitHub Copilot
2
+
3
+ This handover pack explains how to run `fluent-mcp-extn` with:
4
+
5
+ 1. GitHub Copilot in VS Code (local MCP server)
6
+ 2. GitHub Copilot coding agent on GitHub.com (repository MCP configuration)
7
+
8
+ Use the checklists below exactly in order for first-time setup.
9
+
10
+ ## Dependencies
11
+
12
+ `fluent-mcp-extn` talks directly to Fluent APIs through `@fluentcommerce/fc-connect-sdk`.
13
+
14
+ - Runtime dependency on Fluent CLI: **No**
15
+ - Runtime dependency on the official `fluent mcp server --stdio`: **No**
16
+ - Optional Fluent CLI usage: **Yes**, only if your team chooses CLI-based helpers (for example profile workflows or smoke test shortcuts) — not required for normal MCP runtime
17
+
18
+ ## What colleagues need locally
19
+
20
+ - Node.js 20+
21
+ - npm
22
+ - Access to Fluent credentials (profile, OAuth, token command, or static token)
23
+ - This repository checked out locally
24
+
25
+ ## A) VS Code Copilot (local MCP server)
26
+
27
+ ### Step-by-step setup
28
+
29
+ 1) Build the server (from repository root):
30
+
31
+ ```bash
32
+ cd fluent-mcp-extn
33
+ npm install
34
+ npm run build
35
+ ```
36
+
37
+ 2) Create local env file:
38
+
39
+ Copy `fluent-mcp-extn/docs/HANDOVER_ENV.example` to `fluent-mcp-extn/.env.local` and fill real values.
40
+ Both paths are relative to the repository root.
41
+
42
+ 3) Configure MCP in VS Code workspace:
43
+
44
+ Copy `fluent-mcp-extn/docs/HANDOVER_VSCODE_MCP_JSON.example.json` to `.vscode/mcp.json` (relative to the repository root).
45
+
46
+ 4) Restart VS Code window (or reload) so MCP config is re-read.
47
+
48
+ 5) Start the MCP server in VS Code:
49
+
50
+ 1. Run `MCP: List Servers`
51
+ 2. Start `fluentMcpExtn`
52
+ 3. Accept trust prompt
53
+ 4. Run `MCP: Reset Cached Tools` if tools are stale after upgrades
54
+
55
+ 6) Verify in Copilot chat (agent mode), run:
56
+
57
+ 1. `config.validate`
58
+ 2. `health.ping`
59
+ 3. `graphql.query` with `query { __typename }`
60
+
61
+ Expected minimum:
62
+
63
+ - `config.validate` returns `ok: true`
64
+ - `health.ping` returns `status: "ok"`
65
+ - GraphQL test returns data without auth/config errors
66
+
67
+ If these pass, local setup is complete.
68
+
69
+ Operational behavior to know:
70
+
71
+ - read operations use retry/backoff for transient failures
72
+ - non-idempotent write operations do not auto-retry
73
+ - `graphql.query` disables retries automatically when the request is a mutation
74
+
75
+ ### Updating after code changes
76
+
77
+ When `fluent-mcp-extn` is updated (new tools, bug fixes), rebuild from the repository root:
78
+
79
+ ```bash
80
+ cd fluent-mcp-extn
81
+ npm install
82
+ npm run build
83
+ ```
84
+
85
+ Then restart the MCP server in VS Code (`MCP: List Servers` → stop → start).
86
+
87
+ ## B) GitHub Copilot coding agent (GitHub.com)
88
+
89
+ ### Step-by-step setup
90
+
91
+ 1) Create/use repository environment (for example `copilot`).
92
+
93
+ 2) Add environment secrets/variables in that environment with names beginning `COPILOT_MCP_`, such as:
94
+
95
+ - `COPILOT_MCP_FLUENT_BASE_URL`
96
+ - `COPILOT_MCP_FLUENT_RETAILER_ID`
97
+ - `COPILOT_MCP_FLUENT_CLIENT_ID`
98
+ - `COPILOT_MCP_FLUENT_CLIENT_SECRET`
99
+ - `COPILOT_MCP_FLUENT_USERNAME`
100
+ - `COPILOT_MCP_FLUENT_PASSWORD`
101
+
102
+ The MCP config maps these names as bare strings in the `env` block. The Copilot coding agent automatically resolves each string value from the repository environment secret/variable of the same name — no `${{ secrets.X }}` syntax is needed.
103
+
104
+ 3) Ensure build runs in agent environment:
105
+
106
+ Use `.github/workflows/copilot-setup-steps.yml` based on
107
+ `docs/HANDOVER_COPILOT_SETUP_STEPS.example.yml`.
108
+
109
+ The example includes both `workflow_dispatch` and `push` on `main` so setup can
110
+ be run manually and also pre-built on default-branch pushes. If your default
111
+ branch is not `main`, change it in the workflow file.
112
+
113
+ 4) Add MCP configuration in repository Copilot coding agent settings:
114
+
115
+ Use the JSON in `docs/HANDOVER_GITHUB_REPO_MCP_CONFIG.example.json`.
116
+
117
+ This configuration uses `type: "local"` and explicitly allowlists tools.
118
+
119
+ 5) Validate in a Copilot coding agent session:
120
+
121
+ - trigger an agent task in the repository
122
+ - open session logs and confirm MCP server start step succeeds
123
+ - confirm tools are discovered (for example `config.validate`, `graphql.query`)
124
+
125
+ ### Updating after code changes
126
+
127
+ The `copilot-setup-steps.yml` workflow runs `npm ci && npm run build` automatically, so the agent always uses the latest committed code. No manual rebuild is needed on GitHub — just push the updated `fluent-mcp-extn/` source.
128
+
129
+ ## Synchronous fulfilment options support
130
+
131
+ `graphql.query` supports live checkout-style synchronous fulfilment options calls, for example:
132
+
133
+ - `createFulfilmentOption(..., executionMode: AWAIT_ORCHESTRATION)`
134
+
135
+ Important runtime requirement:
136
+
137
+ - The target environment must have matching workflow(s), e.g. `FULFILMENT_OPTIONS::<type>`.
138
+ - If missing, you will get:
139
+ - `Workflow [FULFILMENT_OPTIONS::<type>] not found`
140
+
141
+ ## Common first-run issues
142
+
143
+ - `sdk adapter: not configured`
144
+ - check env values are present and mapped correctly
145
+ - `AUTH_ERROR`
146
+ - verify client credentials/user password/token source
147
+ - `FLUENT_CLIENT_ID` is the Fluent **Account ID** (the same value used as `client_id` in the OAuth token request). Do not confuse it with a separate application client identifier.
148
+ - `Workflow [FULFILMENT_OPTIONS::<type>] not found`
149
+ - deploy matching fulfilment options workflow for the selected retailer/type
150
+ - webhook signature mismatch
151
+ - provide exact `rawBody` to `webhook.validate` (signature checks are byte-sensitive)
152
+
153
+ ## Security notes
154
+
155
+ - Never commit real secrets to `.mcp.json`, `mcp.json`, or docs.
156
+ - Prefer `envFile` locally (`.env.local`) and secret-backed values in GitHub environments.
157
+ - Rotate credentials immediately if accidentally exposed.
158
+
159
+ ## Files in this handover pack
160
+
161
+ - `HANDOVER_GITHUB_COPILOT.md` (this guide)
162
+ - `HANDOVER_ENV.example`
163
+ - `HANDOVER_VSCODE_MCP_JSON.example.json`
164
+ - `HANDOVER_GITHUB_REPO_MCP_CONFIG.example.json`
165
+ - `HANDOVER_COPILOT_SETUP_STEPS.example.yml`