Commit Graph

61 Commits

Author SHA1 Message Date
Steve Yegge
5b963e3379 chore: Bump version to 0.17.2 2025-10-25 18:57:47 -07:00
Steve Yegge
744563e87f Add health checks and reconnection logic for stale daemon sockets (bd-137)
- Add ping() and health() methods to BdDaemonClient for connection verification
- Implement _health_check_client() to verify cached client connections
- Add _reconnect_client() with exponential backoff (0.1s, 0.2s, 0.4s, max 3 retries)
- Update _get_client() to health-check before returning cached clients
- Automatically detect and remove stale connections from pool
- Add comprehensive test suite with 14 tests covering all scenarios
- Handle daemon restarts, upgrades, and long-idle connections gracefully

Amp-Thread-ID: https://ampcode.com/threads/T-2366ef1b-389c-4293-8145-7613037c9dfa
Co-authored-by: Amp <amp@ampcode.com>
2025-10-25 17:39:21 -07:00
Steve Yegge
d301ac68ed chore: Bump version to 0.17.1
Updated all component versions:
- bd CLI: 0.17.0 → 0.17.1
- Plugin: 0.17.0 → 0.17.1
- MCP server: 0.17.0 → 0.17.1
- Documentation: 0.17.0 → 0.17.1

Generated by scripts/bump-version.sh
2025-10-25 16:45:16 -07:00
Steve Yegge
de03466da9 Fix bd-143: Prevent daemon auto-sync from wiping out issues.jsonl with empty database
- Added safety check to exportToJSONLWithStore (daemon path)
- Refuses to export 0 issues over non-empty JSONL file
- Added --force flag to override safety check when intentional
- Added test coverage for empty database export protection
- Prevents data loss when daemon has wrong/empty database

Amp-Thread-ID: https://ampcode.com/threads/T-de18e0ad-bd17-46ec-994b-0581e257dcde
Co-authored-by: Amp <amp@ampcode.com>
2025-10-25 16:36:18 -07:00
Steve Yegge
667d41e9d4 chore: Bump version to 0.17.0
Updated all component versions:
- bd CLI: 0.16.0 → 0.17.0
- Plugin: 0.16.0 → 0.17.0
- MCP server: 0.16.0 → 0.17.0
- Documentation: 0.16.0 → 0.17.0

Generated by scripts/bump-version.sh
2025-10-24 22:36:06 -07:00
Steve Yegge
f5feee0d20 Remove global daemon from docs, deprecate bd repos command
- Stub out 'bd repos' command with deprecation message
- Remove 140+ lines of global daemon/multi-repo docs from ADVANCED.md
- Add architecture section explaining daemon/MCP/beads roles (LSP model)
- Update AGENTS.md, MCP README, FAQ.md to emphasize per-project daemons
- Update commands/daemon.md and commands/repos.md

Closes #140

Global daemon was removed in v0.16.0 due to cross-project pollution
risks. bd now uses per-project local daemons (one per workspace) for
complete database isolation, following LSP architecture patterns.

Amp-Thread-ID: https://ampcode.com/threads/T-c45147dc-8939-43bf-8fbd-303ed4a8d845
Co-authored-by: Amp <amp@ampcode.com>
2025-10-24 13:02:16 -07:00
Steve Yegge
474b6bf000 chore: Bump version to 0.16.0
Updated all component versions:
- bd CLI: 0.15.0 → 0.16.0
- Plugin: 0.15.0 → 0.16.0
- MCP server: 0.15.0 → 0.16.0
- Documentation: 0.15.0 → 0.16.0

Generated by scripts/bump-version.sh
2025-10-23 20:02:05 -07:00
Steve Yegge
9665b335dc chore: Bump version to 0.15.0
Updated all component versions:
- bd CLI: 0.14.0 → 0.15.0
- Plugin: 0.14.0 → 0.15.0
- MCP server: 0.14.0 → 0.15.0
- Documentation: 0.14.0 → 0.15.0

Generated by scripts/bump-version.sh
2025-10-23 14:26:40 -07:00
Steve Yegge
feac3f86e7 MCP: Smart routing for lifecycle status changes in update tool
- update(status="closed") now routes to close() tool
- update(status="open") now routes to reopen() tool
- Respects Claude Code approval workflows for lifecycle events
- Prevents bypass of approval settings
- bd CLI remains unopinionated; routing only in MCP layer
- Users can safely auto-approve benign updates without exposing closure bypass

Fixes #123

Amp-Thread-ID: https://ampcode.com/threads/T-8b85a68e-7e06-460e-9840-9c6b6a6b7e85
Co-authored-by: Amp <amp@ampcode.com>
2025-10-23 14:10:33 -07:00
Steve Yegge
4f1d1a2cca Fix MCP dep tool parameter names to match CLI (issue_id/depends_on_id)
- Changed from confusing from_id/to_id to clear issue_id/depends_on_id
- Matches CLI convention: bd dep add [issue-id] [depends-on-id]
- Updated all tests and implementations
- Fixes GH #113 where Claude Code was creating dependencies backwards

Closes bd-58

Amp-Thread-ID: https://ampcode.com/threads/T-f01aca11-a10f-4908-9ce6-7e1734f2068f
Co-authored-by: Amp <amp@ampcode.com>
2025-10-23 13:07:44 -07:00
Steve Yegge
10a313e3a6 Add integration tests for worktree workflow with separate databases
- Created test_worktree_separate_dbs.py with 6 comprehensive tests
- Verifies recommended workflow: one .beads database per worktree
- Tests confirm MCP works with BEADS_USE_DAEMON=0 in worktrees
- Validates database isolation, git syncing, and --no-daemon flag
- All tests passing

Addresses GH #119

Amp-Thread-ID: https://ampcode.com/threads/T-57d5c589-0522-4059-8183-2f0f7f1dccba
Co-authored-by: Amp <amp@ampcode.com>
2025-10-23 13:06:05 -07:00
Steve Yegge
4f560379f2 Add description parameter to bd update command and MCP server
Fixes #114 and #122 by adding --description/-d flag to bd update CLI
and description parameter to MCP update_issue tool.

Changes:
- CLI: Added --description flag to updateCmd
- RPC: Added Description field to UpdateArgs
- Daemon: Updated updatesFromArgs to handle description
- MCP: Added description to update_issue, UpdateIssueParams, and clients
- Storage: description already supported in allowedUpdateFields

Tested in both daemon and direct modes.
2025-10-23 11:00:19 -07:00
Steve Yegge
09a9865087 chore: Bump version to 0.14.0
Updated all component versions:
- bd CLI: 0.12.0 → 0.14.0
- Plugin: 0.12.0 → 0.14.0
- MCP server: 0.12.0 → 0.14.0
- Documentation: 0.12.0 → 0.14.0

Generated by scripts/bump-version.sh
2025-10-22 23:15:18 -07:00
Steve Yegge
d0bd0a7e0d chore: Bump version to 0.12.0
Updated all component versions:
- bd CLI: 0.11.0 → 0.12.0
- Plugin: 0.11.0 → 0.12.0
- MCP server: 0.11.0 → 0.12.0
- Documentation: 0.11.0 → 0.12.0

Generated by scripts/bump-version.sh
2025-10-22 18:24:27 -07:00
Steve Yegge
935470a3d8 Fix MCP close method signature bug (GH #107, bd-67)
- Fix BdDaemonClient.close() to accept issue_id and reason parameters
- Remove uv.lock from repo

Amp-Thread-ID: https://ampcode.com/threads/T-0017f48d-605c-410f-9a77-db62153c9357
Co-authored-by: Amp <amp@ampcode.com>
2025-10-22 17:53:28 -07:00
Steve Yegge
42762188ed Fix MCP close tool method signature error (GH #107)
Renamed BdDaemonClient.close() cleanup method to cleanup() to eliminate
method name collision with async close(params) method for closing issues.

Root cause: Python method resolution meant the non-async close(self)
cleanup method was shadowing the async close(self, params) method that
closes issues, causing 'takes 1 positional argument but 2 were given'.

Changes:
- bd_daemon_client.py: Renamed close() -> cleanup()
- server.py: Updated cleanup code to call cleanup() instead of close()
- test_lifecycle.py: Updated tests to use cleanup()

All close-related tests pass. Fixes GitHub issue #107.
Tracked in bd-67 (closed).
2025-10-22 17:43:11 -07:00
Steve Yegge
2a032ae3ba chore: Bump version to 0.11.0
Updated all component versions:
- bd CLI: 0.10.1 → 0.11.0
- Plugin: 0.10.1 → 0.11.0
- MCP server: 0.10.1 → 0.11.0
- Documentation: 0.10.1 → 0.11.0

Generated by scripts/bump-version.sh
2025-10-22 01:09:25 -07:00
mountaintopsolutions
0f044117b4 Normalize --acceptance flag for bd update command (#102)
- Update bd update to use --acceptance instead of --acceptance-criteria
- Update MCP client to use --acceptance flag
- Simplify SKILL.md documentation now that both commands use same flag

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-22 00:15:54 -07:00
Steve Yegge
ec946ee48b Fix #97: Add daemon mode check to rename-prefix command
- Prevents nil pointer dereference when daemon is active
- Ensures direct mode or fails gracefully
- Lower Python requirement to 3.10+ for beads-mcp (#99)

Amp-Thread-ID: https://ampcode.com/threads/T-740c6f9c-b8f0-4155-8bfa-7075eea2df22
Co-authored-by: Amp <amp@ampcode.com>
2025-10-21 14:56:18 -07:00
Steve Yegge
f4dd9e09a1 Fix MCP update tool bypassing close approval workflow
- Detect when update is called with status='closed'
- Redirect to close_issue to preserve approval workflow
- Ensures closing tasks always requires same approval regardless of tool used

Fixes #90

Amp-Thread-ID: https://ampcode.com/threads/T-9eab3a82-18f3-4ae3-a2d5-d114811383c1
Co-authored-by: Amp <amp@ampcode.com>
2025-10-20 23:47:56 -07:00
Steve Yegge
19b3200cd4 chore: Bump version to 0.10.1
Updated all component versions:
- bd CLI: 0.10.0 → 0.10.1
- Plugin: 0.10.0 → 0.10.1
- MCP server: 0.9.11 → 0.10.1
- Documentation: 0.10.0 → 0.10.1

Includes fix for bd-179 (derive prefix from database filename)
2025-10-20 22:18:41 -07:00
Steve Yegge
a86f3e139e Add native Windows support (#91)
- Native Windows daemon using TCP loopback endpoints
- Direct-mode fallback for CLI/daemon compatibility
- Comment operations over RPC
- PowerShell installer script
- Go 1.24 requirement
- Cross-OS testing documented

Co-authored-by: danshapiro <danshapiro@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-c6230265-055f-4af1-9712-4481061886db
Co-authored-by: Amp <amp@ampcode.com>
2025-10-20 21:08:49 -07:00
Steve Yegge
5045496bbe Bump version to 0.10.0 2025-10-20 15:27:30 -07:00
Steve Yegge
ec9570c045 chore: Bump version to 0.9.11
Updated all component versions:
- bd CLI: 0.9.10 → 0.9.11
- Plugin: 0.9.10 → 0.9.11
- MCP server: 0.9.10 → 0.9.11
- Documentation: 0.9.10 → 0.9.11

Generated by scripts/bump-version.sh
2025-10-19 23:23:39 -07:00
Steve Yegge
095ebc70e6 Fix MCP server None/null crashes in list/ready/stats (bd-172, fixes #79)
Add null safety checks in bd_daemon_client.py:
- list_issues(): Return empty array if issues_data is None
- ready(): Return empty array if issues_data is None
- stats(): Use empty dict if stats_data is None

This prevents TypeError crashes when daemon returns None/empty responses.

Amp-Thread-ID: https://ampcode.com/threads/T-072304c3-3a03-4091-92a9-9e16b4538227
Co-authored-by: Amp <amp@ampcode.com>
2025-10-19 23:23:33 -07:00
Steve Yegge
bf43215dd1 Fix bd-167: Handle Amp's workspace_root parameter injection
- Add workspace_root param to all MCP tool signatures (accepted but ignored)
- Fix where_am_i to accept workspace_root
- Fix set_context to always set env vars even when DB not found
- Allows init to work immediately after set_context
2025-10-19 21:36:07 -07:00
Steve Yegge
5e0030d283 Add lifecycle management for beads-mcp processes (bd-148)
- Register atexit handler to close daemon connections
- Add signal handlers for SIGTERM/SIGINT for graceful shutdown
- Implement cleanup() to close all daemon client connections
- Track daemon clients globally for cleanup
- Add close() method to BdDaemonClient (no-op since connections are per-request)
- Register client on first use via _get_client()
- Add comprehensive lifecycle tests

This prevents MCP server processes from accumulating without cleanup.
Each tool invocation will now properly clean up on exit.

Amp-Thread-ID: https://ampcode.com/threads/T-05d76b8e-dac9-472b-bfd0-afe10e3457cd
Co-authored-by: Amp <amp@ampcode.com>
2025-10-18 14:27:37 -07:00
Steve Yegge
0795797bac docs: Document multi-repo workflow with global daemon
Implements bd-122: Document how to use beads across multiple projects

Added comprehensive multi-repo documentation:
- README.md: Global daemon section with architecture diagram
- AGENTS.md: MCP multi-repo configuration (global daemon + per-project)
- integrations/beads-mcp/README.md: BEADS_WORKING_DIR usage
- Mermaid diagram showing one daemon serving multiple repos

Documentation covers:
- Global daemon (bd daemon --global) for system-wide usage
- Per-project MCP instances with BEADS_WORKING_DIR
- Comparison table (local vs global)
- When to use each approach
- Example workflows for multi-project setups

Benefits of global daemon:
- One daemon process for all repos
- Automatic socket discovery (local -> global fallback)
- Better resource usage
- Per-request context routing to correct database

Amp-Thread-ID: https://ampcode.com/threads/T-ea606216-b886-4af0-bba8-56d000362d01
Co-authored-by: Amp <amp@ampcode.com>
2025-10-17 22:49:22 -07:00
Steve Yegge
958bbc0853 feat(daemon): Add --global flag for multi-repo support
Implements bd-121: Global daemon with system-wide socket

Changes:
- Add --global flag to daemon command
- Use ~/.beads/bd.sock when --global is set
- Skip git repo validation for global daemon
- Update daemon discovery to check ~/.beads/ as fallback
- Both Go CLI and Python MCP client check global socket
- Update all tests to pass global parameter

Benefits:
- Single daemon serves all repos on system
- No per-repo daemon management needed
- Better resource usage for users with many repos
- Automatic fallback when local daemon not running

Usage:
  bd daemon --global         # Start global daemon
  bd daemon --status --global # Check global status
  bd daemon --stop --global   # Stop global daemon

Related: bd-73 (multi-repo epic)
Amp-Thread-ID: https://ampcode.com/threads/T-ea606216-b886-4af0-bba8-56d000362d01
Co-authored-by: Amp <amp@ampcode.com>
2025-10-17 22:45:33 -07:00
Steve Yegge
3446bb0ee4 Merge pull request #76 from ghoseb/fix/windows-stdio-crash
fix(mcp): Fix AsyncIO crash on Windows
2025-10-17 22:25:42 -07:00
Michael Shuffett
74b460b298 fix(mcp): Fix three critical bugs in beads MCP plugin
This PR fixes three bugs that prevented the MCP plugin from working:

1. **Fixed parameter name mismatch in tools.py**
   - Changed `workspace_root=workspace_root` to `working_dir=workspace_root`
   - The `create_bd_client()` function expects `working_dir` parameter,
     but tools.py was passing `workspace_root`
   - This caused "got an unexpected keyword argument 'workspace_root'" error

2. **Added version check guard for daemon client**
   - Added `hasattr(_client, '_check_version')` check before calling
   - BdDaemonClient doesn't have `_check_version()` method, only BdCliClient does
   - This caused "'BdDaemonClient' object has no attribute '_check_version'" error

3. **Implemented proper daemon socket detection for fallback**
   - Added synchronous socket file existence check before creating daemon client
   - Walks up directory tree looking for `.beads/bd.sock` file
   - Only creates daemon client if socket exists, otherwise falls back to CLI
   - Previously, daemon client was created but failed on first method call
   - This enables the documented "prefer_daemon with automatic CLI fallback" behavior

**Testing:**
- Verified MCP tools work correctly with single-repo setup
- Confirmed automatic fallback to CLI when daemon isn't running
- Tested on macOS with bd v0.9.9

**Related Issues:**
- Addresses symptoms similar to #65 (Windows BEADS_WORKING_DIR issue)
2025-10-17 21:16:19 -07:00
Baishampayan Ghose
67739fbdc7 fix(mcp): Fix AsyncIO crash on Windows
Since our implementation uses `async` IO for subprocess communication, it's
crucial to utilize the `fastMCP.run_async()` entry-point of FastMCP.

This should fix crashes on Windows.

ref: steveyegge/beads#53
2025-10-18 09:45:17 +05:30
Steve Yegge
52e2993bf6 chore: Bump version to 0.9.10
Updated all component versions:
- bd CLI: 0.9.9 → 0.9.10
- Plugin: 0.9.9 → 0.9.10
- MCP server: 0.9.9 → 0.9.10
- Documentation: 0.9.9 → 0.9.10

Generated by scripts/bump-version.sh
2025-10-17 18:15:29 -07:00
Steve Yegge
ac5578d5f1 Complete daemon RPC with per-request context routing (bd-115)
- MCP server now uses daemon client by default with CLI fallback
- Added BEADS_USE_DAEMON environment variable (default: enabled)
- Created multi-repo integration test (all tests pass)
- Updated .gitignore for daemon runtime files
- Added SETUP_DAEMON.md with migration instructions
- Closed bd-105 (investigation complete) and bd-114 (multi-server confusion)

This enables single MCP server to handle multiple repos via daemon
with per-request context routing. No more multiple MCP server configs!

Amp-Thread-ID: https://ampcode.com/threads/T-c222692e-f6ef-4649-9726-db59470b82ef
Co-authored-by: Amp <amp@ampcode.com>
2025-10-17 16:55:14 -07:00
Steve Yegge
b40de9bc41 Implement daemon RPC with per-request context routing (bd-115)
- Added per-request storage routing in daemon server
  - Server now supports Cwd field in requests for database discovery
  - Tree-walking to find .beads/*.db from any working directory
  - Storage caching for performance across requests

- Created Python daemon client (bd_daemon_client.py)
  - RPC over Unix socket communication
  - Implements full BdClientBase interface
  - Auto-discovery of daemon socket from working directory

- Refactored bd_client.py with abstract interface
  - BdClientBase abstract class for common interface
  - BdCliClient for CLI-based operations (renamed from BdClient)
  - create_bd_client() factory with daemon/CLI fallback
  - Backwards-compatible BdClient alias

Next: Update MCP server to use daemon client when available
2025-10-17 16:28:29 -07:00
Steve Yegge
ff0ce6c3a7 Improve MCP client working directory handling
- Use os.getcwd() directly instead of PWD fallback (more reliable)
- Add cwd parameter to _run_command for per-command overrides

Amp-Thread-ID: https://ampcode.com/threads/T-bf7caacc-f242-4224-b730-1f4442a7ed50
Co-authored-by: Amp <amp@ampcode.com>
2025-10-17 14:22:26 -07:00
Steve Yegge
a971762b0e Remove ~/.beads fallback behavior
- Remove ~/.beads/default.db fallback from FindDatabasePath()
- Update daemon to error if no database found instead of falling back
- Update main.go to require explicit database initialization
- Add help/version/quickstart to commands that don't need database
- Add MCP client debug logging for database routing

Amp-Thread-ID: https://ampcode.com/threads/T-2b757a14-cf10-400e-a83c-30349182dd82
Co-authored-by: Amp <amp@ampcode.com>
2025-10-17 10:56:52 -07:00
Steve Yegge
1a82bbaee3 chore: Bump version to 0.9.9
Updated all component versions:
- bd CLI: 0.9.8 → 0.9.9
- Plugin: 0.9.8 → 0.9.9
- MCP server: 0.9.8 → 0.9.9
- Documentation: 0.9.8 → 0.9.9

Generated by scripts/bump-version.sh
2025-10-17 00:33:27 -07:00
Steve Yegge
1eb59fa120 chore: Bump version to 0.9.8
Updated all component versions:
- bd CLI: 0.9.7 → 0.9.8
- Plugin: 0.9.7 → 0.9.8
- MCP server: 0.9.7 → 0.9.8
- Documentation: 0.9.7 → 0.9.8

Generated by scripts/bump-version.sh
2025-10-16 15:10:43 -07:00
Baishampayan Ghose
32a718dacd feat(mcp): Add reopen command support for closed issues
Implements the `bd` reopen command across the entire MCP stack, enabling
agents to reopen closed issues with optional reason tracking for audit
trails. This addresses the need to handle regressions and incorrectly
closed issues without manual `bd` CLI intervention.

The reopen command is more explicit than `bd update --status open` and
emits a dedicated Reopened event in the audit log, making it easier to
track why issues were reopened during analysis.

Changes:
  - `models.py`: Add ReopenIssueParams with issue_ids list and optional reason
  - `bd_client.py`: Implement reopen() method with JSON response parsing
  - `tools.py`: Add beads_reopen_issue() wrapper with Annotated types for MCP
  - `server.py`: Register 'reopen' MCP tool with description and parameters

Testing (10 new):
  - `test_bd_client.py`: 4 unit tests (mocked subprocess)
  - `test_bd_client_integration.py`: 3 integration tests (real `bd` CLI)
  - `test_mcp_server_integration.py`: 3 MCP integration tests (FastMCP Client)
  - `test_tools.py`: 3 tools wrapper tests (mocked BdClient)

Also updated `README.md`.
2025-10-16 12:01:04 -07:00
Steve Yegge
7106df48e7 chore: Bump version to 0.9.7
Updated all component versions:
- bd CLI: 0.9.6 → 0.9.7
- Plugin: 0.9.6 → 0.9.7
- MCP server: 0.9.6 → 0.9.7
- Documentation: 0.9.6 → 0.9.7

Generated by scripts/bump-version.sh
2025-10-15 12:47:26 -07:00
Steve Yegge
691f90f833 Auto-fix remaining linting issues - remove unused imports 2025-10-15 11:45:11 -07:00
Steve Yegge
3347fd65ca Fix remaining linting issues - combine nested with statements 2025-10-15 11:44:59 -07:00
Baishampayan Ghose
4353592fe6 test(mcp): Fix two failing integration tests and linting errors
1. Fix `test_default_beads_path_auto_detection`
    - Changed beads_path to use `Field(default_factory=_default_beads_path)` so the default is evaluated at instance
    creation time, not class definition time
    - Updated test to mock both `shutil.which` and `os.access`
2. Fix `test_init_creates_beads_directory`
    - Fixed test to pass `working_dir=temp_dir` to `BdClient` instead of using `os.chdir()`
    - The `_get_working_dir()` method checks `PWD` env var first, which isn't updated by `os.chdir()`
3. Fix minor linting errors reported by `ruff` tool
4. Update `beads` version to `0.9.6` in `uv.lock` file

MCP Server test coverage is now excellent, at 92% overall maintaining our high-standards of production level quality.

```
Name                         Stmts   Miss  Cover
------------------------------------------------
src/beads_mcp/__init__.py        1      0   100%
src/beads_mcp/__main__.py        3      3     0%
src/beads_mcp/bd_client.py     214     14    93%
src/beads_mcp/config.py         51      2    96%
src/beads_mcp/models.py         92      1    99%
src/beads_mcp/server.py         58     16    72%
src/beads_mcp/tools.py          59      0   100%
------------------------------------------------
TOTAL                          478     36    92%
```
2025-10-15 16:59:16 +05:30
Steve Yegge
2b03805651 chore: Bump version to 0.9.6
Updated all component versions:
- bd CLI: 0.9.5 → 0.9.6
- Plugin: 0.9.5 → 0.9.6
- MCP server: 0.9.5 → 0.9.6
- Documentation: 0.9.5 → 0.9.6

Generated by scripts/bump-version.sh
2025-10-15 02:32:15 -07:00
Steve Yegge
2cc17a9acf chore: Bump version to 0.9.5
Updated all component versions:
- bd CLI: 0.9.4 → 0.9.5
- Plugin: 0.9.4 → 0.9.5
- MCP server: 0.9.4 → 0.9.5
- Documentation: 0.9.4 → 0.9.5

Generated by scripts/bump-version.sh
2025-10-14 19:22:53 -07:00
Steve Yegge
3a1f99790a feat(mcp): Add debug_env tool to diagnose working directory issues
Added a debug tool that reports:
- os.getcwd() value
- PWD environment variable
- BEADS_WORKING_DIR environment variable
- Other relevant environment variables

This will help diagnose where bd commands are running from and whether
Claude Code sets PWD or other variables correctly.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 19:22:53 -07:00
Steve Yegge
01b606fe7b fix(mcp): Run bd commands in user's working directory
The MCP server was running bd commands from the plugin installation directory,
causing the database to be created in the wrong place.

Added BEADS_WORKING_DIR config option and modified BdClient to use working
directory for subprocess calls. Falls back to PWD environment variable.

This ensures bd commands run from the user's actual project directory.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 18:57:32 -07:00
Steve Yegge
23bbdc7afa feat(mcp): Setup beads-mcp for PyPI distribution
Prepared the beads-mcp package for publishing to PyPI, simplifying installation
for users who want to use the MCP server with Claude Desktop or other MCP clients.

Changes:
- Added LICENSE file (MIT) to integrations/beads-mcp/
- Updated pyproject.toml with PyPI metadata (license, URLs, classifiers)
- Updated README with simplified installation (uv tool install beads-mcp)
- Created PYPI.md with detailed publishing guide
- Updated examples/claude-desktop-mcp/README to reference the production MCP server

Installation is now simplified from:
  git clone && cd && uv sync
to:
  uv tool install beads-mcp

Configuration is simplified from multi-line with --directory args to:
  "command": "beads-mcp"

Tested build successfully. Package ready for:
- Test PyPI: python -m twine upload --repository testpypi dist/*
- Production PyPI: python -m twine upload dist/*

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 18:07:22 -07:00
Steve Yegge
061e8c4a27 feat(mcp): improve error messages for missing bd CLI
Add helpful installation instructions when bd CLI is not found,
making it clear that the CLI must be installed separately.

Changes:
- Add BdNotFoundError.installation_message() with clear install steps
- Update all BdNotFoundError raises to use new formatted message
- Improve config error message with installation instructions first
- Update tests to match new error message format

Error message now shows:
- Clear explanation that bd CLI is required
- Installation command with curl one-liner
- Link to GitHub installation docs
- Reminder to restart Claude Code after installation

Test results: 90/91 tests passing (1 unrelated path assertion)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 17:33:54 -07:00