meguro-mcp 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  All notable changes to `meguro-mcp` are recorded here. Versions follow Semantic Versioning.
4
4
 
5
+ ## 0.2.4 — 2026-08-02
6
+
7
+ - Adds the immutable `meguro://docs/getting-started/v1` resource and matching `getting-started`
8
+ `docs_read` topic with the exact discovery-first evaluator workflow.
9
+ - Adds concise MCP `initialize.instructions` that directs new clients to the same in-band guide.
10
+ - Keeps the public registry at exactly 44 tools and preserves every non-documentation tool contract.
11
+
12
+ ## 0.2.3 — 2026-08-01
13
+
14
+ - Adds `templates_list`, a read-only closed-world projection of the ordered practice-store template
15
+ catalog, so customers can discover supported templates without duplicating registry data.
16
+ - Preserves only the documented public template fields and excludes profiles, scenario presets,
17
+ credentials, and private route payload from MCP responses.
18
+ - Pins Console connection guidance to the exact `meguro-mcp@0.2.3` artifact.
19
+
5
20
  ## 0.2.2 — 2026-08-01
6
21
 
7
22
  - Enforces each tool's declared top-level argument boundary before API transport, with bounded errors
package/README.md CHANGED
@@ -14,7 +14,7 @@ Dependency-free, no build step: the server is plain Node ≥ 20.
14
14
  Customer MCP clients run the exact public version directly from npm:
15
15
 
16
16
  ```bash
17
- npx -y meguro-mcp@0.2.2
17
+ npx -y meguro-mcp@0.2.4
18
18
  ```
19
19
 
20
20
  Pin the version in client configuration. A pinned quickstart stays reproducible and never changes its
@@ -32,11 +32,12 @@ Console provides fast trusted proof and evidence inspection; the agency agent no
32
32
 
33
33
  <!-- BEGIN GENERATED MCP TOOL TABLE -->
34
34
  <!-- Run `npm run docs:tools --workspace meguro-mcp` to refresh this section from `tools/list`. -->
35
- This table is generated from the server's live `tools/list` response (43 tools).
35
+ This table is generated from the server's live `tools/list` response (44 tools).
36
36
 
37
37
  | Tool | Title | Behavior annotations |
38
38
  |---|---|---|
39
39
  | `docs_read` | Read Meguro receipt and Gate documentation | read-only · non-destructive · idempotent · closed-world |
40
+ | `templates_list` | List practice-store templates | read-only · non-destructive · idempotent · closed-world |
40
41
  | `stores_list` | List practice stores | read-only · non-destructive · idempotent · closed-world |
41
42
  | `store_create` | Create a practice store | read-write · non-destructive · non-idempotent · closed-world |
42
43
  | `store_delete` | Delete a practice store | read-write · destructive · non-idempotent · closed-world |
@@ -89,6 +90,7 @@ local stdio server and the hosted OAuth resource server:
89
90
  - `meguro://docs/receipt-guide/v1`
90
91
  - `meguro://docs/receipt-guide/v2`
91
92
  - `meguro://docs/gate-policy/v1`
93
+ - `meguro://docs/getting-started/v1`
92
94
 
93
95
  Use `resources/list` and `resources/read` when the client supports MCP resources. Use
94
96
  `docs_read({ topic, version })` in every client, including clients without a resource browser.
@@ -120,14 +122,16 @@ Receipt retrieval is `practice_run_report`: **receipt** is the user-facing noun;
120
122
 
121
123
  Use these tool names in order:
122
124
 
123
- 1. `get_connection_details({ storeId })` through the explicit secure flow (`worldId` remains a legacy alias). Keep the returned values out of model/chat logs.
124
- 2. `practice_run_start({ storeId, clock: { mode: "harness", simulationDays: 14, stepDays: 1 } })` — the same `storeId` the previous step took and returned.
125
- 3. Launch the agency agent in its own environment with the stable returned `SHOPIFY_*` values.
126
- 4. `practice_run_status({ attemptId })`, then `practice_run_checkpoint({ attemptId })`.
127
- 5. `practice_run_advance({ attemptId, days: 1, expectedDay, expectedCallSeq })`, using the exact current state cursors. Supply `until` instead of `days` for a supported event stop.
128
- 6. Inspect the aligned checkpoint evidence in Console or the run APIs.
129
- 7. `practice_run_finish({ attemptId })`, then `practice_run_report({ attemptId })` for the run's receipt.
130
- 8. Optionally execute an immutable temporal probe-set revision through the HTTP surface and inspect/export it in Gate.
125
+ 1. `templates_list()` to discover the supported template keys.
126
+ 2. `stores_list()`, then reuse an owned store or call `store_create({ templateKey })`.
127
+ 3. `get_connection_details({ storeId })` through the explicit secure flow (`worldId` remains a legacy alias). Keep the returned values out of model/chat logs.
128
+ 4. `practice_run_start({ storeId, clock: { mode: "harness", simulationDays: 14, stepDays: 1 } })` the same `storeId` the previous step took and returned.
129
+ 5. Launch the agency agent in its own environment with the stable returned `SHOPIFY_*` values.
130
+ 6. `practice_run_status({ attemptId })`, then `practice_run_checkpoint({ attemptId })`.
131
+ 7. `practice_run_advance({ attemptId, days: 1, expectedDay, expectedCallSeq })`, using the exact current state cursors. Supply `until` instead of `days` for a supported event stop.
132
+ 8. Inspect the aligned checkpoint evidence in Console or the run APIs.
133
+ 9. `practice_run_finish({ attemptId })`, then `practice_run_report({ attemptId })` for the run's receipt.
134
+ 10. Optionally execute an immutable temporal probe-set revision through the HTTP surface and inspect/export it in Gate.
131
135
 
132
136
  `get_connection_details` deliberately returns `SHOPIFY_ADMIN_ACCESS_TOKEN`: it is the store-scoped
133
137
  data-plane credential your commerce agent needs for the exact returned `*.meguro.io` Admin URL. Treat
@@ -161,7 +165,7 @@ claude mcp add meguro \
161
165
  -e MEGURO_API_BASE_URL=https://api-dev.meguro.io \
162
166
  -e MEGURO_API_TOKEN=meg_sk_... \
163
167
  -e MEGURO_DASHBOARD_URL=https://... \
164
- -- npx -y meguro-mcp@0.2.2
168
+ -- npx -y meguro-mcp@0.2.4
165
169
  ```
166
170
 
167
171
  ## Register — Cursor (`.cursor/mcp.json`)
@@ -171,7 +175,7 @@ claude mcp add meguro \
171
175
  "mcpServers": {
172
176
  "meguro": {
173
177
  "command": "npx",
174
- "args": ["-y", "meguro-mcp@0.2.2"],
178
+ "args": ["-y", "meguro-mcp@0.2.4"],
175
179
  "env": {
176
180
  "MEGURO_API_BASE_URL": "https://api-dev.meguro.io",
177
181
  "MEGURO_API_TOKEN": "meg_sk_...",
@@ -192,6 +196,6 @@ npm test --workspace meguro-mcp
192
196
  ```
193
197
 
194
198
  The test suite packs the public artifact, installs it into a temporary clean-room project, starts the
195
- installed binary, and requires `tools/list` to return exactly 43 tools without leaking supplied
199
+ installed binary, and requires `tools/list` to return exactly 44 tools without leaking supplied
196
200
  credentials to stdout or stderr. Maintainers should follow [RELEASING.md](./RELEASING.md) for every
197
201
  version; release notes are in [CHANGELOG.md](./CHANGELOG.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meguro-mcp",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Meguro control-plane MCP server: drive worlds, runs, and verdicts from your own AI tools.",
package/src/docs.mjs CHANGED
@@ -3,9 +3,13 @@ import { createHash } from 'node:crypto';
3
3
  const RECEIPT_GUIDE_VERSION = 1;
4
4
  const RECEIPT_GUIDE_LATEST_VERSION = 2;
5
5
  const GATE_POLICY_VERSION = 1;
6
+ const GETTING_STARTED_VERSION = 1;
6
7
  const RECEIPT_GUIDE_URI = `meguro://docs/receipt-guide/v${RECEIPT_GUIDE_VERSION}`;
7
8
  const RECEIPT_GUIDE_LATEST_URI = `meguro://docs/receipt-guide/v${RECEIPT_GUIDE_LATEST_VERSION}`;
8
9
  const GATE_POLICY_URI = `meguro://docs/gate-policy/v${GATE_POLICY_VERSION}`;
10
+ const GETTING_STARTED_URI = `meguro://docs/getting-started/v${GETTING_STARTED_VERSION}`;
11
+
12
+ export const GETTING_STARTED_INSTRUCTIONS = 'New to Meguro? Read `meguro://docs/getting-started/v1` with `resources/read`, or call `docs_read({ topic: "getting-started", version: 1 })`, before starting for the exact tool sequence from template discovery to receipt.';
9
13
 
10
14
  function deepFreeze(value) {
11
15
  if (!value || typeof value !== 'object' || Object.isFrozen(value)) return value;
@@ -745,6 +749,67 @@ do not change. A future policy receives a new id, version, URI, and digest; it i
745
749
  instead of replacing it.
746
750
  `;
747
751
 
752
+ const GETTING_STARTED_TEXT = `# Getting started with Meguro v1
753
+
754
+ Published URI: \`${GETTING_STARTED_URI}\`
755
+
756
+ ## What Meguro is
757
+
758
+ Meguro is a technical evaluation environment for commerce agents, with deterministic practice stores and Shopify-shaped interfaces that let you observe API behavior before production. Its receipts record what an agent called and changed inside the declared practice scenario; they do not predict merchant outcomes or certify production performance.
759
+
760
+ ## Identities
761
+
762
+ - \`storeId\` is the canonical public id of a practice store. \`worldId\` is the legacy alias for the
763
+ same id; prefer \`storeId\` in new integrations.
764
+ - \`attemptId\` is the run identity returned by \`practice_run_start\`. Pass it to every later
765
+ \`practice_run_*\` tool; it is not a store id.
766
+
767
+ ## Canonical discovery-first sequence
768
+
769
+ 1. Call \`templates_list()\` to discover the exact supported template keys.
770
+ 2. Call \`stores_list()\`; reuse an owned practice store or call
771
+ \`store_create({ templateKey })\` with a key returned by \`templates_list\`.
772
+ 3. Call \`get_connection_details({ storeId })\` for the selected store.
773
+
774
+ \`get_connection_details\` deliberately returns \`SHOPIFY_ADMIN_ACCESS_TOKEN\`: it is the store-scoped
775
+ data-plane credential your commerce agent needs for the exact returned \`*.meguro.io\` Admin URL. Treat
776
+ it as a secret, provide it only to that agent process, and keep it out of model/chat logs. It is not the
777
+ account-scoped \`MEGURO_API_TOKEN\` and cannot control other stores or account resources.
778
+ 4. Call \`practice_run_start({ storeId, clock })\`. The fully typed clock shape is
779
+ \`{ mode: "manual" | "harness" | "scheduled", simulationDays: integer, stepDays: integer }\`;
780
+ for example,
781
+ \`practice_run_start({ storeId, clock: { mode: "harness", simulationDays: 14, stepDays: 1 } })\`.
782
+ Both day fields are positive whole Store-day counts.
783
+ 5. Run the commerce agent in its own environment against the Shopify-shaped Admin endpoint and
784
+ store-scoped credential returned by \`get_connection_details\`.
785
+ 6. Call \`practice_run_status({ attemptId })\`, then
786
+ \`practice_run_checkpoint({ attemptId })\`, to inspect and persist progress.
787
+ 7. Call \`practice_run_advance({ attemptId, days, expectedDay, expectedCallSeq })\` with the exact
788
+ current cursors, or replace \`days\` with a supported \`until\` condition. Never send both.
789
+ 8. Call \`practice_run_finish({ attemptId })\` when the evaluation window is complete.
790
+ 9. Call \`practice_run_report({ attemptId })\` to retrieve the receipt. **Receipt** is the customer
791
+ noun; **report** is the compatibility name retained by the tool and HTTP route.
792
+
793
+ ## Control and data planes
794
+
795
+ The local \`meguro-mcp\` server is the Meguro control plane: it discovers stores and drives run
796
+ lifecycle. The practice store's returned Shopify-shaped Admin endpoint is the data plane used by the
797
+ commerce agent under evaluation. A practice store's storefront MCP endpoint is neither of those and
798
+ cannot replace the local control plane or the Shopify-shaped Admin endpoint.
799
+
800
+ ## Deeper in-band documentation
801
+
802
+ - Receipt interpretation: read \`meguro://docs/receipt-guide/v1\` or
803
+ \`meguro://docs/receipt-guide/v2\`, or call
804
+ \`docs_read({ topic: "receipt-guide", version: 1 })\` or
805
+ \`docs_read({ topic: "receipt-guide", version: 2 })\`.
806
+ - Gate policy: read \`meguro://docs/gate-policy/v1\`, or call
807
+ \`docs_read({ topic: "gate-policy", version: 1 })\`.
808
+
809
+ All published documentation resources are immutable. Cite the exact URI, version, and SHA-256
810
+ digest returned by Meguro.
811
+ `;
812
+
748
813
  function entry(input) {
749
814
  const text = String(input.text);
750
815
  return deepFreeze({
@@ -801,6 +866,15 @@ export function buildDocumentationCatalog(inputs) {
801
866
  }
802
867
 
803
868
  const CATALOG = buildDocumentationCatalog([
869
+ {
870
+ topic: 'getting-started',
871
+ version: GETTING_STARTED_VERSION,
872
+ uri: GETTING_STARTED_URI,
873
+ name: 'Getting started with Meguro v1',
874
+ title: 'Getting started with Meguro v1',
875
+ description: 'Discovery-first technical-evaluator sequence from template selection through an immutable practice receipt.',
876
+ text: GETTING_STARTED_TEXT,
877
+ },
804
878
  {
805
879
  topic: 'receipt-guide',
806
880
  version: RECEIPT_GUIDE_VERSION,
package/src/server.mjs CHANGED
@@ -4,10 +4,10 @@
4
4
  // tools/call, resources/list, resources/read, ping) is small and stable; no lockfile churn, no build step.
5
5
 
6
6
  import { createInterface } from 'node:readline';
7
- import { documentationResource, documentationResources } from './docs.mjs';
7
+ import { GETTING_STARTED_INSTRUCTIONS, documentationResource, documentationResources } from './docs.mjs';
8
8
  import { createTools, redactSecrets } from './tools.mjs';
9
9
 
10
- const SERVER_INFO = { name: 'meguro', version: '0.2.2' };
10
+ const SERVER_INFO = { name: 'meguro', version: '0.2.4' };
11
11
  const PROTOCOL_VERSION = '2025-03-26';
12
12
 
13
13
  const tools = createTools({
@@ -38,6 +38,7 @@ async function handle(message) {
38
38
  protocolVersion: typeof params?.protocolVersion === 'string' ? params.protocolVersion : PROTOCOL_VERSION,
39
39
  capabilities: { tools: {}, resources: { listChanged: false } },
40
40
  serverInfo: SERVER_INFO,
41
+ instructions: GETTING_STARTED_INSTRUCTIONS,
41
42
  });
42
43
  case 'notifications/initialized':
43
44
  case 'notifications/cancelled':
package/src/tools.mjs CHANGED
@@ -17,13 +17,14 @@ const AUTH_TEACHING = Object.freeze({
17
17
  'workspace-api-key-revoked': 'This workspace API key is revoked. Create or replace it in Connection settings.',
18
18
  });
19
19
  const FLEET_TOOL_NAMES = new Set([
20
- 'stores_list', 'store_create', 'store_delete', 'store_passport',
20
+ 'templates_list', 'stores_list', 'store_create', 'store_delete', 'store_passport',
21
21
  'workspaces_list', 'workspace_create', 'workspace_archive', 'workspace_unarchive',
22
22
  'share_create', 'shares_list', 'share_status', 'share_publish', 'share_revoke',
23
23
  'catalog_slice_read', 'catalog_slice_snapshot', 'catalog_slices_saved',
24
24
  'store_claim_by_code', 'store_claim',
25
25
  ]);
26
26
  const TOOL_PRESENTATION = Object.freeze({
27
+ templates_list: { title: 'List practice-store templates', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
27
28
  stores_list: { title: 'List practice stores', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
28
29
  store_create: { title: 'Create a practice store', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
29
30
  store_delete: { title: 'Delete a practice store', readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
@@ -153,6 +154,47 @@ function catalogSnapshotProjection(value) {
153
154
  : safe;
154
155
  }
155
156
 
157
+ const STORE_TEMPLATE_FIELDS = Object.freeze([
158
+ 'key',
159
+ 'label',
160
+ 'category',
161
+ 'recommended',
162
+ 'bestFor',
163
+ 'agentTypes',
164
+ 'agentSees',
165
+ 'recommendedRunDays',
166
+ 'recommendedPaceMinutes',
167
+ 'recommendedStepDays',
168
+ 'eventWindowReason',
169
+ 'shortDebugDays',
170
+ 'extendedRunDays',
171
+ 'whatAgentGets',
172
+ 'supportedReads',
173
+ 'liveRun',
174
+ 'goodFirstAgents',
175
+ 'supportedWrites',
176
+ 'knownUnsupported',
177
+ 'goodAgentShould',
178
+ 'avoid',
179
+ 'reportGrades',
180
+ ]);
181
+
182
+ function storeTemplatesProjection(value) {
183
+ if (!Array.isArray(value?.storeTemplates)) {
184
+ throw new Error('Meguro template catalog response did not contain storeTemplates');
185
+ }
186
+ return {
187
+ storeTemplates: value.storeTemplates.map((template) => {
188
+ if (!template || typeof template !== 'object' || Array.isArray(template)) {
189
+ throw new Error('Meguro template catalog contained an invalid template entry');
190
+ }
191
+ return Object.fromEntries(STORE_TEMPLATE_FIELDS
192
+ .filter((field) => Object.hasOwn(template, field))
193
+ .map((field) => [field, secretSafe(template[field], 1)]));
194
+ }),
195
+ };
196
+ }
197
+
156
198
  function practiceErrorResult(status, value, retryAfterSeconds) {
157
199
  const authenticationError = authenticationErrorResult(status, value);
158
200
  if (authenticationError) return authenticationError;
@@ -995,25 +1037,37 @@ export function createTools(config) {
995
1037
  const rawDefinitions = [
996
1038
  {
997
1039
  name: 'docs_read',
998
- description: 'Read Meguro customer documentation in-band. Topics: receipt-guide version 1 (the original immutable receipt interpretation), receipt-guide version 2 (adds the Console-only account-deletion and public-id invalidation contract), and gate-policy version 1 (immutable named checks, receipt facts, thresholds, precedence, flip conditions, and self-gating). Account deletion is deliberately not an MCP tool. Pass the exact published version so a cited policy never resolves to mutable latest content.',
1040
+ description: 'Read Meguro customer documentation in-band. Topics: getting-started version 1 (the exact discovery-first evaluator sequence), receipt-guide versions 1 and 2 (immutable receipt interpretation), and gate-policy version 1 (immutable named checks, receipt facts, thresholds, precedence, flip conditions, and self-gating). Account deletion is deliberately not an MCP tool. Pass the exact published version so cited documentation never resolves to mutable latest content.',
999
1041
  inputSchema: {
1000
1042
  type: 'object',
1001
1043
  additionalProperties: false,
1002
1044
  properties: {
1003
1045
  topic: {
1004
1046
  type: 'string',
1005
- enum: ['receipt-guide', 'gate-policy'],
1006
- description: 'receipt-guide or gate-policy.',
1047
+ enum: ['getting-started', 'receipt-guide', 'gate-policy'],
1048
+ description: 'getting-started, receipt-guide, or gate-policy.',
1007
1049
  },
1008
1050
  version: {
1009
1051
  type: 'integer',
1010
1052
  enum: [1, 2],
1011
- description: 'Published immutable document version. Receipt guide versions 1 and 2 are available; Gate policy currently has version 1.',
1053
+ description: 'Published immutable document version. Getting started and Gate policy have version 1; Receipt guide has versions 1 and 2.',
1012
1054
  },
1013
1055
  },
1014
1056
  required: ['topic', 'version'],
1015
1057
  },
1016
1058
  },
1059
+ {
1060
+ name: 'templates_list',
1061
+ description: 'List the ordered, public-safe practice-store template catalog available for creating a store. The response is a bounded projection of storeTemplates only: it excludes customer profiles, scenario presets, credentials, and private route payload. An OAuth grant may select an owned non-default workspace; an API key remains bound to its own workspace.',
1062
+ inputSchema: {
1063
+ type: 'object',
1064
+ additionalProperties: false,
1065
+ properties: {
1066
+ workspaceId: { type: 'string', minLength: 1, description: 'Optional OAuth selector for an account-owned non-default workspace. A workspace API key may omit it or repeat only its own binding.' },
1067
+ },
1068
+ required: [],
1069
+ },
1070
+ },
1017
1071
  {
1018
1072
  name: 'stores_list',
1019
1073
  description: 'List one workspace\'s practice-store fleet with ids, names, templates, generated-history span, readiness, active-run state, and deletion context. An OAuth grant is account-bound: omit workspaceId for the default workspace or provide an owned non-default workspace id. An API key remains bound to its own workspace.',
@@ -1566,14 +1620,19 @@ export function createTools(config) {
1566
1620
  switch (name) {
1567
1621
  case 'docs_read': {
1568
1622
  const topic = requiredString(args, 'topic');
1569
- if (!['receipt-guide', 'gate-policy'].includes(topic)) {
1570
- throw new Error('topic must be receipt-guide or gate-policy');
1623
+ if (!['getting-started', 'receipt-guide', 'gate-policy'].includes(topic)) {
1624
+ throw new Error('topic must be getting-started, receipt-guide, or gate-policy');
1571
1625
  }
1572
1626
  if (!Number.isSafeInteger(args.version) || args.version < 1) {
1573
1627
  throw new Error('version must be the exact published positive integer');
1574
1628
  }
1575
1629
  return textResult(documentationByTopic(topic, args.version));
1576
1630
  }
1631
+ case 'templates_list': {
1632
+ const workspaceId = optionalWorkspaceId(args);
1633
+ const response = await fleetRequest(name, 'GET', '/practice/profiles', undefined, { workspaceId });
1634
+ return 'error' in response ? response.error : textResult(storeTemplatesProjection(response.value));
1635
+ }
1577
1636
  case 'stores_list': {
1578
1637
  const workspaceId = optionalWorkspaceId(args);
1579
1638
  const response = await fleetRequest(name, 'GET', '/practice/stores', undefined, { workspaceId });