Skip to content

feat: pnpm workspace + @leadbay/mcp MCP server#4

Merged
milstan merged 1 commit intomainfrom
milstan/mcp-server
Apr 21, 2026
Merged

feat: pnpm workspace + @leadbay/mcp MCP server#4
milstan merged 1 commit intomainfrom
milstan/mcp-server

Conversation

@milstan
Copy link
Copy Markdown
Contributor

@milstan milstan commented Apr 21, 2026

Summary

  • Refactor to pnpm workspace. @leadbay/core (private) owns the LeadbayClient + 11 granular tools + 3 new composite workflow tools (find_prospects, research_company, prepare_outreach). Both adapters tsup-bundle core so no workspace:* leaks into published tarballs.
  • New @leadbay/mcp package. CLI-only MCP server for Claude Desktop / Cursor / Claude Code. Composite tools by default; LEADBAY_MCP_ADVANCED=1 adds the 10 granular tools. leadbay_login is intentionally never exposed on MCP (prompt-injection gate). Low-level SDK Server class, server.instructions guides LLM flow, {isError:true} envelope surfaces Leadbay error codes verbatim. doctor/--help/--version subcommands; when LEADBAY_REGION is unset the server races /users/me on us+fr and picks whichever answers.
  • Tests migrated + extended. 76 passing (52 core + 8 leadclaw contract + 16 mcp including concurrency + region auto-probe); live smoke gated on LEADBAY_TEST_TOKEN. Manifest parity with the legacy openclaw.plugin.json verified via diff.

Test plan

  • pnpm install && pnpm -r build && pnpm -r typecheck && pnpm -r test all pass
  • node packages/mcp/dist/bin.js --version / --help exit 0
  • node packages/mcp/dist/bin.js with LEADBAY_TOKEN unset exits 1 with actionable stderr
  • LEADBAY_TOKEN=… node packages/mcp/dist/bin.js doctor prints org + quota
  • tools/list returns 3 composite tools by default and 13 with LEADBAY_MCP_ADVANCED=1 (leadbay_login absent in both)
  • Claude Desktop config snippet in packages/mcp/README.md works end-to-end

🤖 Generated with Claude Code

Refactor from single OpenClaw plugin package into pnpm workspace:
- @leadbay/core (private): shared LeadbayClient + 11 granular tools + 3 composite workflow tools (find_prospects, research_company, prepare_outreach)
- @leadbay/leadclaw: thin OpenClaw adapter, 11 granular tools, tsup-bundles @leadbay/core so the published tarball has no workspace:* references
- @leadbay/mcp: CLI-only MCP server for Claude Desktop / Cursor / Claude Code. Exposes composite tools by default; LEADBAY_MCP_ADVANCED=1 adds 10 granular (leadbay_login intentionally never exposed — prompt-injection gate). Low-level SDK Server class, server.instructions guides LLM flow, {isError:true} envelope surfaces Leadbay error codes verbatim to the model, doctor/--help/--version subcommands, region auto-probe via /users/me when LEADBAY_REGION unset.

Tests: 76 passing (52 core + 8 leadclaw contract + 16 mcp including concurrency + auto-probe). Live smoke tests gated on LEADBAY_TEST_TOKEN.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@milstan milstan merged commit 66b348d into main Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant