Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

bdd mcp

The embedded MCP server. This is the same workflow the CLI offers a human, exposed to AI agents as typed tools over the Model Context Protocol.

Usage: bdd mcp [OPTIONS] <COMMAND>

Commands: serve

bdd mcp serve

Serve the MCP tools over stdio. The process reads JSON-RPC on stdin and writes replies on stdout, so an MCP client (Cursor, Claude Desktop, any MCP-capable agent) launches it as a child process — you normally never run it by hand.

bdd mcp serve --root /path/to/project

Client configuration (Cursor’s mcp.json shown; others are equivalent):

{
  "mcpServers": {
    "bdd-workflow": {
      "command": "bdd",
      "args": ["mcp", "serve", "--root", "/path/to/project"]
    }
  }
}

The tools served

The tool names and reply shapes are byte-compatible with the workshop’s Java tdd-workflow-server, so existing clients work unchanged:

MCP toolCLI equivalent
list_requirementsbdd spec list
get_requirementbdd spec show
validate_specbdd spec validate
refine_requirementbdd spec refine
requirement_mark_implementedbdd spec mark-implemented
step_definitions_findbdd steps missing
step_definition_createbdd steps generate
unit_test_createbdd unittest generate
run_testsbdd test
get_tdd_statebdd state
start_refactorbdd refactor

Why serve tools instead of letting the agent edit files?

  • No escape hatches. The agent gets exactly these tools — no shell, no arbitrary file writes. Mutations go through the staging area for human review.
  • The discipline is in the server. An agent cannot skip RED, refactor while failing, or invent requirements: the tools refuse, with a nextStep that teaches the correct move.
  • State survives. The phase machine lives on disk, so a reconnecting agent (or a human taking over in the CLI) continues from the same place.

Flags

FlagDescription
--root <ROOT>Project root the served tools operate on. Defaults to the process’s working directory.
--model <MODEL>Model override for the serving session’s generation tools.

Notes

  • The server logs nothing to stdout except protocol traffic (stdout is the wire). Diagnostics go to stderr.
  • One server serves one project root. Point different projects at different server entries.
  • Generation tools use the same local Ollama resolution as the rest of the CLI. This CLI is developed and run against qwen3-coder-next:latest; your mileage will vary with other models, especially those not trained for development work. See bdd model.