feat: pnpm workspace + @leadbay/mcp MCP server#4
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@leadbay/core(private) owns theLeadbayClient+ 11 granular tools + 3 new composite workflow tools (find_prospects,research_company,prepare_outreach). Both adapterstsup-bundle core so noworkspace:*leaks into published tarballs.@leadbay/mcppackage. CLI-only MCP server for Claude Desktop / Cursor / Claude Code. Composite tools by default;LEADBAY_MCP_ADVANCED=1adds the 10 granular tools.leadbay_loginis intentionally never exposed on MCP (prompt-injection gate). Low-level SDKServerclass,server.instructionsguides LLM flow,{isError:true}envelope surfaces Leadbay error codes verbatim.doctor/--help/--versionsubcommands; whenLEADBAY_REGIONis unset the server races/users/meon us+fr and picks whichever answers.LEADBAY_TEST_TOKEN. Manifest parity with the legacyopenclaw.plugin.jsonverified via diff.Test plan
pnpm install && pnpm -r build && pnpm -r typecheck && pnpm -r testall passnode packages/mcp/dist/bin.js --version/--helpexit 0node packages/mcp/dist/bin.jswithLEADBAY_TOKENunset exits 1 with actionable stderrLEADBAY_TOKEN=… node packages/mcp/dist/bin.js doctorprints org + quotatools/listreturns 3 composite tools by default and 13 withLEADBAY_MCP_ADVANCED=1(leadbay_loginabsent in both)packages/mcp/README.mdworks end-to-end🤖 Generated with Claude Code