Skip to content

docs(examples): add wellness signal minimizer example using bee mcp - #32

Open
LucioD3v wants to merge 1 commit into
bee-computer:mainfrom
LucioD3v:docs/wellness-signal-minimizer-example
Open

LucioD3v wants to merge 1 commit into
bee-computer:mainfrom
LucioD3v:docs/wellness-signal-minimizer-example

Conversation

@LucioD3v

Copy link
Copy Markdown

What

Adds a small, self-contained example under examples/wellness-signal-minimizer/ that connects to bee mcp serve over stdio, calls the bee_search tool, and prints only coarse, aggregated wellness signals (signal name and approximate mention count). It never prints transcript text, conversation IDs or timestamps.

No changes to sources/ or to any existing file.

Why

The MCP docs show how to connect assistants to Bee context. This example shows a complementary pattern for developers building on top of it: minimize before you share. Bee context is private by nature. Anything that leaves the machine (to a caregiver, a dashboard, an LLM prompt) should first be reduced to the least informative form that still answers the question.

It came out of building a consent-scoped family wellness skill for the Amazon Developer Hackathon.

Files

  • examples/wellness-signal-minimizer/index.mjs: the example (plain ESM, no build step).
  • examples/wellness-signal-minimizer/package.json: declares the MCP SDK dependency for the example only.
  • examples/wellness-signal-minimizer/README.md: usage, design notes, limitations.

The folder is outside tsconfig.json (include: sources/**/*.ts), outside the bundle, and outside files in package.json, so it does not affect typecheck, build or the published package.

How it was tested

Environment: Windows 11, Node 24.14.1, Bun 1.4.3, bee-cli built from main at fa9580d (0.9.0), signed in to a real Bee account. The example dependency resolved to @modelcontextprotocol/sdk@1.32.1.

Repo checks, run on clean main and again with the example added, with identical results:

  • bun install: OK
  • bun run typecheck: OK
  • bun run build: OK
  • bun test: 381 pass, 1 skip, 2 fail, 1 error in both runs. The two failures (lib integration > data api builds threads arguments, photos command (registry-derived) > get --output ...) already fail on main in my environment and are unrelated to this change.

Example, run as node index.mjs --command ../../dist/bee ...:

  • --days 3 --debug and --days 30 --debug: exit 0. stdout is a JSON object with only windowDays, signals and note. Every mentions value was a number (never null). stderr contained only the structural [debug] <signal>/<term>: keys=... lines and no conversation text.
  • --days 0 and --days 31: exit 2 with --days must be an integer between 1 and 30.
  • --command /no/existe: exit 1 after about 2 s with Could not read Bee context: MCP error -32000: Connection closed, with no hang.
  • Checked the real bee_search response structure (keys only, no values): a text content part whose JSON is { results, next_cursor, search_mode, timezone }, with items carrying id. The parser reads results and uses id for de-duplication.

Not tested: macOS or Linux, running the example under Bun, or accounts with a large volume of conversations.

Checklist

  • Followed AGENTS.md: ran bun install, bun run typecheck and bun run build before committing
  • The example does not affect the CLI build or typecheck
  • Uses only bee_search parameters defined in its MCP input schema (query, limit, filter, mode, since)
  • The example output contains no transcript text
  • Conventional (Angular-style) commit message

Notes for reviewers

  • The parser matches the current bee_search response shape. If the shape changes, the script reports mentions: null instead of guessing.
  • Happy to move this into docs or adapt it to your preferred examples layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants