Conversation
Track C of phase4-plan.md §4. Plus a Track-B carry-over: the
--tool/--query CLI surface the plan framed as B-deliverable but that
landed here alongside the smoke.sh that depends on it.
### --tool / --query CLI surface
``m-dev-tools-mcp`` now has two modes:
* **MCP server (default)** — no args boots the stdio transport for
Claude Code / Codex / Continue.
* **CLI smoke** — ``--tool route_intent --query "…"`` /
``--tool describe --typed-id "…"`` / ``--tool verify --repo "…"``
runs a single tool call out of process and prints the JSON
response on stdout. Lets scripts (and CI) verify the server
resolves the canonical query without spinning up an MCP client.
Exit codes:
* ``0`` — success
* ``2`` — usage error (unknown tool, missing required flag)
* ``3`` — DiscoveryError from the tool; stdout carries a structured
``{"error": true, "code": "...", "message": "..."}`` blob so shells
can switch on the code.
argparse uses ``exit_on_error=False`` so ``main(argv)`` returns the
rc cleanly under unit-test control. Conditional-required-flag
validation (``--query`` required only when ``--tool=route_intent``,
etc.) is enforced post-parse to keep the error messages specific.
11 new TDD cases in ``tests/test_cli.py`` cover: --version still
works (Track A contract), each tool's happy path, --tool unknown,
each tool's missing-required-flag, route_intent no-match → exit 0
with ``[]``, DiscoveryError → exit 3 with structured blob, and an
end-to-end subprocess smoke that hits the live catalog (skipped on
network failure to avoid flakes).
### examples/claude-code/
* ``.mcp.json`` — uvx-from-git config; pins to ``main`` so new
catalog merges show up on next server restart.
* ``README.md`` — install paths (uvx + release wheel), Claude Code
registration steps, "other MCP clients" note, smoke-test pointer.
* ``smoke.sh`` — shells the canonical ``route_intent("parse JSON in
M")`` query through the new CLI surface and asserts
``"module:m-stdlib#STDJSON"`` lands in the response. Supports
``M_DEV_TOOLS_MCP_BIN=…`` to point at a local venv install for
fast iteration (uvx would clone the repo).
* ``session.md`` — template for the recorded Claude Code session
Track C calls for. The session itself can't be auto-run from
inside Claude Code; this file describes the steps and reserves
placeholders the user fills in once after running the session
locally. The always-on assertion is smoke.sh; this is the
once-per-release human-eyes confirmation.
### Test plan
* 41/41 pytest (30 prior + 11 new CLI)
* ruff clean, mypy strict clean (4 source files)
* check-manifest + check-agents clean
* ``examples/claude-code/smoke.sh`` exits 0 locally via
``M_DEV_TOOLS_MCP_BIN=$PWD/.venv/bin/m-dev-tools-mcp``
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Track C of phase4-plan.md §4. Plus a Track-B carry-over: the
--tool/--queryCLI surface the plan framed as a B-deliverable but that landed here alongside thesmoke.shthat depends on it.--tool / --queryCLI surfacem-dev-tools-mcpnow has two modes:--tool route_intent --query "…"/--tool describe --typed-id "…"/--tool verify --repo "…"runs a single tool call out of process and prints the JSON response on stdout. Lets scripts (and CI) verify the server resolves the canonical query without spinning up an MCP client.Exit codes:
023DiscoveryErrorfrom the tool; stdout carries a{"error": true, "code": "…", "message": "…"}blob so shells can switch on the codeargparse uses
exit_on_error=Falsesomain(argv)returns the rc cleanly under unit-test control. Conditional-required-flag validation (--queryrequired only when--tool=route_intent, etc.) is post-parse so error messages are specific.examples/claude-code/.mcp.json— uvx-from-git config; pins tomainso new catalog merges show up on next server restart.README.md— install paths (uvx + release wheel), Claude Code registration steps, "other MCP clients" note.smoke.sh— shells the canonicalroute_intent("parse JSON in M")query through the new CLI surface and asserts"module:m-stdlib#STDJSON"lands in the response. SupportsM_DEV_TOOLS_MCP_BIN=…to point at a local venv install for fast iteration (default usesuvxwhich clones the repo).session.md— template for the recorded Claude Code session Track C calls for. The session itself can't be auto-run from inside Claude Code; this file describes the steps and reserves placeholders the user fills in once after running the session locally.smoke.shis the always-on automated assertion; this is the once-per-release human-eyes confirmation.Test plan
make check-manifest+make check-agentscleanexamples/claude-code/smoke.shexits 0 locally viaM_DEV_TOOLS_MCP_BIN=$PWD/.venv/bin/m-dev-tools-mcp— response was["module:m-stdlib#STDJSON"]What's NOT in this PR
session.md— the template stays unfilled until you (the user) record a real Claude Code session. The PR is mergeable without it;smoke.shcovers the automated half of the Track C verification.