Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .claude-plugin/plugins/leadbay/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
"name": "leadbay",
"version": "0.10.1",
"version": "0.11.0",
"description": "AI lead discovery, qualification, and outreach prep on your Leadbay account.",
"author": {
"name": "Leadbay",
Expand All @@ -15,7 +15,7 @@
"mcpServers": {
"leadbay": {
"command": "npx",
"args": ["-y", "@leadbay/mcp@0.10"],
"args": ["-y", "@leadbay/mcp@0.11"],
"env": {
"LEADBAY_TOKEN": "${user_config.leadbay_token}",
"LEADBAY_REGION": "${user_config.leadbay_region}",
Expand All @@ -27,7 +27,7 @@
"leadbay_token": {
"type": "string",
"title": "Leadbay bearer token",
"description": "Mint with: npx -y @leadbay/mcp@0.10 login --email <you> --region <us|fr>",
"description": "Mint with: npx -y @leadbay/mcp@0.11 login --email <you> --region <us|fr>",
"sensitive": true,
"required": true
},
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Start a conversation — the agent will ask for your Leadbay email and password
### Via MCP (Claude Desktop, Cursor, Cowork, any MCP client)

```bash
npx -y @leadbay/mcp@0.10 install --email you@yourcompany.com --region us
npx -y @leadbay/mcp@0.11 install --email you@yourcompany.com --region us
```

The installer auto-detects which MCP clients you have (Claude Desktop, Cursor, Claude Code), prompts you per-target, and writes the token into each client's config. Add `--no-write` to disable the composite write tools. Full per-client setup, env vars, troubleshooting, and a tour of the MCP primitives is in [`packages/mcp/README.md`](packages/mcp/README.md).
Expand Down
2 changes: 1 addition & 1 deletion packages/dxt/manifest.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"leadbay_token": {
"type": "string",
"title": "Leadbay bearer token",
"description": "Mint one with: npx -y @leadbay/mcp@0.10 login --email <you> --region <us|fr> (then copy LEADBAY_TOKEN from the credentials file the command writes — path is shown on stderr)",
"description": "Mint one with: npx -y @leadbay/mcp@0.11 login --email <you> --region <us|fr> (then copy LEADBAY_TOKEN from the credentials file the command writes — path is shown on stderr)",
"sensitive": true,
"required": true
},
Expand Down
9 changes: 9 additions & 0 deletions packages/mcp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog — @leadbay/mcp

## 0.11.0 — 2026-05-20

In-server auto-update flow: the MCP server now self-polls GitHub releases (24h throttle, ETag-aware, in-flight guarded) and surfaces an `update_available` block on `leadbay_account_status` when a newer version is published — both at boot AND on every tool call, so long-running Claude Desktop sessions still pick up new releases without restart.

- **New tool — `leadbay_acknowledge_update`**: records the user's choice from the `ask_user_input_v0` prompt. `action: 'install'` returns the `.mcpb` download URL (Claude Desktop's native installer opens on click); `'remind_tomorrow'` snoozes 24h; `'skip'` permanently suppresses that version. State persists to `~/.leadbay/update-state.json` (0o600, atomic write, symlink-rejecting; mirrors `bulk-store.ts`).
- **Five new PostHog events** for the funnel + conversion: `mcp_update_check`, `mcp_update_prompted`, `mcp_update_install_clicked`, `mcp_update_dismissed`, `mcp_version_updated` (fires on the next boot under a newer `VERSION` constant — works regardless of how the user upgraded: `.mcpb`, npm, npx).
- **Routing instruction** appended to `buildServerInstructions`: when `update_available` is present on `leadbay_account_status`, the agent prompts via `ask_user_input_v0` with three options and routes the choice through `leadbay_acknowledge_update`. Opt-out: `LEADBAY_UPDATE_CHECK_DISABLED=1`.
- **Pin bumps**: every `@leadbay/mcp@0.10` reference across `bin.ts`, `server.json`, `README.md`, `packages/dxt/manifest.template.json`, `.claude-plugin/.../plugin.json`, and the root `README.md` is now `@0.11`.

## 0.10.1 — 2026-05-20

Documentation + version-pin sweep paired with hardening the release pipeline. No functional changes to the published binary.
Expand Down
22 changes: 11 additions & 11 deletions packages/mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ A Model Context Protocol server that lets Claude Desktop, Cursor, Claude Code, a
## 1. Install (one command)

```bash
npx -y @leadbay/mcp@0.10 install --email you@yourcompany.com --region us
npx -y @leadbay/mcp@0.11 install --email you@yourcompany.com --region us
# (you'll be prompted for your password — it's not echoed)
```

Expand Down Expand Up @@ -67,14 +67,14 @@ Claude Desktop 2026 ships the DXT (Desktop Extension) system — the legacy `cla

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:

- **Use `npx` (recommended, no global install):** all examples above use `npx -y @leadbay/mcp@0.10 ...` — no global install needed.
- **Use `npx` (recommended, no global install):** all examples above use `npx -y @leadbay/mcp@0.11 ...` — no global install needed.
- **`sudo npm install -g @leadbay/mcp`** (enter your macOS password).
- **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.

### If you'd rather mint a token without auto-install

```bash
npx -y @leadbay/mcp@0.10 login \
npx -y @leadbay/mcp@0.11 login \
--email you@yourcompany.com \
--region us
```
Expand All @@ -92,7 +92,7 @@ Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) o
"mcpServers": {
"leadbay": {
"command": "npx",
"args": ["-y", "@leadbay/mcp@0.10"],
"args": ["-y", "@leadbay/mcp@0.11"],
"env": {
"LEADBAY_TOKEN": "<paste-token-from-step-1>",
"LEADBAY_REGION": "us"
Expand All @@ -113,7 +113,7 @@ In Cursor settings, add the MCP server:
"mcp.servers": {
"leadbay": {
"command": "npx",
"args": ["-y", "@leadbay/mcp@0.10"],
"args": ["-y", "@leadbay/mcp@0.11"],
"env": { "LEADBAY_TOKEN": "<paste-token>", "LEADBAY_REGION": "us" }
}
}
Expand All @@ -126,7 +126,7 @@ In Cursor settings, add the MCP server:
claude mcp add leadbay --scope user \
--env LEADBAY_TOKEN=<paste-token> \
--env LEADBAY_REGION=us \
-- npx -y @leadbay/mcp@0.10
-- npx -y @leadbay/mcp@0.11
```

> **`--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.
Expand All @@ -138,7 +138,7 @@ claude mcp add leadbay --scope user \
Before starting Claude, run:

```bash
LEADBAY_TOKEN=<paste-token> npx -y @leadbay/mcp@0.10 doctor
LEADBAY_TOKEN=<paste-token> npx -y @leadbay/mcp@0.11 doctor
```

Expected output:
Expand Down Expand Up @@ -366,14 +366,14 @@ The user's literal text replaces `verification.ref` in the outreach record, and
| `No enrichment credits remaining` | Out of quota | Contact Leadbay support to extend quota |
| 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. |
| 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). |
| 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.10` |
| 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.11` |
| 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+) |

## 5. Upgrade & rotation

**Upgrade**: change the pinned minor in your config, e.g. `"@leadbay/mcp@0.2"` → `"@leadbay/mcp@0.10"`, 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).
**Upgrade**: change the pinned minor in your config, e.g. `"@leadbay/mcp@0.2"` → `"@leadbay/mcp@0.11"`, 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).

**Rotate token**: re-run `npx -y @leadbay/mcp@0.10 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.
**Rotate token**: re-run `npx -y @leadbay/mcp@0.11 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.

## 6. Advanced

Expand Down Expand Up @@ -486,7 +486,7 @@ After your first authenticated call, your PostHog `distinctId` is set to your Le
"mcpServers": {
"leadbay": {
"command": "npx",
"args": ["-y", "@leadbay/mcp@0.10"],
"args": ["-y", "@leadbay/mcp@0.11"],
"env": {
"LEADBAY_TOKEN": "u.…",
"LEADBAY_REGION": "us",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@leadbay/mcp",
"version": "0.10.1",
"version": "0.11.0",
"mcpName": "io.github.leadbay/leadbay-mcp",
"description": "Model Context Protocol (MCP) server for Leadbay — AI lead discovery, qualification, and enrichment for Claude Desktop, Cursor, and Claude Code.",
"type": "module",
Expand Down
8 changes: 4 additions & 4 deletions packages/mcp/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "io.github.leadbay/leadbay-mcp",
"title": "Leadbay",
"description": "AI lead discovery, qualification, and outreach prep on your Leadbay account.",
"version": "0.10.1",
"version": "0.11.0",
"repository": {
"url": "https://github.com/leadbay/leadclaw",
"source": "github",
Expand All @@ -15,7 +15,7 @@
"registryType": "npm",
"registryBaseUrl": "https://registry.npmjs.org",
"identifier": "@leadbay/mcp",
"version": "0.10.1",
"version": "0.11.0",
"transport": {
"type": "stdio"
},
Expand All @@ -27,13 +27,13 @@
},
{
"type": "positional",
"value": "@leadbay/mcp@0.10"
"value": "@leadbay/mcp@0.11"
}
],
"environmentVariables": [
{
"name": "LEADBAY_TOKEN",
"description": "Bearer token; mint with `npx -y @leadbay/mcp@0.10 login --email <you> --region <us|fr>`.",
"description": "Bearer token; mint with `npx -y @leadbay/mcp@0.11 login --email <you> --region <us|fr>`.",
"isRequired": true,
"isSecret": true
},
Expand Down
14 changes: 7 additions & 7 deletions packages/mcp/src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ EXAMPLE Claude Desktop config (~/Library/Application Support/Claude/claude_deskt
"mcpServers": {
"leadbay": {
"command": "npx",
"args": ["-y", "@leadbay/mcp@0.10"],
"args": ["-y", "@leadbay/mcp@0.11"],
"env": {
"LEADBAY_TOKEN": "lb_...",
"LEADBAY_REGION": "us",
Expand Down Expand Up @@ -524,7 +524,7 @@ async function runLogin(args: string[]): Promise<number> {
mcpServers: {
leadbay: {
command: "npx",
args: ["-y", "@leadbay/mcp@0.10"],
args: ["-y", "@leadbay/mcp@0.11"],
env: {
LEADBAY_TOKEN: result.token,
LEADBAY_REGION: result.region,
Expand Down Expand Up @@ -561,7 +561,7 @@ async function runLogin(args: string[]): Promise<number> {
` claude mcp add leadbay --scope user \\\n` +
` --env LEADBAY_TOKEN=${result.token} \\\n` +
` --env LEADBAY_REGION=${result.region} \\\n` +
` -- npx -y @leadbay/mcp@0.10\n\n` +
` -- npx -y @leadbay/mcp@0.11\n\n` +
`Restart your MCP client to pick up the new server.\n`
);
return 0;
Expand Down Expand Up @@ -678,7 +678,7 @@ async function runLogin(args: string[]): Promise<number> {
` claude mcp add leadbay --scope user \\\n` +
` --env LEADBAY_TOKEN=$(jq -r .mcpServers.leadbay.env.LEADBAY_TOKEN ${quotedPath}) \\\n` +
` --env LEADBAY_REGION=${result.region} \\\n` +
` -- npx -y @leadbay/mcp@0.10\n`
` -- npx -y @leadbay/mcp@0.11\n`
);
}
process.stderr.write(
Expand Down Expand Up @@ -926,7 +926,7 @@ export function buildClaudeCodeAddArgs(
`LEADBAY_TELEMETRY_ENABLED=${telemetryEnabled ? "true" : "false"}`,
];
if (!includeWrite) args.push("--env", `LEADBAY_MCP_WRITE=0`);
args.push("--", "npx", "-y", "@leadbay/mcp@0.10");
args.push("--", "npx", "-y", "@leadbay/mcp@0.11");
return args;
}

Expand Down Expand Up @@ -1000,7 +1000,7 @@ async function installInJsonConfig(

parsed.mcpServers.leadbay = {
command: "npx",
args: ["-y", "@leadbay/mcp@0.10"],
args: ["-y", "@leadbay/mcp@0.11"],
env,
};

Expand Down Expand Up @@ -1232,7 +1232,7 @@ async function runInstall(args: string[]): Promise<number> {
}
process.stderr.write(
`\nThe token was written into client config files but never printed to your terminal.\n` +
`Verify with: LEADBAY_TOKEN=$(...) npx -y @leadbay/mcp@0.10 doctor\n` +
`Verify with: LEADBAY_TOKEN=$(...) npx -y @leadbay/mcp@0.11 doctor\n` +
`Restart your MCP client(s) to pick up the new server.\n` +
`If you ever leak the token, run \`leadbay-mcp login --email <you> --region <us|fr>\` to mint a fresh one (which invalidates the prior session).\n`
);
Expand Down
4 changes: 2 additions & 2 deletions packages/mcp/test/unit/install-flags.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ describe("buildClaudeCodeAddArgs — Claude Code registration argv", () => {
expect(args).toContain("LEADBAY_MCP_WRITE=0");
});

it("pins the @leadbay/mcp@0.10 npx target", () => {
it("pins the @leadbay/mcp@0.11 npx target", () => {
const args = buildClaudeCodeAddArgs("tok", "us", true, true);
const sep = args.indexOf("--");
expect(sep).toBeGreaterThan(0);
expect(args.slice(sep + 1)).toEqual(["npx", "-y", "@leadbay/mcp@0.10"]);
expect(args.slice(sep + 1)).toEqual(["npx", "-y", "@leadbay/mcp@0.11"]);
});

it("token and region are NOT placed after the `--` separator (would be passed to npx, not claude)", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp/test/unit/login-collision.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const CFG = (email: string, region: "us" | "fr", token = "u.tok") => ({
mcpServers: {
leadbay: {
command: "npx",
args: ["-y", "@leadbay/mcp@0.10"],
args: ["-y", "@leadbay/mcp@0.11"],
env: { LEADBAY_TOKEN: token, LEADBAY_REGION: region },
},
},
Expand Down
Loading