mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-17 16:38:54 +00:00
* 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>
31 lines
1.4 KiB
Text
31 lines
1.4 KiB
Text
Usage: mlr mcp [options]
|
|
Runs a Model Context Protocol (MCP) server exposing Miller to AI agents.
|
|
|
|
The server speaks JSON-RPC over stdin/stdout (MCP "stdio" transport); it is
|
|
meant to be spawned by an MCP client rather than run interactively. Example
|
|
registration, for Claude Code:
|
|
|
|
claude mcp add miller -- mlr mcp
|
|
|
|
Tools exposed:
|
|
list_capabilities the mlr help --as-json catalog/index, filterable
|
|
which intent -> ranked matching verbs/functions/flags/keywords
|
|
validate_dsl parse/type-check a put/filter expression without running it
|
|
describe_data field names/types/cardinality/values of input data
|
|
run run an mlr command line
|
|
|
|
Also exposed: an agent playbook, as MCP prompt "miller-playbook" and MCP
|
|
resource "miller://playbook", encoding the discover -> constrain -> validate
|
|
-> run loop.
|
|
|
|
Commands started by the run/validate_dsl/describe_data tools are run with
|
|
MLR_NO_SHELL=1 -- the DSL system/exec functions, piped redirects, and
|
|
--prepipe/--prepipex fail cleanly -- and with MLR_ERRORS_JSON=1 so errors
|
|
come back structured.
|
|
|
|
Options:
|
|
--allow-shell Do not set MLR_NO_SHELL=1 on subprocesses, re-enabling
|
|
the DSL system/exec functions for agent-run commands.
|
|
--timeout {seconds} Default wall-clock limit for the run tool (default 60).
|
|
--max-output-bytes {n} Cap captured stdout/stderr per command (default 1048576).
|
|
-h or --help Show this message.
|