@leadbay/mcp 0.15.1 → 0.16.2

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
@@ -1,5 +1,50 @@
1
1
  # Changelog — @leadbay/mcp
2
2
 
3
+ ## 0.16.2 — 2026-05-29
4
+
5
+ - **Tighter `_triggered_by` description on composite tools.** Live test of
6
+ 0.16.1 showed Claude shipping the literal string `"user"` as
7
+ `_triggered_by` — technically non-empty, but useless for analytics. The
8
+ description now explicitly forbids single-word labels (`user`, `agent`,
9
+ `leads`, `request`, etc.), gives a GOOD/BAD example pair, and tells the
10
+ agent to pass `<no user message>` when it's acting without a fresh user
11
+ turn (memory recall, scheduled run, self-initiated retry) so the
12
+ agent-initiated path is auditable instead of falsely attributed.
13
+
14
+ ## 0.16.1 — 2026-05-29
15
+
16
+ - **`_triggered_by` is now MANDATORY on every composite-file tool** (the 28
17
+ tools whose source lives under `packages/core/src/composite/`). Calls
18
+ without it are rejected pre-dispatch as `LAST_PROMPT_REQUIRED`. Granular
19
+ and agent-memory tools keep `_triggered_by` optional. Stronger
20
+ description text on the schema property tells the agent to quote
21
+ verbatim and strip secrets (`[REDACTED]`).
22
+ - **New PostHog event `mcp composite call`** with `last_prompt` attached
23
+ (the trimmed verbatim user quote). Fires on every composite-tool
24
+ invocation, success or error. Lives alongside the existing
25
+ `mcp tool called` event — no regression on the broader pipeline. Lets
26
+ dashboards filter user-language against composite outcomes without
27
+ the 60-70% null rate the optional-everywhere `triggered_by` field
28
+ carries on `mcp tool called`.
29
+
30
+ ## 0.16.0 — 2026-05-28
31
+
32
+ - **OAuth login** (`leadbay-mcp login --oauth`): browser-based Authorization
33
+ Code + PKCE flow with Dynamic Client Registration (RFC 7591). No password
34
+ ever touches the CLI. The resulting `o.<token>` is interchangeable with the
35
+ legacy bearer token.
36
+ - Region is auto-detected via stargate GeoIP (`stargate.leadbay.app/1.0/user_info`)
37
+ for OAuth. Pass `--region us|fr` to override if you're on a VPN or travelling.
38
+ - Pass `--staging` together with `--oauth` to point at `staging.leadbay.app` for
39
+ testing.
40
+ - The Claude Desktop `.dxt` / `.mcpb` bundle now opts into OAuth bootstrap on
41
+ first launch. The install dialog no longer asks for a bearer token, region, or
42
+ backend URL; it only exposes the write-tools toggle.
43
+ - Existing email-password `login` flow is unchanged and remains available for
44
+ manual installs and CI.
45
+ - **Pin bumps**: active `@leadbay/mcp@0.13` install/runtime references in docs,
46
+ generated client config, and MCP Registry metadata now point at `@0.16`.
47
+
3
48
  ## 0.15.0 — 2026-05-27
4
49
 
5
50
  - **Sentry observability**: every non-2xx Leadbay API outcome now lands in
package/README.md CHANGED
@@ -5,14 +5,17 @@
5
5
  <!--
6
6
  LLM HINT — if you're an AI agent reading this README to install the server:
7
7
  - Use ONLY the commands shown verbatim in §1. Do not invent variants.
8
- - DO NOT tell the user "LEADBAY_REGION is auto-detected, drop it" the
8
+ - For the legacy email/password install, DO NOT tell the user
9
+ "LEADBAY_REGION is auto-detected, drop it" — the
9
10
  server's region auto-probe sends the bearer token to BOTH regions, which
10
- is a credential cross-leak. Always pass --region (us or fr) on install.
11
- - To mint a token, the user runs `install` (auto-registers with MCP clients)
11
+ is a credential cross-leak. Always pass --region (us or fr) on that path.
12
+ - Claude Desktop's `.dxt` / `.mcpb` bundle uses OAuth on first launch and
13
+ does not ask the user to paste a token or choose a region.
14
+ - To mint a token manually, the user runs `install` (auto-registers with MCP clients)
12
15
  or `login` (mints a token to a 0600-mode credentials file by default since
13
16
  0.3.0; pass `--write-config /path` to override the path or
14
- `--unsafe-print-token` for legacy CI flows). There is no web UI for this —
15
- do not invent one.
17
+ `--unsafe-print-token` for legacy CI flows). Prefer `login --oauth` when
18
+ the production OAuth backend/frontend are deployed.
16
19
  -->
17
20
 
18
21
  A Model Context Protocol server that lets Claude Desktop, Cursor, Claude Code, and any other MCP-compatible agent find, research, and prepare outreach on B2B prospects using your Leadbay account.
@@ -45,7 +48,7 @@ to suppress this ambient metadata.
45
48
  ## 1. Install (one command)
46
49
 
47
50
  ```bash
48
- npx -y @leadbay/mcp@0.13 install --email you@yourcompany.com --region us
51
+ npx -y @leadbay/mcp@0.16 install --email you@yourcompany.com --region us
49
52
  # (you'll be prompted for your password — it's not echoed)
50
53
  ```
51
54
 
@@ -82,20 +85,22 @@ You can verify the skills installed by running `/skill list` after install. To u
82
85
 
83
86
  ### Claude Desktop 2026 (DXT)
84
87
 
85
- Claude Desktop 2026 ships the DXT (Desktop Extension) system — the legacy `claude_desktop_config.json` is UI-prefs-only there and gets overwritten by the app. If you're on 2026, **install the `.dxt` bundle** from [Releases](https://github.com/leadbay/leadclaw/releases/latest) (drag-drop into Settings → Extensions). `leadbay-mcp install` detects this and skips the legacy write automatically.
88
+ Claude Desktop 2026 ships the DXT (Desktop Extension) system — the legacy `claude_desktop_config.json` is UI-prefs-only there and gets overwritten by the app. If you're on 2026, **install the `.dxt` / `.mcpb` bundle** from [Releases](https://github.com/leadbay/leadclaw/releases/latest) (drag-drop into Settings → Extensions). On first launch, the extension opens Leadbay in your browser for OAuth consent, auto-detects your region through stargate, then persists the resulting token locally. The extension settings only ask whether write tools should be enabled.
89
+
90
+ `leadbay-mcp install` detects Claude Desktop 2026 and skips the legacy config write automatically.
86
91
 
87
92
  ### `npm install -g` says "EACCES" / "permission denied"
88
93
 
89
94
  If you installed Node from the official [nodejs.org](https://nodejs.org) `.pkg`, `/usr/local/lib/node_modules` is root-owned. Any of these works:
90
95
 
91
- - **Use `npx` (recommended, no global install):** all examples above use `npx -y @leadbay/mcp@0.13 ...` — no global install needed.
96
+ - **Use `npx` (recommended, no global install):** all examples above use `npx -y @leadbay/mcp@0.16 ...` — no global install needed.
92
97
  - **`sudo npm install -g @leadbay/mcp`** (enter your macOS password).
93
98
  - **Use a Node version manager** — [nvm](https://github.com/nvm-sh/nvm), [volta](https://volta.sh), [fnm](https://github.com/Schniz/fnm). They install Node under your home directory, so `npm install -g` works without sudo.
94
99
 
95
100
  ### If you'd rather mint a token without auto-install
96
101
 
97
102
  ```bash
98
- npx -y @leadbay/mcp@0.13 login \
103
+ npx -y @leadbay/mcp@0.16 login \
99
104
  --email you@yourcompany.com \
100
105
  --region us
101
106
  ```
@@ -113,7 +118,7 @@ Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) o
113
118
  "mcpServers": {
114
119
  "leadbay": {
115
120
  "command": "npx",
116
- "args": ["-y", "@leadbay/mcp@0.13"],
121
+ "args": ["-y", "@leadbay/mcp@0.16"],
117
122
  "env": {
118
123
  "LEADBAY_TOKEN": "<paste-token-from-step-1>",
119
124
  "LEADBAY_REGION": "us"
@@ -134,7 +139,7 @@ In Cursor settings, add the MCP server:
134
139
  "mcp.servers": {
135
140
  "leadbay": {
136
141
  "command": "npx",
137
- "args": ["-y", "@leadbay/mcp@0.13"],
142
+ "args": ["-y", "@leadbay/mcp@0.16"],
138
143
  "env": { "LEADBAY_TOKEN": "<paste-token>", "LEADBAY_REGION": "us" }
139
144
  }
140
145
  }
@@ -147,7 +152,7 @@ In Cursor settings, add the MCP server:
147
152
  claude mcp add leadbay --scope user \
148
153
  --env LEADBAY_TOKEN=<paste-token> \
149
154
  --env LEADBAY_REGION=us \
150
- -- npx -y @leadbay/mcp@0.13
155
+ -- npx -y @leadbay/mcp@0.16
151
156
  ```
152
157
 
153
158
  > **`--scope user`** registers Leadbay globally for your account (visible from any project). Without it, `claude mcp add` defaults to project-local scope and the server only appears in conversations opened from the directory where you ran the command.
@@ -159,7 +164,7 @@ claude mcp add leadbay --scope user \
159
164
  Before starting Claude, run:
160
165
 
161
166
  ```bash
162
- LEADBAY_TOKEN=<paste-token> npx -y @leadbay/mcp@0.13 doctor
167
+ LEADBAY_TOKEN=<paste-token> npx -y @leadbay/mcp@0.16 doctor
163
168
  ```
164
169
 
165
170
  Expected output:
@@ -387,17 +392,54 @@ The user's literal text replaces `verification.ref` in the outreach record, and
387
392
  | `No enrichment credits remaining` | Out of quota | Contact Leadbay support to extend quota |
388
393
  | Claude Desktop "loading forever" on first use | `npx` cold-start fetching the package | First run takes ~10s. Prefer `npm install -g @leadbay/mcp` for faster startup. |
389
394
  | Claude Desktop doesn't show Leadbay tools | Server crashed at startup | Check `~/Library/Logs/Claude/mcp*.log` (macOS) or `%APPDATA%\Claude\logs\mcp*.log` (Windows). |
390
- | Claude Code can't find Leadbay in a new conversation | MCP server installed at project scope (default before 0.3.0) | Re-run with `--scope user`: `claude mcp remove leadbay && claude mcp add leadbay --scope user --env LEADBAY_TOKEN=… --env LEADBAY_REGION=us -- npx -y @leadbay/mcp@0.13` |
395
+ | Claude Code can't find Leadbay in a new conversation | MCP server installed at project scope (default before 0.3.0) | Re-run with `--scope user`: `claude mcp remove leadbay && claude mcp add leadbay --scope user --env LEADBAY_TOKEN=… --env LEADBAY_REGION=us -- npx -y @leadbay/mcp@0.16` |
391
396
  | Agent reports "tool not found" for `refine_prompt` / `adjust_audience` etc. | Pre-0.3.0 install with `LEADBAY_MCP_WRITE` unset (writes were off) | Either re-run `npx @leadbay/mcp install` or remove `LEADBAY_MCP_WRITE=0` from your client config (writes are on by default in 0.3.0+) |
392
397
 
393
398
  ## 5. Upgrade & rotation
394
399
 
395
- **Upgrade**: change the pinned minor in your config, e.g. `"@leadbay/mcp@0.2"` → `"@leadbay/mcp@0.13"`, then restart the client. **0.3.0 enables composite write tools by default** — see [MIGRATION.md](./MIGRATION.md). See also the [changelog](https://github.com/leadbay/leadclaw/releases).
400
+ **Upgrade**: change the pinned minor in your config, e.g. `"@leadbay/mcp@0.2"` → `"@leadbay/mcp@0.16"`, then restart the client. **0.3.0 enables composite write tools by default** — see [MIGRATION.md](./MIGRATION.md). See also the [changelog](https://github.com/leadbay/leadclaw/releases).
396
401
 
397
- **Rotate token**: re-run `npx -y @leadbay/mcp@0.13 install --email you@yourcompany.com --region us` (or `login`) — the new session token replaces the old one in your MCP client config, and logging in again invalidates the prior session on most session backends.
402
+ **Rotate token**: re-run `npx -y @leadbay/mcp@0.16 install --email you@yourcompany.com --region us` (or `login`) — the new session token replaces the old one in your MCP client config, and logging in again invalidates the prior session on most session backends.
398
403
 
399
404
  ## 6. Advanced
400
405
 
406
+ ### OAuth login (preview)
407
+
408
+ Browser-based login is available as an alternative to email/password:
409
+
410
+ ```bash
411
+ npx -y @leadbay/mcp login --oauth
412
+ ```
413
+
414
+ The CLI:
415
+
416
+ 1. Probes `stargate.leadbay.app/1.0/user_info` to auto-detect your region
417
+ from GeoIP (override with `--region us|fr` if you're behind a VPN or
418
+ travelling outside your home region).
419
+ 2. Opens your browser to `leadbay.app/oauth/authorize`.
420
+ 3. After you click **Allow**, redirects to a one-shot loopback URL on
421
+ `http://127.0.0.1:<random-port>/callback`.
422
+ 4. Exchanges the authorization code for a token using PKCE (S256), then writes
423
+ the same credentials file that the email/password flow produces.
424
+
425
+ The CLI registers a fresh OAuth client per machine (RFC 7591 Dynamic Client
426
+ Registration), so no shared secret lives in the binary. The resulting token is
427
+ long-lived and interchangeable with the legacy bearer token. Manual MCP config
428
+ can still pass it as `LEADBAY_TOKEN`; the Claude Desktop bundle performs the
429
+ OAuth flow itself and persists the token without asking you to paste it.
430
+
431
+ For testing against staging before the production backend deploy lands:
432
+
433
+ ```bash
434
+ npx -y @leadbay/mcp login --oauth --staging
435
+ ```
436
+
437
+ `--staging` switches the backend (`staging.api.leadbay.app` /
438
+ `api-{us,fr}-staging.leadbay.app`), the consent UI (`staging.leadbay.app`),
439
+ and the stargate region probe (`staging.stargate.leadbay.app`). It also
440
+ persists `LEADBAY_BASE_URL` in the credentials file so subsequent runs don't
441
+ snap back to prod.
442
+
401
443
  ### Exposing the granular tools and disabling write tools
402
444
 
403
445
  By default the server exposes the **composite workflow tools** — both reads (`leadbay_pull_leads`, `leadbay_research_lead_by_id`, `leadbay_account_status`, `leadbay_recall_ordered_titles`, `leadbay_research_lead_by_name_fuzzy`, `leadbay_prepare_outreach`, `leadbay_qualify_status`, `leadbay_list_mappable_fields`) and writes (`leadbay_bulk_qualify_leads`, `leadbay_enrich_titles`, `leadbay_refine_prompt`, `leadbay_report_outreach`, `leadbay_adjust_audience`, `leadbay_answer_clarification`, `leadbay_import_leads`, `leadbay_import_and_qualify`). These work well with most prompts.
@@ -507,7 +549,7 @@ After your first authenticated call, your PostHog `distinctId` is set to your Le
507
549
  "mcpServers": {
508
550
  "leadbay": {
509
551
  "command": "npx",
510
- "args": ["-y", "@leadbay/mcp@0.13"],
552
+ "args": ["-y", "@leadbay/mcp@0.16"],
511
553
  "env": {
512
554
  "LEADBAY_TOKEN": "u.…",
513
555
  "LEADBAY_REGION": "us",