miller/pkg/lib
John Kerl 41f5188bd0
Add mlr mcp MCP server + agent playbook, with a --no-shell gate (#2098 PR7) (#2133)
* Plan: flesh out PR7 (MCP server + Agent Skill) design

stdio transport (no HTTP port), mlr mcp terminal in the main binary,
SDK-vs-handroll decision, tool list, in-process vs subprocess split,
run-tool safety (--no-shell prerequisite), single-sourced skill, tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Add mlr mcp: MCP server + agent playbook; --no-shell gate (#2098 PR7)

New terminal `mlr mcp` runs a Model Context Protocol server over stdio
(spawned by MCP clients; no network port), exposing five tools --
list_capabilities, which, validate_dsl, describe_data, run -- plus an
agent playbook as MCP prompt/resource. Catalog tools are served
in-process from the help registries; the rest subprocess this same
binary with MLR_ERRORS_JSON=1, a timeout, and an output cap.

Prerequisite: a new --no-shell flag / MLR_NO_SHELL env var (one-way
gate) disables the DSL system/exec functions, piped redirects, and
--prepipe/--prepipex; the MCP server sets it on the commands it runs
unless started with --allow-shell.

Adds the github.com/modelcontextprotocol/go-sdk dependency.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Force LF checkout for the embedded SKILL.md (Windows CI fix)

go:embed embeds checkout bytes, so a CRLF checkout on Windows made the
embedded playbook differ per platform and failed
TestPlaybookHasFrontmatter. Pin the file to eol=lf in .gitattributes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Move no-shell test DSL into per-case mlr files (Windows CI fix)

Inline single-quoted DSL in cmd files is mangled by the Windows shell
(single quotes are not quote characters there); the harness's
put -f ${CASEDIR}/mlr pattern avoids shell quoting entirely.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 19:41:49 -04:00
..
doc.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
docurl.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
file_readers.go Convert if/else-if chains to typed switch statements (staticcheck QF1003) (#2112) 2026-06-28 18:27:42 -04:00
getoptify.go Add new tail -n +N, head -n -N options (#2071) 2026-06-21 10:34:16 -04:00
halfpipe.go Add mlr mcp MCP server + agent playbook, with a --no-shell gate (#2098 PR7) (#2133) 2026-07-03 19:41:49 -04:00
latin1.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
latin1_test.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
logger.go Strip dead code from pkg/ (#2121) 2026-07-01 19:32:13 -04:00
mlrmath.go Performance and style fixes (#1981) 2026-02-18 09:19:31 -05:00
ordered_map.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
paragraph.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
rand.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
readfiles.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
README.md Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
regex.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
regex_test.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
shell_gate.go Add mlr mcp MCP server + agent playbook, with a --no-shell gate (#2098 PR7) (#2133) 2026-07-03 19:41:49 -04:00
stats.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
time.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
time_test.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
tsv_codec.go Convert if/else-if chains to typed switch statements (staticcheck QF1003) (#2112) 2026-06-28 18:27:42 -04:00
tsv_codec_test.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
unbackslash.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
unbackslash_test.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
util.go Strip dead code from pkg/ (#2121) 2026-07-01 19:32:13 -04:00

These are basic library routines for Miller.