@event4u/agent-config 1.40.0 → 1.41.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.
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Shared agent configuration \u2014 skills for AI coding tools (Claude Code, Augment, Cursor, Cline, Windsurf, Gemini CLI).",
9
- "version": "1.40.0"
9
+ "version": "1.41.1"
10
10
  },
11
11
  "plugins": [
12
12
  {
package/CHANGELOG.md CHANGED
@@ -318,6 +318,54 @@ our recommendation order, not its support status.
318
318
  users" tension without removing any path that an existing user
319
319
  might rely on.
320
320
 
321
+ ## [1.41.1](https://github.com/event4u-app/agent-config/compare/1.41.0...1.41.1) (2026-05-12)
322
+
323
+ ### Documentation
324
+
325
+ * **mcp:** promote durable strategy to agents/contexts; unhook contracts from roadmap ([f9e7278](https://github.com/event4u-app/agent-config/commit/f9e727895e75aa74c712ce628811527a5b982f98))
326
+ * **mcp:** add stability frontmatter to discovery-phase-notice contract ([0aacd0b](https://github.com/event4u-app/agent-config/commit/0aacd0b69849029db19985aa08591d52bb5a677b))
327
+ * **mcp:** re-anchor roadmap links to archive path ([cbbd77c](https://github.com/event4u-app/agent-config/commit/cbbd77c29a2847db8e69e7e56457dcc1b794b307))
328
+
329
+ ### Chores
330
+
331
+ * **mcp:** re-anchor roadmap citations in scripts to archive path ([71cac67](https://github.com/event4u-app/agent-config/commit/71cac67cc90b2e42bfa3455f0429791e4bedc60f))
332
+ * **roadmap:** close road-to-mcp-full-coverage and archive ([32c2542](https://github.com/event4u-app/agent-config/commit/32c25424fd5b078074c703cb03fb57731ae78f6f))
333
+
334
+ Tests: 3173 (+0 since 1.41.0)
335
+
336
+ ## [1.41.0](https://github.com/event4u-app/agent-config/compare/1.40.0...1.41.0) (2026-05-12)
337
+
338
+ ### Features
339
+
340
+ * **mcp/worker:** add optional MCP-Token Bearer auth ([134c6ee](https://github.com/event4u-app/agent-config/commit/134c6ee34ee5fc1f1809f5be72df1ac82ad0cca6))
341
+ * **mcp:** L2+L4 — implement 7 read-only tools + catalog sync ([44a0082](https://github.com/event4u-app/agent-config/commit/44a00827a7e19051e58e2a5866a37e8c6e4fb1a6))
342
+ * **mcp:** K1+K2 — telemetry SQLite store + CLI dashboard ([e53f321](https://github.com/event4u-app/agent-config/commit/e53f321d3d6a7fb5c95a97232898fbda15cd129b))
343
+ * **mcp:** J6 — telemetry healthcheck + consumer discovery notice ([41f02f7](https://github.com/event4u-app/agent-config/commit/41f02f773feb6248ea315e0820d2a81d960b98c9))
344
+ * **mcp:** J1-J4 — discovery catalog + stub envelope + telemetry ([38aff65](https://github.com/event4u-app/agent-config/commit/38aff651138d8c20929cab88ac437f3106ba44c3))
345
+
346
+ ### Documentation
347
+
348
+ * **mcp:** remove public endpoint, document self-hosting + Bearer auth ([6c5d7b0](https://github.com/event4u-app/agent-config/commit/6c5d7b04231e9e274265e7f0481502455085f748))
349
+
350
+ ### Refactoring
351
+
352
+ * **scripts:** migrate readers to centralized agent_settings loader ([7849c03](https://github.com/event4u-app/agent-config/commit/7849c03f282cdaf344ac56056d55cb1c63e17eba))
353
+
354
+ ### Tests
355
+
356
+ * **mcp:** L3 — hermetic shape contracts for 7 RO tools ([0d3edc9](https://github.com/event4u-app/agent-config/commit/0d3edc9fb1f98df80a4eb503a0dd4c868d2f85f2))
357
+ * **mcp:** J5 — acceptance tests for catalog, envelope, telemetry ([806e4bb](https://github.com/event4u-app/agent-config/commit/806e4bb2bdd2292dfb75eddd9b4eff6073f16a00))
358
+
359
+ ### Chores
360
+
361
+ * **mcp/taskfile:** add mcp:cloud:secret-put task ([dcffef5](https://github.com/event4u-app/agent-config/commit/dcffef5c384bf75261189b035417593418c8c36c))
362
+ * **roadmap:** flip Phase 2 + Phase 3 of road-to-mcp-full-coverage ([2ce23bc](https://github.com/event4u-app/agent-config/commit/2ce23bcaf7482aeb095cc85d106a78ac5c0d2682))
363
+ * **roadmap:** flip Phase 1 of road-to-mcp-full-coverage (J1–J6) ([707f5c0](https://github.com/event4u-app/agent-config/commit/707f5c002f827b2600cfcf6019d3d22166b46fc2))
364
+ * **ci:** regenerate derived artifacts and fix command-count drift ([dd4eeac](https://github.com/event4u-app/agent-config/commit/dd4eeac96094d99bae318b2160a914be46caead9))
365
+ * **roadmaps:** archive road-to-portable-dev-preferences ([77f4cf1](https://github.com/event4u-app/agent-config/commit/77f4cf1825962503891973800450c3ca769e2adc))
366
+
367
+ Tests: 3173 (+32 since 1.40.0)
368
+
321
369
  ## [1.40.0](https://github.com/event4u-app/agent-config/compare/1.39.0...1.40.0) (2026-05-11)
322
370
 
323
371
  ### Features
package/README.md CHANGED
@@ -90,38 +90,64 @@ Install directly in your agent for global, cross-project use:
90
90
  → [Full getting started guide](docs/getting-started.md) ·
91
91
  [More examples & expected behavior](docs/showcase.md)
92
92
 
93
- ### Remote MCP — zero install
93
+ ### Self-hosted MCP on Cloudflare — zero local install
94
94
 
95
- Skills, commands, rules, and guidelines are also served as a hosted MCP
96
- endpoint. No clone, no `task mcp:setup`, no Python venv — point any
97
- MCP-capable client (Claude Desktop, Cursor, Zed, Continue, hosted agents)
98
- at:
95
+ Skills, commands, rules, and guidelines can be served as an MCP endpoint
96
+ from your own Cloudflare Worker — no clone, no `task mcp:setup`, no
97
+ Python venv on the consumer machine, just an HTTP URL any MCP client
98
+ (Claude Desktop, Claude Code, Cursor, Zed, Continue, hosted agents)
99
+ talks to.
99
100
 
100
- ```
101
- https://agent-config-mcp.event4u.workers.dev
101
+ The Worker source lives in `workers/mcp/`; deploying it to your own
102
+ Cloudflare account takes ~5 minutes:
103
+
104
+ ```bash
105
+ task mcp:cloud:login # one-time, opens browser
106
+ task mcp:cloud:setup # check → r2-create → r2-verify → whoami
107
+ task mcp:cloud:secret-put # set MCP-Token (Bearer auth, recommended)
108
+ # Then deploy via CI — see operator guide below.
102
109
  ```
103
110
 
104
- Verify it's live:
111
+ After deploy your Worker lives at
112
+ `https://agent-config-mcp.<your-account>.workers.dev` (or a custom
113
+ domain you wire in Step 7 of the operator guide). Verify:
105
114
 
106
115
  ```bash
107
- curl https://agent-config-mcp.event4u.workers.dev
116
+ curl https://agent-config-mcp.<your-account>.workers.dev
108
117
  # → { "ok": true, "name": "agent-config-mcp", "release_key": "v…", … }
109
118
  ```
110
119
 
111
- Read-only, identity-stable per release. Per-client setup snippets
112
- (Claude Desktop, Claude Code, Cursor, Zed, Continue) —
113
- [`docs/setup/mcp-client-config.md`](docs/setup/mcp-client-config.md).
114
- URL shapes (latest vs. pinned `/v<X.Y.Z>`) —
115
- [`docs/setup/mcp-cloud-endpoints.md`](docs/setup/mcp-cloud-endpoints.md).
116
- Operator setup (account, R2, secrets) — [`docs/setup/mcp-cloud-setup.md`](docs/setup/mcp-cloud-setup.md).
120
+ Per-client setup snippets (Claude Desktop, Claude Code, Cursor, Zed,
121
+ Continue) — [`docs/setup/mcp-client-config.md`](docs/setup/mcp-client-config.md).
122
+ URL shapes (latest vs. pinned `/v<X.Y.Z>`) — [`docs/setup/mcp-cloud-endpoints.md`](docs/setup/mcp-cloud-endpoints.md).
123
+ Full operator walkthrough (account, R2, GitHub secrets, deploy) —
124
+ [`docs/setup/mcp-cloud-setup.md`](docs/setup/mcp-cloud-setup.md).
117
125
  Experimental — A0-cloud contract lives at `docs/contracts/mcp-cloud-scope.md` (internal reference only per `STABILITY.md`).
118
126
 
119
- > **Scope Lite, not Full.** The hosted MCP endpoint serves the
120
- > read-only governance surface (skills · commands · rules · guidelines
121
- > · contexts) as MCP prompts and resources. It does **not** execute any
122
- > of the ~112 Python scripts that ship with the package (linters,
123
- > audits, `task ci`, work-engine hooks, …). Those require the full
124
- > local install per [Quickstart](#quickstart). See
127
+ #### Lock your Worker behind a Bearer token
128
+
129
+ Without auth, any MCP client that knows your `*.workers.dev` URL can
130
+ read the catalog. For private deploys, set the `MCP-Token` secret and
131
+ the Worker will require `Authorization: Bearer <token>` on every POST:
132
+
133
+ ```bash
134
+ task mcp:cloud:secret-put # wraps `npx wrangler secret put MCP-Token --name agent-config-mcp`
135
+ # wrangler prompts for the value interactively — never passed via argv.
136
+ ```
137
+
138
+ Once the secret is set, every client config block needs the token in
139
+ its headers — see [`docs/setup/mcp-client-config.md`](docs/setup/mcp-client-config.md) § Bearer auth for the
140
+ per-client snippets (Claude Desktop, Claude Code, Cursor, Zed,
141
+ Continue). The `GET /` liveness probe stays open so health checks keep
142
+ working without the token.
143
+
144
+ > **Scope — Lite, not Full.** The Worker serves the read-only governance
145
+ > surface (skills · commands · rules · guidelines · contexts) as MCP
146
+ > prompts and resources, plus a small set of read-only tools (`memory_lookup`,
147
+ > `chat_history_read`, `list_*`, `read_resource_body`). It does **not**
148
+ > execute any of the ~112 Python scripts that ship with the package
149
+ > (linters, audits, `task ci`, work-engine hooks, …). Those require the
150
+ > full local install per [Quickstart](#quickstart). See
125
151
  > `docs/contracts/mcp-cloud-scope.md` (internal reference only per
126
152
  > `STABILITY.md`) for the execution-safety boundary.
127
153
 
@@ -69,7 +69,7 @@ are not roadmap steps.
69
69
  - **Doc anchor:** none yet.
70
70
  - **Action:** Submit to Smithery once the MCP server can be installed
71
71
  and exercised end-to-end.
72
- - **Pre-conditions:** [`road-to-mcp-full-coverage.md`](../agents/roadmaps/road-to-mcp-full-coverage.md)
72
+ - **Pre-conditions:** [`road-to-mcp-full-coverage.md`](../agents/roadmaps/archive/road-to-mcp-full-coverage.md)
73
73
  Phase 3 (Selective Implementation) shipped.
74
74
  - **Notes:** **Do not submit before the gate.** Premature listing
75
75
  produces a bad first impression and is hard to retract.
@@ -165,5 +165,5 @@ loop.
165
165
  § "External distribution (human-gated, not agent-executable)" —
166
166
  sibling roadmap. H4 (Medium / CFP) and H5 (screencasts) are
167
167
  `[-]` cancelled there with back-references to the entries above.
168
- - [`agents/roadmaps/road-to-mcp-full-coverage.md`](../agents/roadmaps/road-to-mcp-full-coverage.md)
168
+ - [`agents/roadmaps/road-to-mcp-full-coverage.md`](../agents/roadmaps/archive/road-to-mcp-full-coverage.md)
169
169
  Phase 3 — pre-condition for the Smithery item.
package/docs/catalog.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # agent-config — Public Catalog
2
2
 
3
- Consumer-facing catalog of all **405 public artefacts** shipped by
3
+ Consumer-facing catalog of all **406 public artefacts** shipped by
4
4
  this package. Internal package-maintenance rules and deprecation shims
5
5
  are excluded.
6
6
 
@@ -248,7 +248,7 @@ are excluded.
248
248
  | rule | [`user-interaction`](../.agent-src/rules/user-interaction.md) | auto | Asking the user a question, presenting options, or summarizing progress — numbered-options Iron Law, single-recommendation rule, progress indicators |
249
249
  | rule | [`verify-before-complete`](../.agent-src/rules/verify-before-complete.md) | always | Verify before completion — run tests and quality tools before claiming done |
250
250
 
251
- ## Commands (105)
251
+ ## Commands (106)
252
252
 
253
253
  | kind | name | cluster | description |
254
254
  |---|---|---|---|
@@ -349,7 +349,8 @@ are excluded.
349
349
  | command | [`rule-compliance-audit`](../.agent-src/commands/rule-compliance-audit.md) | | Audit rule trigger quality, simulate activation, detect overlaps, and find never-activating rules |
350
350
  | command | [`set-cost-profile`](../.agent-src/commands/set-cost-profile.md) | | Change the cost_profile in .agent-settings.yml — shows each profile's meaning and applies the selection |
351
351
  | command | [`sync-agent-settings`](../.agent-src/commands/sync-agent-settings.md) | | Sync `.agent-settings.yml` against the current template + profile — adds new sections/keys, preserves user values, shows a diff before writing |
352
- | command | [`sync-gitignore`](../.agent-src/commands/sync-gitignore.md) | | Sync the `event4u/agent-config` block in the consumer project's .gitignore adds missing entries, preserves user-added lines, shows a diff before writing |
352
+ | command | [`sync-gitignore:fix`](../.agent-src/commands/sync-gitignore/fix.md) | cluster: sync-gitignore | Scrub legacy pre-`/agents/` patterns from the consumer's .gitignore (inside or outside the managed block) and re-sync the canonical entries |
353
+ | command | [`sync-gitignore`](../.agent-src/commands/sync-gitignore.md) | cluster: sync-gitignore | Sync the `event4u/agent-config` block in the consumer project's .gitignore — adds missing entries, preserves user-added lines, shows a diff before writing |
353
354
  | command | [`tests:create`](../.agent-src/commands/tests/create.md) | cluster: tests | Write meaningful tests for the changes in the current branch |
354
355
  | command | [`tests:execute`](../.agent-src/commands/tests/execute.md) | cluster: tests | Run PHP tests inside the Docker container |
355
356
  | command | [`tests`](../.agent-src/commands/tests.md) | cluster: tests | Tests orchestrator — routes to create, execute |
@@ -591,6 +591,12 @@
591
591
  "load_context": [],
592
592
  "load_context_eager": []
593
593
  },
594
+ ".agent-src.uncompressed/commands/sync-gitignore/fix.md": {
595
+ "kind": "command",
596
+ "rule_type": null,
597
+ "load_context": [],
598
+ "load_context_eager": []
599
+ },
594
600
  ".agent-src.uncompressed/commands/tests.md": {
595
601
  "kind": "command",
596
602
  "rule_type": null,
@@ -4075,6 +4081,27 @@
4075
4081
  "via": "self",
4076
4082
  "depth": 0
4077
4083
  },
4084
+ {
4085
+ "source": ".agent-src.uncompressed/commands/sync-gitignore.md",
4086
+ "target": ".agent-src.uncompressed/commands/sync-gitignore/fix.md",
4087
+ "type": "READ_ONLY",
4088
+ "via": "body_link",
4089
+ "depth": 1
4090
+ },
4091
+ {
4092
+ "source": ".agent-src.uncompressed/commands/sync-gitignore/fix.md",
4093
+ "target": ".agent-src.uncompressed/commands/sync-gitignore.md",
4094
+ "type": "READ_ONLY",
4095
+ "via": "body_link",
4096
+ "depth": 1
4097
+ },
4098
+ {
4099
+ "source": ".agent-src.uncompressed/commands/sync-gitignore/fix.md",
4100
+ "target": ".agent-src.uncompressed/commands/sync-gitignore/fix.md",
4101
+ "type": "WRITE",
4102
+ "via": "self",
4103
+ "depth": 0
4104
+ },
4078
4105
  {
4079
4106
  "source": ".agent-src.uncompressed/commands/tests.md",
4080
4107
  "target": ".agent-src.uncompressed/commands/tests.md",
@@ -0,0 +1,60 @@
1
+ ---
2
+ stability: experimental
3
+ ---
4
+
5
+ # MCP Discovery-Phase Notice
6
+
7
+ **Audience:** MCP consumers integrating with `event4u/agent-config` — host
8
+ applications, CLIs, agents calling our stdio server or the Cloudflare Worker.
9
+ **Status:** active under the Discovery-First MCP coverage strategy
10
+ ([`mcp-coverage-strategy.md`](../../agents/contexts/mcp-coverage-strategy.md)).
11
+
12
+ ## What you will see
13
+
14
+ `tools/list` advertises ~20 tools. Most return a `not_implemented` envelope when
15
+ called — wire shape in [`mcp-tool-stub-envelope`](mcp-tool-stub-envelope.md).
16
+ This is intentional. Phase 1 is *discovery*: every call — implemented, stub, or
17
+ unknown — is logged so Phase 2's implementation cut is derived from real
18
+ consumer behaviour, not guesses.
19
+
20
+ ## What we need from you
21
+
22
+ **Keep calling the tools you would naturally call.** A call against a stub is
23
+ not a failed integration; it is a vote. Telemetry records carry
24
+ `{tool_name, client_id_hash, ts, transport, outcome}` — no payload bodies, no
25
+ raw identifiers (J4 in the roadmap). Three outcomes are logged:
26
+
27
+ - `implemented` — a real handler ran.
28
+ - `stub` — catalog entry, no transport handler; you received the envelope.
29
+ - `latent_demand` — name not in the catalog at all. **The most valuable
30
+ signal.** If you want a tool that does not exist, call it — do not work
31
+ around the absence silently.
32
+
33
+ ## How to verify telemetry is flowing
34
+
35
+ On any host running the stdio server:
36
+
37
+ ```bash
38
+ python3 scripts/mcp_telemetry_health.py
39
+ ```
40
+
41
+ Healthy → exit 0 with the 24 h count. Silent → exit 1; treat as an alert.
42
+ Wire it into Sentry, a GitHub Actions cron, a mailer, or `launchd` — whatever
43
+ you already trust. Worker telemetry lands in Cloudflare Workers Logs
44
+ (structured `mcp.telemetry` lines); query via the dashboard or `wrangler tail`.
45
+
46
+ ## Phase 1 → Phase 2 gate
47
+
48
+ When the gate fires (≥ 4 weeks of healthy telemetry, ≥ 500 logged attempts,
49
+ ≥ 50 distinct `client_id_hash` values), the council ranks tools by demand and
50
+ picks the implementation cut. Tools above the line move from stub → real;
51
+ tools below stay stubbed and may be removed. Silent windows ≥ 24 h refuse the
52
+ K3 gate and restart the observation period — that is why the healthcheck
53
+ output matters.
54
+
55
+ ## Contact
56
+
57
+ Open an issue against
58
+ [`event4u-app/agent-config`](https://github.com/event4u-app/agent-config) with
59
+ the `mcp-discovery` label if a call returns something other than the documented
60
+ envelope or if `latent_demand` is not landing for a tool you call.
@@ -0,0 +1,78 @@
1
+ ---
2
+ stability: experimental
3
+ ---
4
+
5
+ # MCP Tool Stub Envelope — Phase 1 Discovery Contract
6
+
7
+ > **Status:** Active · governs the Discovery-First MCP coverage strategy
8
+ > ([`mcp-coverage-strategy.md`](../../agents/contexts/mcp-coverage-strategy.md)).
9
+ > **Stability:** experimental — internal index reference only per
10
+ > `STABILITY.md`.
11
+
12
+ ## Purpose
13
+
14
+ Locks the wire shape of the `not_implemented` envelope returned by
15
+ `tools/call` when a consumer agent invokes a catalog entry that has no
16
+ implementation on the active transport. Every denied call returns a
17
+ structured payload with a recovery hint, never a silent 404 and never
18
+ a 500.
19
+
20
+ ## Source of truth
21
+
22
+ `scripts/mcp_server/consumer_tool_catalog.json` (schema_version 1).
23
+ Both the stdio server and the Cloud Worker bundle (`workers/mcp/`,
24
+ packed by `scripts/pack_mcp_content.py`) read from this file. The
25
+ manifest returned by `tools/list` is byte-identical apart from
26
+ per-tool `implemented_on` metadata.
27
+
28
+ ## Catalog entry
29
+
30
+ ```json
31
+ {
32
+ "name": "<snake_case>",
33
+ "description": "<≤500 chars; agent-facing>",
34
+ "side_effect": "ro | fs-write | shell",
35
+ "implemented_on": ["stdio"],
36
+ "input_schema": { "type": "object", "...": "JSON Schema draft-7" }
37
+ }
38
+ ```
39
+
40
+ `implemented_on` lists transports where a real handler is wired;
41
+ missing transports return the envelope.
42
+
43
+ ## Envelope wire shape
44
+
45
+ ```json
46
+ {
47
+ "code": "not_implemented",
48
+ "tool": "<catalog name>",
49
+ "transport": "stdio | worker",
50
+ "install_hint": "<copyable shell command>",
51
+ "alternative": "stdio",
52
+ "message": "<one-sentence explainer>"
53
+ }
54
+ ```
55
+
56
+ Stdio returns this as the JSON-RPC `result` (SDK wraps in
57
+ `TextContent`); the Worker returns it as `error.data` alongside
58
+ `code: -32601`. Field invariants: `code` is the frozen literal
59
+ `not_implemented`; `tool` echoes the caller; `transport` is set per
60
+ surface; `install_hint` comes from the catalog's `install_hint_stdio`
61
+ field; `alternative` is the frozen literal `stdio` until Phase 3.
62
+ Consumer agents must drive logic from `code`, not `message`.
63
+
64
+ ## Unknown-tool / latent-demand path
65
+
66
+ A call to a name not in the catalog returns JSON-RPC error `-32601`
67
+ with the same envelope shape, `code: "unknown_tool"`. Both transports
68
+ log the attempt with `outcome: "latent_demand"` so Phase 2 can
69
+ promote unforeseen names.
70
+
71
+ ## Acceptance
72
+
73
+ - Both transports return `code == "not_implemented"` for every
74
+ catalog entry whose `implemented_on` excludes the transport.
75
+ - Both transports return `code == "unknown_tool"` for any name not in
76
+ the catalog.
77
+ - Schema version bumps on any incompatible field rename; new optional
78
+ fields are compatible.
@@ -153,7 +153,7 @@ Your agent now understands slash commands:
153
153
  | `/quality-fix` | Run and fix all quality checks |
154
154
  | `/chat-history` | Inspect the persistent chat-history log (read-only `show`) |
155
155
 
156
- → [Browse all 105 active commands](../.agent-src/commands/)
156
+ → [Browse all 106 active commands](../.agent-src/commands/)
157
157
 
158
158
  ---
159
159
 
@@ -1,8 +1,17 @@
1
- # MCP Client Config — Remote agent-config
1
+ # MCP Client Config — Self-hosted agent-config Worker
2
2
 
3
- Connect any MCP-capable client to the hosted `agent-config-mcp` Worker
4
- at `https://agent-config-mcp.event4u.workers.dev`. Read-only,
5
- identity-stable per release, no auth.
3
+ Connect any MCP-capable client to your own `agent-config-mcp` Cloudflare
4
+ Worker. Read-only, identity-stable per release. Optional Bearer-token
5
+ auth see Bearer auth](#bearer-auth) below.
6
+
7
+ > **No public endpoint.** This package ships the Worker source under
8
+ > `workers/mcp/`, but does **not** operate a shared hosted MCP server.
9
+ > Deploy your own per [`mcp-cloud-setup.md`](mcp-cloud-setup.md) — your
10
+ > URL will be `https://agent-config-mcp.<your-account>.workers.dev`
11
+ > (or a custom domain you wire up in Step 7).
12
+ >
13
+ > In every snippet below, **replace `https://your-worker.workers.dev`
14
+ > with your actual deployment URL**.
6
15
 
7
16
  For URL shapes (latest vs. pinned `/v<X.Y.Z>`) see
8
17
  [`mcp-cloud-endpoints.md`](mcp-cloud-endpoints.md). For operator
@@ -26,14 +35,29 @@ look for MCP server config inside `.agent-settings.yml`.
26
35
  | MCP client config (this page) | client-specific path per section above | the MCP client at startup | which MCP servers to talk to (name + URL / command) |
27
36
  | `.agent-settings.yml` | consumer project root (`<repo>/.agent-settings.yml`) | the agent at runtime (Claude / Cursor / …) | per-developer preferences: `name`, `ide`, `cost_profile`, `personal.autonomy`, `pipelines.skill_improvement`, `caveman.speak_scope`, … |
28
37
 
29
- The hosted MCP is **stateless** and **project-agnostic** — it serves
30
- the same skill / rule / command catalog to every client. Personalization
38
+ The Worker is **stateless** and **project-agnostic** — it serves the
39
+ same skill / rule / command catalog to every client. Personalization
31
40
  happens agent-side after the MCP delivers its content blob; the Worker
32
41
  itself does not read `.agent-settings.yml`.
33
42
 
34
43
  First-time setup of `.agent-settings.yml` runs through `/onboard`;
35
44
  template drift is handled by `/sync-agent-settings`.
36
45
 
46
+ ## Bearer auth
47
+
48
+ If you set the `MCP-Token` secret on your Worker (via
49
+ `task mcp:cloud:secret-put`), every POST request must carry the header
50
+ `Authorization: Bearer <token>`. The `GET /` liveness probe stays
51
+ unauthenticated.
52
+
53
+ Add the header to each client below by appending the per-client header
54
+ snippet shown in its section. Treat the token like any other secret —
55
+ keep it out of repo files and shared dotfiles; prefer an env var
56
+ (`MCP_TOKEN`) sourced from a password manager or shell init.
57
+
58
+ If your Worker has **no** `MCP-Token` secret set, skip the header
59
+ snippets — every POST is accepted as-is.
60
+
37
61
  ## Claude Desktop
38
62
 
39
63
  Edit `~/Library/Application Support/Claude/claude_desktop_config.json`
@@ -44,7 +68,24 @@ Edit `~/Library/Application Support/Claude/claude_desktop_config.json`
44
68
  "mcpServers": {
45
69
  "agent-config": {
46
70
  "command": "npx",
47
- "args": ["-y", "mcp-remote", "https://agent-config-mcp.event4u.workers.dev"]
71
+ "args": ["-y", "mcp-remote", "https://your-worker.workers.dev"]
72
+ }
73
+ }
74
+ }
75
+ ```
76
+
77
+ With Bearer auth, add `--header`:
78
+
79
+ ```json
80
+ {
81
+ "mcpServers": {
82
+ "agent-config": {
83
+ "command": "npx",
84
+ "args": [
85
+ "-y", "mcp-remote", "https://your-worker.workers.dev",
86
+ "--header", "Authorization: Bearer ${MCP_TOKEN}"
87
+ ],
88
+ "env": { "MCP_TOKEN": "paste-token-here" }
48
89
  }
49
90
  }
50
91
  }
@@ -60,7 +101,14 @@ Connector** with the URL directly — no `mcp-remote` wrapper needed.
60
101
  Native HTTP transport — one command:
61
102
 
62
103
  ```bash
63
- claude mcp add --transport http agent-config https://agent-config-mcp.event4u.workers.dev
104
+ claude mcp add --transport http agent-config https://your-worker.workers.dev
105
+ ```
106
+
107
+ With Bearer auth:
108
+
109
+ ```bash
110
+
111
+
64
112
  ```
65
113
 
66
114
  Verify:
@@ -78,12 +126,14 @@ claude mcp list
78
126
  {
79
127
  "mcpServers": {
80
128
  "agent-config": {
81
- "url": "https://agent-config-mcp.event4u.workers.dev"
129
+ "url": "https://your-worker.workers.dev",
130
+ "headers": { "Authorization": "Bearer paste-token-here" }
82
131
  }
83
132
  }
84
133
  }
85
134
  ```
86
135
 
136
+ (Omit the `headers` block if your Worker has no `MCP-Token` secret.)
87
137
  Reload Cursor (`Cmd+Shift+P → Reload Window`).
88
138
 
89
139
  ## Zed
@@ -96,12 +146,17 @@ Reload Cursor (`Cmd+Shift+P → Reload Window`).
96
146
  "agent-config": {
97
147
  "source": "custom",
98
148
  "command": "npx",
99
- "args": ["-y", "mcp-remote", "https://agent-config-mcp.event4u.workers.dev"]
149
+ "args": [
150
+ "-y", "mcp-remote", "https://your-worker.workers.dev",
151
+ "--header", "Authorization: Bearer ${MCP_TOKEN}"
152
+ ],
153
+ "env": { "MCP_TOKEN": "paste-token-here" }
100
154
  }
101
155
  }
102
156
  }
103
157
  ```
104
158
 
159
+ Drop the `--header` / `env` pair when the Worker has no token set.
105
160
  Zed has no native remote-MCP transport yet, so the `mcp-remote`
106
161
  bridge is required.
107
162
 
@@ -113,19 +168,28 @@ bridge is required.
113
168
  mcpServers:
114
169
  - name: agent-config
115
170
  command: npx
116
- args: ["-y", "mcp-remote", "https://agent-config-mcp.event4u.workers.dev"]
171
+ args:
172
+ - "-y"
173
+ - mcp-remote
174
+ - https://your-worker.workers.dev
175
+ - --header
176
+ - "Authorization: Bearer ${MCP_TOKEN}"
177
+ env:
178
+ MCP_TOKEN: paste-token-here
117
179
  ```
118
180
 
181
+ Drop the `--header` / `env` keys when the Worker has no token set.
182
+
119
183
  ## Verify
120
184
 
121
185
  After reload, every client should:
122
186
 
123
187
  1. List `agent-config` under connectors / tools with a release-key
124
188
  matching the live deploy. Probe the endpoint to see the current
125
- release:
189
+ release (the `GET /` liveness probe is always unauthenticated):
126
190
 
127
191
  ```bash
128
- curl https://agent-config-mcp.event4u.workers.dev
192
+ curl https://your-worker.workers.dev
129
193
  # → { "ok": true, "release_key": "v…", "signature": "…", … }
130
194
  ```
131
195
 
@@ -134,6 +198,23 @@ After reload, every client should:
134
198
  3. Expose rule + guideline + context resources under `rule://…`,
135
199
  `guideline://…`, `context://…`.
136
200
 
201
+ With Bearer auth, a wrong/missing token returns HTTP 401 with body
202
+ `{"jsonrpc":"2.0","id":null,"error":{"code":-32001,"message":"Unauthorized"}}` —
203
+ quick way to confirm enforcement:
204
+
205
+ ```bash
206
+ curl -X POST -H "content-type: application/json" \
207
+ -d '{"jsonrpc":"2.0","id":1,"method":"ping"}' \
208
+ https://your-worker.workers.dev
209
+ # → 401 Unauthorized
210
+
211
+ curl -X POST -H "content-type: application/json" \
212
+ -H "Authorization: Bearer $MCP_TOKEN" \
213
+ -d '{"jsonrpc":"2.0","id":1,"method":"ping"}' \
214
+ https://your-worker.workers.dev
215
+ # → 200 { "jsonrpc":"2.0","id":1,"result":{} }
216
+ ```
217
+
137
218
  If the client shows the connector but no prompts / resources,
138
219
  re-probe the URL — a 5xx from the Worker indicates the deploy is
139
220
  mid-roll, retry after a minute.
@@ -15,6 +15,7 @@ machine.
15
15
  ```sh
16
16
  task mcp:cloud:login # one-time, opens browser
17
17
  task mcp:cloud:setup # check → r2-create → r2-verify → whoami
18
+ task mcp:cloud:secret-put # optional but recommended — sets MCP-Token (Bearer auth)
18
19
  # Copy account id from output → GitHub Secrets (see § GitHub Secrets)
19
20
  # Create scoped API token (see § API Token) → GitHub Secrets
20
21
  # Done. First `release: published` triggers the deploy.
@@ -114,7 +115,36 @@ Green smoke step → `latest.txt` repoints → release is live on
114
115
  `*.workers.dev`. A red smoke step leaves `latest.txt` on the previous
115
116
  release.
116
117
 
117
- ## Step 7 — DNS (optional, Phase 5.2)
118
+ ## Step 7 — Bearer auth (recommended)
119
+
120
+ Without auth, anyone who knows your `*.workers.dev` URL can read the
121
+ catalog. The Worker checks for an `MCP-Token` secret and, when set,
122
+ gates every POST behind `Authorization: Bearer <token>`. The `GET /`
123
+ liveness probe stays open so health checks keep working.
124
+
125
+ Generate a token (any high-entropy random string — `openssl rand -hex 32`
126
+ or your password manager) and set it on the Worker:
127
+
128
+ ```sh
129
+ task mcp:cloud:secret-put
130
+ # wrangler prompts for the value interactively (stdin) — never passed
131
+ # via argv, never written to shell history.
132
+ ```
133
+
134
+ This wraps `npx wrangler secret put MCP-Token --name agent-config-mcp`.
135
+ The secret is encrypted in Cloudflare and injected as `env["MCP-Token"]`
136
+ at request time; the source repo never sees the value.
137
+
138
+ Once set, every MCP client config needs the header — per-client
139
+ snippets (Claude Desktop, Claude Code, Cursor, Zed, Continue) live in
140
+ [`mcp-client-config.md`](mcp-client-config.md) § Bearer auth.
141
+
142
+ Rotate by re-running `task mcp:cloud:secret-put` with a fresh value;
143
+ the new secret takes effect on the next request (no redeploy needed).
144
+ To remove auth entirely, run
145
+ `npx wrangler secret delete MCP-Token --name agent-config-mcp`.
146
+
147
+ ## Step 8 — DNS (optional, Phase 5.2)
118
148
 
119
149
  Custom domain `mcp.<your-domain>` setup lives in
120
150
  [`docs/setup/mcp-cloud-endpoints.md`](mcp-cloud-endpoints.md) § DNS
@@ -141,6 +171,7 @@ setup. Until cutover, the Worker serves on the free
141
171
  | `task mcp:cloud:r2-create` | Create R2 bucket (idempotent) |
142
172
  | `task mcp:cloud:r2-verify` | Verify R2 bucket exists |
143
173
  | `task mcp:cloud:setup` | Full chain — check → r2 → whoami |
174
+ | `task mcp:cloud:secret-put` | Set the `MCP-Token` Bearer-auth secret (interactive) |
144
175
  | `task mcp:cloud:dev` | Local `wrangler dev` on :8787 |
145
176
  | `task mcp:cloud:deploy-dispatch TAG=v…` | Manual workflow trigger |
146
177