# Instructions for AI Agents Working on Beads ## Project Overview This is **beads** (command: `bd`), an issue tracker designed for AI-supervised coding workflows. We dogfood our own tool! ## Issue Tracking We use bd (beads) for issue tracking instead of Markdown TODOs or external tools. ### MCP Server (Recommended) **RECOMMENDED**: Use the MCP (Model Context Protocol) server for the best experience! The beads MCP server provides native integration with Claude and other MCP-compatible AI assistants. **Installation:** ```bash # Install the MCP server pip install beads-mcp # Add to your MCP settings (e.g., Claude Desktop config) { "beads": { "command": "beads-mcp", "args": [] } } ``` **Benefits:** - Native function calls instead of shell commands - Automatic workspace detection - Better error handling and validation - Structured JSON responses - No need for `--json` flags **All bd commands are available as MCP functions** with the prefix `mcp__beads-*__`. For example: - `bd ready` → `mcp__beads__ready()` - `bd create` → `mcp__beads__create(title="...", priority=1)` - `bd update` → `mcp__beads__update(issue_id="bd-42", status="in_progress")` See `integrations/beads-mcp/README.md` for complete documentation. ### Multi-Repo Configuration (MCP Server) **RECOMMENDED: Use a single MCP server with global daemon** for all beads repositories. **Setup (one-time):** ```bash # Start global daemon (or it will auto-start on first bd command) bd daemon --global # MCP config in ~/.config/amp/settings.json or Claude Desktop config: { "beads": { "command": "beads-mcp", "args": [] } } ``` **How it works:** The single MCP server instance automatically: 1. Checks for local daemon socket (`.beads/bd.sock`) in your current workspace 2. Falls back to global daemon socket (`~/.beads/bd.sock`) 3. Routes requests to the correct database based on your current working directory 4. Auto-starts the daemon if it's not running (with exponential backoff on failures) 5. Auto-detects multiple repositories and prefers global daemon when 4+ repos are found **Why this is better than multiple MCP servers:** - ✅ One config entry works for all your beads projects - ✅ No risk of AI selecting wrong MCP server for workspace - ✅ Better resource usage (one daemon instead of multiple) - ✅ Automatic workspace detection without BEADS_WORKING_DIR **Note:** The daemon **auto-starts automatically** when you run any `bd` command (v0.9.11+). To disable auto-start, set `BEADS_AUTO_START_DAEMON=false`. **Alternative (legacy): Multiple MCP Server Instances** If you must use separate MCP servers (not recommended): ```json { "beads-webapp": { "command": "beads-mcp", "env": { "BEADS_WORKING_DIR": "/Users/you/projects/webapp" } }, "beads-api": { "command": "beads-mcp", "env": { "BEADS_WORKING_DIR": "/Users/you/projects/api" } } } ``` ⚠️ **Problem**: AI may select the wrong MCP server for your workspace, causing commands to operate on the wrong database. **Migration helper:** ```bash # Migrate from local to global daemon bd daemon --migrate-to-global # Or set environment variable for permanent preference export BEADS_PREFER_GLOBAL_DAEMON=1 ``` ### CLI Quick Reference If you're not using the MCP server, here are the CLI commands: ```bash # Find ready work (no blockers) bd ready --json # Create new issue bd create "Issue title" -t bug|feature|task -p 0-4 -d "Description" --json # Create with explicit ID (for parallel workers) bd create "Issue title" --id worker1-100 -p 1 --json # Create with labels bd create "Issue title" -t bug -p 1 -l bug,critical --json # Create multiple issues from markdown file bd create -f feature-plan.md --json # Update issue status bd update --status in_progress --json # Link discovered work (old way) bd dep add --type discovered-from # Create and link in one command (new way) bd create "Issue title" -t bug -p 1 --deps discovered-from: --json # Label management bd label add