ref-cli-tool-wrapping

A reference for configuring Deephaven MCP servers, which connect agents to Deephaven data and tools.

In plain words
What is it for?
It is for adding or changing server settings, configuration models, and environment-variable handling according to the project's conventions.
Why use it?
It explains where settings belong and how JSON5 files, environment values, templates, and validation work together.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/deephaven/deephaven-mcp/ref-cli-tool-wrapping
Any agent
npx skills add deephaven/deephaven-mcp --skill ref-cli-tool-wrapping
Clone the repo
git clone --depth 1 https://github.com/deephaven/deephaven-mcp

Made for: Claude Code, Codex.

Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,944 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00074 $0.03944
Opus 5 $0.00037 $0.01972
Sonnet 5 $0.00015 $0.00789
Haiku 4.5 $0.00007 $0.00394

Measured 2d ago against content hash 5c8cd89a250b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ref-cli-tool-wrapping scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/ref-cli-tool-wrapping/SKILL.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLI tool-wrapping conventions

Runtime dhcli commands (session, system, table, catalog, pq, docs) wrap MCP tools. This skill is the how; the why is docs/design/CLI_TOOL_WRAPPING.md. cli-command-add loads it for any wrapper verb and supplies the general click/Pattern-B/error conventions; this skill adds the wrapper-specific concern. Apply ref-cli-help-standards for the help contract. It does not apply to daemon/config (not tool wrappers) or to MCP server tools themselves (ref-mcp-module-organization).

The shared flow

Every daemon-backed wrapper routes through cli/_commands/_wrapping.py, never a hand-rolled daemon/MCP dance (a direct-URL wrapper — category 5 below — skips the acquire flow but still reuses _wrapping.py's fetch/render pieces). Two top-level helpers cover the two output shapes; neither drops a partial-but-successful result's diagnostic siblings (the partial_result block from enterprise-session discovery, and a truncating tool's is_complete: false flag) — the whole-payload helper carries them in the stdout envelope, the shaping helper re-surfaces them on stderr:

  • call_and_echo(runtime, "<tool>", *, retry_command, arguments) — whole-payload verb: emit the tool's success payload as-is on stdout (the envelope carries any diagnostics).
  • call_and_echo_field(runtime, "<tool>", *, retry_command, arguments, field, default) — shaping verb: emit one payload field (e.g. a list verb's array) on stdout, and surface diagnostic siblings on stderr. For a truncating tool, pass truncation_hint="Raise --max-rows or narrow with --filter." (naming the verb's own flags) to extend the generic is_complete: false warning. Use this instead of hand-rolling call_for_payload + echo_payload, which would drop the diagnostics.
# Whole-payload verb (emit the tool's result as-is):
await call_and_echo(
    runtime, "<tool>", retry_command="dhcli <noun> <verb>", arguments=arguments
)

# Shaping verb (emit one field as a bare value):
await call_and_echo_field(
    runtime, "<tool>", retry_command="dhcli <noun> <verb>",
    arguments=arguments, field="<key>", default=[],
)

Read the full file on GitHub · 125 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 125 lines · 74 tokens per session scan A 5c8cd89a250b

Subscribe to this mod's changes

ref-cli-tool-wrapping is a skill published in the GitHub repository deephaven/deephaven-mcp (5 stars, last pushed 4d ago), licensed Apache-2.0. It adds 74 tokens to every session and 3,944 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.