devstuff 2.15.0__tar.gz → 2.16.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. {devstuff-2.15.0 → devstuff-2.16.0}/CHANGELOG.md +6 -0
  2. {devstuff-2.15.0 → devstuff-2.16.0}/CLAUDE.md +17 -0
  3. {devstuff-2.15.0 → devstuff-2.16.0}/PKG-INFO +28 -1
  4. {devstuff-2.15.0 → devstuff-2.16.0}/README.md +27 -0
  5. {devstuff-2.15.0 → devstuff-2.16.0}/docs/ROADMAP.md +1 -0
  6. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/mcp/development-plan.md +2 -2
  7. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/mcp/specifications.md +29 -4
  8. {devstuff-2.15.0 → devstuff-2.16.0}/pyproject.toml +1 -1
  9. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/bridges.py +7 -1
  10. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/cli.py +2 -0
  11. devstuff-2.16.0/src/dev_setup/commands/mcp_cmd.py +90 -0
  12. devstuff-2.16.0/src/dev_setup/mcp/core.py +443 -0
  13. devstuff-2.16.0/src/dev_setup/mcp/process.py +120 -0
  14. devstuff-2.16.0/src/dev_setup/mcp/stdio.py +158 -0
  15. devstuff-2.16.0/tests/test_mcp_core.py +547 -0
  16. devstuff-2.16.0/tests/test_mcp_process.py +263 -0
  17. devstuff-2.16.0/tests/test_mcp_stdio.py +465 -0
  18. {devstuff-2.15.0 → devstuff-2.16.0}/uv.lock +1 -1
  19. devstuff-2.15.0/src/dev_setup/mcp/core.py +0 -66
  20. {devstuff-2.15.0 → devstuff-2.16.0}/.claude/skills/run-stuff/SKILL.md +0 -0
  21. {devstuff-2.15.0 → devstuff-2.16.0}/.claude/skills/run-stuff/smoke.sh +0 -0
  22. {devstuff-2.15.0 → devstuff-2.16.0}/.github/codex/review.md +0 -0
  23. {devstuff-2.15.0 → devstuff-2.16.0}/.github/workflows/agent.yml +0 -0
  24. {devstuff-2.15.0 → devstuff-2.16.0}/.github/workflows/bump.yml +0 -0
  25. {devstuff-2.15.0 → devstuff-2.16.0}/.github/workflows/ci.yml +0 -0
  26. {devstuff-2.15.0 → devstuff-2.16.0}/.github/workflows/publish.yml +0 -0
  27. {devstuff-2.15.0 → devstuff-2.16.0}/.github/workflows/test-installs.yml +0 -0
  28. {devstuff-2.15.0 → devstuff-2.16.0}/.gitignore +0 -0
  29. {devstuff-2.15.0 → devstuff-2.16.0}/AGENTS.md +0 -0
  30. {devstuff-2.15.0 → devstuff-2.16.0}/dev/Dockerfile +0 -0
  31. {devstuff-2.15.0 → devstuff-2.16.0}/dev/Dockerfile.ci +0 -0
  32. {devstuff-2.15.0 → devstuff-2.16.0}/dev/Makefile +0 -0
  33. {devstuff-2.15.0 → devstuff-2.16.0}/dev/docker-compose.yml +0 -0
  34. {devstuff-2.15.0 → devstuff-2.16.0}/devstuff +0 -0
  35. {devstuff-2.15.0 → devstuff-2.16.0}/docs/github-agent.md +0 -0
  36. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/README.md +0 -0
  37. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/agent/development-plan.md +0 -0
  38. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/agent/specifications.md +0 -0
  39. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/agent/stack-decisions.md +0 -0
  40. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/ansible-config/development-plan.md +0 -0
  41. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/ansible-config/specifications.md +0 -0
  42. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/ansible-config/stack-decisions.md +0 -0
  43. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/bat-config/development-plan.md +0 -0
  44. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/bat-config/specifications.md +0 -0
  45. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/bat-config/stack-decisions.md +0 -0
  46. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/commitizen-config/development-plan.md +0 -0
  47. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/commitizen-config/specifications.md +0 -0
  48. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/commitizen-config/stack-decisions.md +0 -0
  49. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/docker-config/development-plan.md +0 -0
  50. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/docker-config/specifications.md +0 -0
  51. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/docker-config/stack-decisions.md +0 -0
  52. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/lazygit-config/development-plan.md +0 -0
  53. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/lazygit-config/specifications.md +0 -0
  54. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/lazygit-config/stack-decisions.md +0 -0
  55. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/mcp/stack-decisions.md +0 -0
  56. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/outdated/development-plan.md +0 -0
  57. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/outdated/specifications.md +0 -0
  58. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/outdated/stack-decisions.md +0 -0
  59. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/plan-and-progress/specifications.md +0 -0
  60. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/precommit-config/development-plan.md +0 -0
  61. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/precommit-config/specifications.md +0 -0
  62. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/precommit-config/stack-decisions.md +0 -0
  63. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/profile/development-plan.md +0 -0
  64. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/profile/specifications.md +0 -0
  65. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/profile/stack-decisions.md +0 -0
  66. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/profile-apply/development-plan.md +0 -0
  67. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/profile-apply/specifications.md +0 -0
  68. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/profile-apply/stack-decisions.md +0 -0
  69. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/starship-config/development-plan.md +0 -0
  70. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/starship-config/specifications.md +0 -0
  71. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/starship-config/stack-decisions.md +0 -0
  72. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/uv-backbone/development-plan.md +0 -0
  73. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/uv-backbone/specifications.md +0 -0
  74. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/uv-backbone/stack-decisions.md +0 -0
  75. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/verbose-mode/development-plan.md +0 -0
  76. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/verbose-mode/specifications.md +0 -0
  77. {devstuff-2.15.0 → devstuff-2.16.0}/docs/specs/verbose-mode/stack-decisions.md +0 -0
  78. {devstuff-2.15.0 → devstuff-2.16.0}/install.sh +0 -0
  79. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/__init__.py +0 -0
  80. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/__main__.py +0 -0
  81. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/__init__.py +0 -0
  82. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/approval.py +0 -0
  83. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/catalog.py +0 -0
  84. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/completion.py +0 -0
  85. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/config.py +0 -0
  86. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/loop.py +0 -0
  87. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/ollama.py +0 -0
  88. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/preflight.py +0 -0
  89. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/primitives.py +0 -0
  90. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/registry.py +0 -0
  91. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/sandbox.py +0 -0
  92. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/session.py +0 -0
  93. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/transcript.py +0 -0
  94. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent/wizard.py +0 -0
  95. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent_tools.schema.json +0 -0
  96. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/agent_tools.yaml +0 -0
  97. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/apply_exec.py +0 -0
  98. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/apply_plan.py +0 -0
  99. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/base.py +0 -0
  100. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/bundles/ai-agents.yaml +0 -0
  101. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/bundles/ai-local.yaml +0 -0
  102. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/bundles/devops.yaml +0 -0
  103. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/bundles/essentials.yaml +0 -0
  104. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/bundles/languages.yaml +0 -0
  105. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/bundles/python.yaml +0 -0
  106. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/bundles.py +0 -0
  107. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/catalog.py +0 -0
  108. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/__init__.py +0 -0
  109. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/_plan.py +0 -0
  110. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/add_cmd.py +0 -0
  111. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/agent_cmd.py +0 -0
  112. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/catalog_cmd.py +0 -0
  113. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/configure_cmd.py +0 -0
  114. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/delete_cmd.py +0 -0
  115. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/docs_cmd.py +0 -0
  116. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/doctor_cmd.py +0 -0
  117. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/functions_cmd.py +0 -0
  118. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/help_cmd.py +0 -0
  119. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/install_cmd.py +0 -0
  120. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/links_cmd.py +0 -0
  121. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/list_cmd.py +0 -0
  122. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/outdated_cmd.py +0 -0
  123. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/profile_cmd.py +0 -0
  124. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/remove_cmd.py +0 -0
  125. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/run_cmd.py +0 -0
  126. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/skills_cmd.py +0 -0
  127. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/commands/update_cmd.py +0 -0
  128. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/__init__.py +0 -0
  129. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/ansible/__init__.py +0 -0
  130. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/ansible/detect.py +0 -0
  131. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/ansible/model.py +0 -0
  132. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/ansible/render.py +0 -0
  133. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/ansible/validate.py +0 -0
  134. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/ansible/wizard.py +0 -0
  135. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/bat/__init__.py +0 -0
  136. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/bat/detect.py +0 -0
  137. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/bat/model.py +0 -0
  138. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/bat/preview.py +0 -0
  139. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/bat/render.py +0 -0
  140. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/bat/wizard.py +0 -0
  141. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/commitizen/__init__.py +0 -0
  142. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/commitizen/detect.py +0 -0
  143. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/commitizen/model.py +0 -0
  144. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/commitizen/render.py +0 -0
  145. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/commitizen/validate.py +0 -0
  146. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/commitizen/wizard.py +0 -0
  147. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/docker/__init__.py +0 -0
  148. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/docker/detect.py +0 -0
  149. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/docker/model.py +0 -0
  150. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/docker/render.py +0 -0
  151. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/docker/validate.py +0 -0
  152. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/docker/wizard.py +0 -0
  153. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/lazygit/__init__.py +0 -0
  154. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/lazygit/detect.py +0 -0
  155. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/lazygit/model.py +0 -0
  156. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/lazygit/render.py +0 -0
  157. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/lazygit/validate.py +0 -0
  158. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/lazygit/wizard.py +0 -0
  159. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/precommit/__init__.py +0 -0
  160. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/precommit/detect.py +0 -0
  161. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/precommit/model.py +0 -0
  162. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/precommit/render.py +0 -0
  163. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/precommit/validate.py +0 -0
  164. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/precommit/wizard.py +0 -0
  165. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/reptyr/__init__.py +0 -0
  166. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/reptyr/wizard.py +0 -0
  167. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/starship/__init__.py +0 -0
  168. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/starship/fonts.py +0 -0
  169. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/starship/icons.py +0 -0
  170. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/starship/model.py +0 -0
  171. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/starship/preview.py +0 -0
  172. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/starship/render.py +0 -0
  173. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/configure/starship/wizard.py +0 -0
  174. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/doctor.py +0 -0
  175. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/function_runner.py +0 -0
  176. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/functions.schema.json +0 -0
  177. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/functions.yaml +0 -0
  178. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/functions_catalog.py +0 -0
  179. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/functions_registry.py +0 -0
  180. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/generic.py +0 -0
  181. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/links.schema.json +0 -0
  182. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/links.yaml +0 -0
  183. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/links_catalog.py +0 -0
  184. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/links_registry.py +0 -0
  185. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/mcp/__init__.py +0 -0
  186. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/profile.py +0 -0
  187. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/registry.py +0 -0
  188. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/snapshot.py +0 -0
  189. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/tools.yaml +0 -0
  190. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/ui.py +0 -0
  191. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/updates.py +0 -0
  192. {devstuff-2.15.0 → devstuff-2.16.0}/src/dev_setup/verbose.py +0 -0
  193. {devstuff-2.15.0 → devstuff-2.16.0}/tests/__init__.py +0 -0
  194. {devstuff-2.15.0 → devstuff-2.16.0}/tests/integration/__init__.py +0 -0
  195. {devstuff-2.15.0 → devstuff-2.16.0}/tests/integration/conftest.py +0 -0
  196. {devstuff-2.15.0 → devstuff-2.16.0}/tests/integration/test_agent_smoke.py +0 -0
  197. {devstuff-2.15.0 → devstuff-2.16.0}/tests/integration/test_agent_tui.py +0 -0
  198. {devstuff-2.15.0 → devstuff-2.16.0}/tests/integration/test_commitizen_config.py +0 -0
  199. {devstuff-2.15.0 → devstuff-2.16.0}/tests/integration/test_profile_apply.py +0 -0
  200. {devstuff-2.15.0 → devstuff-2.16.0}/tests/integration/test_tools.py +0 -0
  201. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_agent.py +0 -0
  202. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_agent_bridges.py +0 -0
  203. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_agent_completion.py +0 -0
  204. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_agent_loop.py +0 -0
  205. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_agent_sandbox.py +0 -0
  206. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_agent_tools.py +0 -0
  207. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_agent_wizard.py +0 -0
  208. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_apply_exec.py +0 -0
  209. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_apply_plan.py +0 -0
  210. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_apply_run.py +0 -0
  211. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_bundles.py +0 -0
  212. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_catalog.py +0 -0
  213. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_configure_ansible.py +0 -0
  214. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_configure_bat.py +0 -0
  215. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_configure_commitizen.py +0 -0
  216. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_configure_docker.py +0 -0
  217. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_configure_lazygit.py +0 -0
  218. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_configure_precommit.py +0 -0
  219. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_configure_reptyr.py +0 -0
  220. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_configure_starship.py +0 -0
  221. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_doctor.py +0 -0
  222. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_functions.py +0 -0
  223. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_generic.py +0 -0
  224. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_installed_version.py +0 -0
  225. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_lifecycle_cmds.py +0 -0
  226. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_links.py +0 -0
  227. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_mcp_classify.py +0 -0
  228. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_outdated_cmd.py +0 -0
  229. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_pin_support.py +0 -0
  230. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_plan_and_select.py +0 -0
  231. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_profile.py +0 -0
  232. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_profile_apply_cmd.py +0 -0
  233. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_profile_diff.py +0 -0
  234. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_profile_diff_cmd.py +0 -0
  235. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_profile_snapshot_cmd.py +0 -0
  236. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_registry.py +0 -0
  237. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_snapshot.py +0 -0
  238. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_ui.py +0 -0
  239. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_update_checker_parity.py +0 -0
  240. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_update_notes.py +0 -0
  241. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_updates.py +0 -0
  242. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_uv_probes.py +0 -0
  243. {devstuff-2.15.0 → devstuff-2.16.0}/tests/test_verbose.py +0 -0
@@ -1,3 +1,9 @@
1
+ ## v2.16.0 (2026-10-12)
2
+
3
+ ### Features
4
+
5
+ - **mcp**: M-2 — devstuff mcp over stdio, with the detach and supervisor
6
+
1
7
  ## v2.15.0 (2026-10-12)
2
8
 
3
9
  ### Features
@@ -688,6 +688,23 @@ and the tool cannot disagree. A parameter of `type: array` is always a list of s
688
688
  `devstuff mcp` server (spec in `docs/specs/mcp/`) gates tools by `mcp.core.classify` — `(impl, target)`, never
689
689
  the `mutating` label or the key — and a test fails when a bridge is added to `_BRIDGES` without a gate row.
690
690
 
691
+ **The MCP server** (`mcp/`, `commands/mcp_cmd.py`, spec in `docs/specs/mcp/`) — things that are load-bearing:
692
+ - **`core.py` is pure; the transports are not.** Gating, binding, JSON-RPC and the probe lifecycle are tested with
693
+ hand-built frames and a fake runner. Listing and calling read **one** `Toolbox`, so a tool that is off is absent
694
+ from `tools/list` *and* refused by `tools/call` — a list-only check passes when dispatch is wide open.
695
+ - **A request's `id` is echoed with its type, and a notification is the *absence* of the key**, never a falsy
696
+ value: Claude Code sends an integer `0` for `initialize`. Unknown methods are `-32601`, not `{}` — the real
697
+ client opens with `server/discover` and falls back to `initialize` only when told it is unknown.
698
+ - **The protocol channel is moved at the descriptor level** (`stdio.isolate_stdio`): private non-inheritable
699
+ `dup`s, then fd 1 → stderr and fd 0 → `/dev/null`. Anything that prints, however it does it, lands on stderr.
700
+ The test leaks through five routes and has a control showing the same leaks corrupt an un-isolated stream.
701
+ - **The server detaches from its terminal first** (`process.detach`): `/dev/null` stdin does *not* stop `sudo`
702
+ prompting on `/dev/tty`. `setsid`, else fork + supervisor (`EPERM` from a shell), then verify and fail closed.
703
+ The supervisor forwards `SIGHUP` as `SIGTERM` or a closed terminal orphans the server.
704
+ - **Reads are never blocked by an install; they are kept honest.** `generic._once` memos live as long as the
705
+ process, so `Dispatcher` clears them when a burst of reads starts and after every mutation (in `finally`), and
706
+ re-runs a read a mutation straddled. The advisory note is a *separate* content item so JSON stays parseable.
707
+
691
708
  **Security invariants — do not weaken these without deliberate thought:**
692
709
  - `Workspace.resolve()` in `agent/sandbox.py` is the *only* thing standing between the model and
693
710
  the filesystem. It resolves symlinks and `..` **before** the containment check; reordering that
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: devstuff
3
- Version: 2.15.0
3
+ Version: 2.16.0
4
4
  Summary: Development environment setup CLI for Linux
5
5
  Project-URL: Repository, https://github.com/thesawdawg/dev-setup-py
6
6
  Author-email: Sawyer <sawyerksu@gmail.com>
@@ -1159,6 +1159,33 @@ confirmation.
1159
1159
 
1160
1160
  ---
1161
1161
 
1162
+ ## MCP server (`devstuff mcp`)
1163
+
1164
+ `devstuff mcp` serves devstuff's tools to an MCP client over **stdio**. It is started *by* the client, not by
1165
+ hand. Register it with Claude Code:
1166
+
1167
+ ```bash
1168
+ claude mcp add devstuff -- devstuff mcp # read-only tools only
1169
+ claude mcp add devstuff -- devstuff mcp --allow-install # also install_tool
1170
+ ```
1171
+
1172
+ | Flag | Effect |
1173
+ |---|---|
1174
+ | *(none)* | `list_tools`, `search_catalog`, `tool_info`, `outdated`, `profile_diff` — nothing that changes the machine |
1175
+ | `--allow-install` | adds `install_tool`, which installs a catalog tool as you |
1176
+ | `--allow-functions` | adds every `type: script` function as `fn_<key>` |
1177
+ | `--list-tools` | print what these flags would expose, and which gate each tool sits behind; starts nothing |
1178
+
1179
+ A tool whose flag is off is not hidden but **absent and refused**: a call naming it is answered as an unknown tool.
1180
+ Workspace tools (`read_file`, `run_command`, …) never exist here — the client already has files and a shell.
1181
+
1182
+ The server has **no terminal**: an installer that needs a `sudo` password fails at once with a message telling the
1183
+ client to run `devstuff install <key>` in a terminal, rather than waiting for a password nobody can type.
1184
+ Logs (`-v`, `-vv`) go to stderr. HTTP and OpenAPI front ends are still to come; see
1185
+ [`docs/specs/mcp/`](docs/specs/mcp/).
1186
+
1187
+ ---
1188
+
1162
1189
  ## Agent
1163
1190
 
1164
1191
  `devstuff agent` opens an interactive session with a **local** model (via [Ollama](https://ollama.com))
@@ -1132,6 +1132,33 @@ confirmation.
1132
1132
 
1133
1133
  ---
1134
1134
 
1135
+ ## MCP server (`devstuff mcp`)
1136
+
1137
+ `devstuff mcp` serves devstuff's tools to an MCP client over **stdio**. It is started *by* the client, not by
1138
+ hand. Register it with Claude Code:
1139
+
1140
+ ```bash
1141
+ claude mcp add devstuff -- devstuff mcp # read-only tools only
1142
+ claude mcp add devstuff -- devstuff mcp --allow-install # also install_tool
1143
+ ```
1144
+
1145
+ | Flag | Effect |
1146
+ |---|---|
1147
+ | *(none)* | `list_tools`, `search_catalog`, `tool_info`, `outdated`, `profile_diff` — nothing that changes the machine |
1148
+ | `--allow-install` | adds `install_tool`, which installs a catalog tool as you |
1149
+ | `--allow-functions` | adds every `type: script` function as `fn_<key>` |
1150
+ | `--list-tools` | print what these flags would expose, and which gate each tool sits behind; starts nothing |
1151
+
1152
+ A tool whose flag is off is not hidden but **absent and refused**: a call naming it is answered as an unknown tool.
1153
+ Workspace tools (`read_file`, `run_command`, …) never exist here — the client already has files and a shell.
1154
+
1155
+ The server has **no terminal**: an installer that needs a `sudo` password fails at once with a message telling the
1156
+ client to run `devstuff install <key>` in a terminal, rather than waiting for a password nobody can type.
1157
+ Logs (`-v`, `-vv`) go to stderr. HTTP and OpenAPI front ends are still to come; see
1158
+ [`docs/specs/mcp/`](docs/specs/mcp/).
1159
+
1160
+ ---
1161
+
1135
1162
  ## Agent
1136
1163
 
1137
1164
  `devstuff agent` opens an interactive session with a **local** model (via [Ollama](https://ollama.com))
@@ -165,6 +165,7 @@ Serve devstuff's catalog-aware tools to any MCP or OpenAPI client, so an AI clie
165
165
  or inspect a tool instead of guessing at `apt` and `npm` itself.
166
166
 
167
167
  **Spec:** [`specs/mcp/`](specs/mcp/) — **approved**, 2026-10-11 (findings measured; two goals: Claude compatibility, OpenAPI coverage).
168
+ **Progress:** M-1 (bridges, classification) and M-2 (the stdio server, `devstuff mcp`) built 2026-10-12; M-3 (HTTP, REST, OpenAPI) and M-4 (conformance, `--print-config`, docs) remain.
168
169
 
169
170
  - Three framings, one dispatcher: MCP over stdio, MCP over HTTP, and OpenAPI/REST (`/openapi.json`, `/tools`).
170
171
  - Read-only tools by default (`list_tools`, `search_catalog`, `tool_info`, `outdated`, `profile_diff`);
@@ -12,7 +12,7 @@ targeting `master` from a branch cut **after** this spec merges (never stacked o
12
12
  | M | Delivers | Needs |
13
13
  |---|---|---|
14
14
  | **M-1** ✅ 2026-10-12 | Measure what remains of F-6/F-11: does sudo's line survive `_run`'s capture (FR-13)? Then `agent/bridges.py` + `agent_tools.yaml`: `outdated` and `profile_diff`; FR-4 test; the FR-1a classification table and its forcing test | — |
15
- | **M-2** | `src/dev_setup/mcp/`: `core.py` (classification, dispatch, gating, probe lifecycle FR-8a, JSON-RPC handling — pure), `stdio.py` (FR-11/11a/12/19, incl. the detach + supervisor), `commands/mcp_cmd.py` (stdio only) | M-1 |
15
+ | **M-2** ✅ 2026-10-12 | `src/dev_setup/mcp/`: `core.py` (classification, dispatch, gating, probe lifecycle FR-8a, JSON-RPC handling — pure), `stdio.py` (FR-11/11a/12/19, incl. the detach + supervisor), `commands/mcp_cmd.py` (stdio only) | M-1 |
16
16
  | **M-3** | `mcp/http.py`: `POST /mcp`, token/Host/Origin (FR-20, 24–28); then REST + OpenAPI (FR-21–23) | M-2 |
17
17
  | **M-4** | **G-1:** conformance tests (real SDK client; real `claude mcp list`); `--print-config` (FR-31). **G-2:** OpenAPI validity, both-direction coverage and the document-driven client (FR-22a–c). One live `tools/call` through Claude Code, with consent. README, CLAUDE.md section, specs index, roadmap | M-3 |
18
18
 
@@ -95,7 +95,7 @@ FR-13's message. Anything not run live is listed as not run.
95
95
  | Risk | Mitigation |
96
96
  |---|---|
97
97
  | Protocol drift: clients move to `2026-07-28` and beyond | Conformance test against the current SDK; FR-16 means a newer client falls back rather than failing; revisit when the fallback stops being offered |
98
- | The detach (FR-11a) changes process identity: Ctrl-C no longer reaches the server, and the fork path leaves a supervisor | The supervisor forwards `SIGINT`/`SIGTERM` and mirrors the exit status; tested under a pty. Built and measured in M-2 — until then the fork path is a design, not a measurement (F-11) |
98
+ | The detach (FR-11a) changes process identity: Ctrl-C no longer reaches the server, and the fork path leaves a supervisor | The supervisor forwards `SIGINT`/`SIGTERM` and mirrors the exit status; tested under a pty. Built and measured in M-2 under a pty (F-14); a closing terminal's `SIGHUP` is forwarded as `SIGTERM` so it cannot orphan the server |
99
99
  | `dup2` is process-wide and POSIX-only | `devstuff` targets Linux (README); the module refuses to start on a platform without `os.dup2`, with a message, rather than starting unprotected |
100
100
  | Claude changes its handshake again (it already moved from `initialize` to `server/discover`-first) | The `claude mcp list` test runs against whatever `claude` is installed, so a release that stops connecting fails the suite on the next run; FR-16 means an unknown method degrades rather than errors |
101
101
  | Claude Desktop can't be run here | The `claude-desktop` snippet is checked for shape only and the report says so; stdio is the transport it uses, and that path is covered by the Claude Code and SDK tests |
@@ -4,7 +4,9 @@
4
4
  **Status:** Approved 2026-10-11 with OQ-1/2/3/6 resolved as recommended (§5), plus two goals that outrank the
5
5
  rest (G-1, G-2 below). Findings F-1…F-11 were measured on 2026-10-11 (F-6 closed by F-11); the five points of
6
6
  the 2026-10-11 PR review are folded in (§5a). **M-1 built 2026-10-12** (the `outdated` / `profile_diff`
7
- bridges, FR-1a's classification in `mcp/core.py`, the FR-4 test, F-12/F-13); the server itself is not.
7
+ bridges, FR-1a's classification in `mcp/core.py`, the FR-4 test, F-12/F-13). **M-2 built 2026-10-12**: the
8
+ stdio server (`devstuff mcp`, FR-1–19, FR-29/30 for stdio) with the detach and supervisor measured (F-14); HTTP,
9
+ REST and OpenAPI (M-3) and `--print-config` (M-4) are not.
8
10
  **Authors:** Sawyer + Claude
9
11
  **Roadmap:** new (overlaps [M4](../../ROADMAP.md): the `outdated` agent tool is built once and serves both)
10
12
  **Builds on:** [`agent/`](../agent/) (the tool registry, `AgentTool.to_schema()` / `bind()` and the
@@ -329,8 +331,10 @@ When a requirement below conflicts with either, the goal wins. Each has a measur
329
331
  - **FR-30** Exit status: `0` on EOF/SIGINT/SIGTERM; `2` for usage errors; `1` if the HTTP port cannot be
330
332
  bound. A signal does **not** abort an in-flight install (killing apt half-way is worse than waiting):
331
333
  the server stops accepting new requests and exits when the running call returns. A second signal exits
332
- immediately. When FR-11a forked, the supervisor forwards both signals to the server and exits with its
333
- status, so a terminal's Ctrl-C behaves as above even though the server no longer has the terminal.
334
+ immediately (status `128+N`). When FR-11a forked, the supervisor forwards both signals — and **`SIGHUP` as
335
+ `SIGTERM`**, since a closing terminal sends it and the detached server would otherwise be orphaned and keep
336
+ running (F-14) — to the server and exits with its status (a signalled server reads as `128+N`), so a
337
+ terminal's Ctrl-C behaves as above even though the server no longer has the terminal.
334
338
  - **FR-31 — `--print-config TARGET`** (G-1) prints a ready-to-paste snippet for the flags given, then exits
335
339
  `0` without starting a server. Targets: `claude-code` (the exact `claude mcp add` command for stdio, and
336
340
  for `--http` the `--transport http … --header "Authorization: Bearer $(cat <token file>)"` form),
@@ -420,7 +424,28 @@ When a requirement below conflicts with either, the goal wins. Each has a measur
420
424
 
421
425
  *Consequence:* FR-11a and FR-13. Not measured: an interactive Claude Code session (only `mcp list`);
422
426
  a client launched from a desktop with no terminal at all (there `/dev/tty` is absent anyway); the fork
423
- supervisor itself — it is a design, to be built and measured in M-2.
427
+ supervisor itself — measured in M-2 (F-14).
428
+ - **F-14 — M-2, measured against the built server (2026-10-12).**
429
+ *Detach.* Under a real pty (a session leader with a controlling terminal, as a shell hands it): the
430
+ process-group-leader case raised `EPERM` from `setsid`, forked, and the child had its own session, a
431
+ different parent and **no reachable `/dev/tty`**; the same probe without the detach **could** open it (the
432
+ control). In the detached child `sudo -k` then `sudo true` exited non-zero at once with `A terminal is
433
+ required to authenticate` and never prompted. The supervisor forwarded `SIGINT`/`SIGTERM`, mirrored the
434
+ server's exit status (7), and read a `SIGKILL`ed server as 137. *Not covered:* an interactive Claude Code
435
+ session, and a client launched with no terminal at all.
436
+ *Decisions the spec did not make:* (1) the supervisor also maps **`SIGHUP` → `SIGTERM`** (FR-30 above);
437
+ (2) each request runs on its own thread, because FR-8 says a read is never blocked and a stdio client sends
438
+ a `tools/list` while an install is still running on the same pipe; (3) EOF waits for requests still
439
+ running, then exits `0` (FR-30's "do not abort an install", applied to a client that went away); (4) the
440
+ channel's write end is **unbuffered**: a frame a dead client never took must not sit in a buffer and fail
441
+ again at interpreter exit; (5) a stdio line over 1 MiB is answered `-32600` with `id: null` and the rest of
442
+ the line is discarded, so its tail is not read as the next frame (FR-18 only says "refused"); (6)
443
+ `InstallFailed` (a `SandboxError` subclass raised by `bridges.install_tool`) is how the server tells an
444
+ installer failure from "unknown tool" when it adds FR-13's hint.
445
+ *Clients.* The official SDK client (`mcp` 2.3.0) completed `server/discover` → `initialize` →
446
+ `tools/list` → `tools/call` over stdio: 5 tools read-only, 13 with both flags; `install_tool` refused as an
447
+ unknown tool without its flag, bad arguments a tool error. Claude Code 2.1.296 `claude mcp list` reported
448
+ `✔ Connected` for the stdio server.
424
449
  - **F-12 — the agent catalog had no list-typed parameter (found building M-1).** `outdated`'s `packages`
425
450
  (FR-9) is a list of keys, and `agent/catalog.py`'s `PARAM_TYPES` was `string`, `integer`, `number`,
426
451
  `boolean`. Decision: add `array` — always an array of strings, advertised as
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "devstuff"
3
- version = "2.15.0"
3
+ version = "2.16.0"
4
4
  description = "Development environment setup CLI for Linux"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -10,6 +10,12 @@ from dev_setup.agent.config import AgentConfig
10
10
  from dev_setup.agent.sandbox import SandboxError, Workspace
11
11
 
12
12
 
13
+ class InstallFailed(SandboxError):
14
+ """An installer ran and failed. A subclass so the local agent handles it as it always did;
15
+ the MCP server tells it apart from "unknown tool" to add the FR-13 hint (it cannot answer a
16
+ password prompt, so the client has to be told where to run the install instead)."""
17
+
18
+
13
19
  def _tool_line(tool) -> str:
14
20
  state = "installed" if tool.is_installed() else "available"
15
21
  return f"{tool.key} [{state}] {tool.description}"
@@ -141,7 +147,7 @@ def install_tool(ws: Workspace, config: AgentConfig, args: dict[str, Any]) -> st
141
147
  try:
142
148
  version = tool.install()
143
149
  except (subprocess.CalledProcessError, RuntimeError) as exc:
144
- raise SandboxError(f"installing {tool.key} failed: {exc}") from exc
150
+ raise InstallFailed(f"installing {tool.key} failed: {exc}") from exc
145
151
 
146
152
  return f"Installed {tool.name}" + (f" ({version})" if version else "")
147
153
 
@@ -33,6 +33,7 @@ def _register_commands() -> None:
33
33
  from dev_setup.commands.install_cmd import install_cmd
34
34
  from dev_setup.commands.links_cmd import links_cmd
35
35
  from dev_setup.commands.list_cmd import list_cmd
36
+ from dev_setup.commands.mcp_cmd import mcp_cmd
36
37
  from dev_setup.commands.outdated_cmd import outdated_cmd
37
38
  from dev_setup.commands.profile_cmd import profile_cmd
38
39
  from dev_setup.commands.remove_cmd import remove_cmd
@@ -61,6 +62,7 @@ def _register_commands() -> None:
61
62
  cli.add_command(links_cmd, "link")
62
63
  cli.add_command(skills_cmd, "skills")
63
64
  cli.add_command(agent_cmd, "agent")
65
+ cli.add_command(mcp_cmd, "mcp")
64
66
 
65
67
  _add_verbose_option(cli)
66
68
 
@@ -0,0 +1,90 @@
1
+ from __future__ import annotations
2
+
3
+ import sys
4
+
5
+ import click
6
+
7
+ from dev_setup.catalog import CatalogError
8
+ from dev_setup.mcp import process, stdio
9
+ from dev_setup.mcp.core import Dispatcher, Toolbox
10
+
11
+
12
+ def _warn(message: str) -> None:
13
+ click.echo(f"devstuff mcp: {message}", err=True)
14
+
15
+
16
+ def _toolbox(allow_install: bool, allow_functions: bool) -> Toolbox:
17
+ from dev_setup.agent import registry as agent_registry
18
+
19
+ return Toolbox.from_agent(
20
+ agent_registry.build(), allow_install=allow_install, allow_functions=allow_functions, warn=_warn
21
+ )
22
+
23
+
24
+ def _banner(box: Toolbox, allow_install: bool, allow_functions: bool) -> str:
25
+ gated = [
26
+ label
27
+ for label, on in (("install_tool", allow_install), ("functions", allow_functions))
28
+ if on
29
+ ]
30
+ return (
31
+ f"devstuff mcp: serving {len(box.names())} tools on stdio "
32
+ f"({'+ ' + ', '.join(gated) if gated else 'read-only; install_tool and functions are off'})"
33
+ )
34
+
35
+
36
+ @click.command("mcp")
37
+ @click.option(
38
+ "--allow-install", is_flag=True,
39
+ help="Expose install_tool, which installs a catalog tool as you. Off by default: absent and refused.",
40
+ )
41
+ @click.option(
42
+ "--allow-functions", is_flag=True,
43
+ help="Expose every `type: script` function (fn_<key>). Off by default: absent and refused.",
44
+ )
45
+ @click.option(
46
+ "--list-tools", "list_tools", is_flag=True,
47
+ help="Print the tools these flags would expose, and which gate each sits behind. Starts nothing.",
48
+ )
49
+ def mcp_cmd(allow_install: bool, allow_functions: bool, list_tools: bool) -> None:
50
+ """Serve devstuff's tools to an MCP client over stdio.
51
+
52
+ Reads JSON-RPC from stdin and answers on stdout — it is meant to be started by a client
53
+ (Claude Code, Claude Desktop), not by hand. Only read-only tools are exposed unless a flag
54
+ says otherwise, and a tool that is off does not merely hide: a call naming it is refused.
55
+
56
+ The server has no terminal. An installer that needs a password fails at once rather than
57
+ waiting for one nobody can type; run `devstuff install <key>` in a terminal for those.
58
+ """
59
+ if list_tools:
60
+ _print_tools(_load(allow_install, allow_functions))
61
+ return
62
+
63
+ # Detach first, before the fd move and before anything that could run an installer (FR-11a).
64
+ # Under a shell this forks and the original process becomes a supervisor that never returns.
65
+ process.detach()
66
+ try:
67
+ process.require_no_terminal(gated=allow_install or allow_functions, warn=_warn)
68
+ except process.TerminalReachable as exc:
69
+ click.echo(f"error: {exc}", err=True)
70
+ sys.exit(1)
71
+
72
+ box = _load(allow_install, allow_functions)
73
+ click.echo(_banner(box, allow_install, allow_functions), err=True)
74
+ sys.exit(stdio.run(Dispatcher(box)))
75
+
76
+
77
+ def _load(allow_install: bool, allow_functions: bool) -> Toolbox:
78
+ try:
79
+ return _toolbox(allow_install, allow_functions)
80
+ except CatalogError as exc:
81
+ click.echo(f"error: {exc}", err=True)
82
+ sys.exit(1)
83
+
84
+
85
+ def _print_tools(box: Toolbox) -> None:
86
+ width = max((len(n) for n in box.names()), default=0)
87
+ for name in box.names():
88
+ tool = box.get(name)
89
+ first = (tool.description.splitlines() or [""])[0]
90
+ click.echo(f"{name:<{width}} [{box.gate(name).value}] {first}")