miller/pkg/output
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
..
channel_writer.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
doc.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
file_output_handlers.go Add mlr mcp MCP server + agent playbook, with a --no-shell gate (#2098 PR7) (#2133) 2026-07-03 19:41:49 -04:00
README.md Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
record_writer.go The package version must match the major tag version (#1654) 2024-09-20 12:10:11 -04:00
record_writer_csv.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
record_writer_csv_colorizer.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
record_writer_csvlite.go The package version must match the major tag version (#1654) 2024-09-20 12:10:11 -04:00
record_writer_dcf.go Some fixes for staticcheck (#2006) 2026-03-03 09:27:03 -05:00
record_writer_dkvp.go The package version must match the major tag version (#1654) 2024-09-20 12:10:11 -04:00
record_writer_dkvpx.go Add DKVPX file format (#2002) 2026-03-02 22:35:08 -05:00
record_writer_factory.go Add DKVPX file format (#2002) 2026-03-02 22:35:08 -05:00
record_writer_json_jsonl.go Fix govet lint findings; fix masked unset-on-array error path (#2129) 2026-07-03 10:31:08 -04:00
record_writer_markdown.go Fix column alignment for wide and combining Unicode chars (#1520, #379) (#2061) 2026-05-17 12:12:54 -04:00
record_writer_nidx.go The package version must match the major tag version (#1654) 2024-09-20 12:10:11 -04:00
record_writer_pprint.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
record_writer_tsv.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
record_writer_xtab.go Fix column alignment for wide and combining Unicode chars (#1520, #379) (#2061) 2026-05-17 12:12:54 -04:00
record_writer_yaml.go fix: preserve key order in YAML output (#2034) 2026-04-12 09:43:09 -04:00

Logic for formatting output records as strings to standard output.

There is one record-writer type per supported output file format, and a factory method.