mcp-wireshark: Command for Claude Code

.claude/commands/add-tool.md

add-tool is a command for Claude Code from khuynh22/mcp-wireshark. It costs 0 tokens per session (1,027 once invoked), scanned A, original, MIT.

A command that scaffolds a new MCP tool for a project. MCP is a way for an AI assistant to call tools with defined inputs, such as a tool that runs a Wireshark network-traffic command.

In plain words
What is it for?
Use it to create a new tool schema, place its implementation in the correct module, define parameters, and connect it to a specified tshark command.
Why use it?
It gathers the design details needed before generating a tool and keeps read-only tools separate from tools that capture traffic or write files. It also requires standard metadata describing each tool’s permissions and side effects.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is khuynh22/mcp-wireshark's own configuration. It tells Claude Code how to work on mcp-wireshark itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-wireshark configures →

Reuse

Borrowing it

Nothing to install: this file belongs to khuynh22/mcp-wireshark. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/khuynh22/mcp-wireshark/main/.claude/commands/add-tool.md
Clone the repo
git clone --depth 1 https://github.com/khuynh22/mcp-wireshark

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for add-tool

README.md
[![agentmods](https://agentmods.dev/badge/commands/khuynh22/mcp-wireshark/add-tool/github.svg)](https://agentmods.dev/commands/khuynh22/mcp-wireshark/add-tool)
Your own site
<a href="https://agentmods.dev/commands/khuynh22/mcp-wireshark/add-tool"><img src="https://agentmods.dev/badge/commands/khuynh22/mcp-wireshark/add-tool/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for add-tool

Your own site · 80×15
<a href="https://agentmods.dev/commands/khuynh22/mcp-wireshark/add-tool"><img src="https://agentmods.dev/badge/commands/khuynh22/mcp-wireshark/add-tool.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,027 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.01027
Opus 5 $0.00000 $0.00513
Sonnet 5 $0.00000 $0.00205
Haiku 4.5 $0.00000 $0.00103

Measured 11d ago against content hash 411eaea73966, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

add-tool 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 11d 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.

.claude/commands/add-tool.md · 124 lines

How it starts

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

Scaffold a new MCP tool for this project following all project conventions.

Ask the user for:

  1. Tool name (snake_case, e.g. filter_goose)
  2. Description — one sentence, what does this tool do for an AI assistant?
  3. Read or write — does this tool only read state (file analysis, listing, version checks) or does it capture traffic / write files? This decides which module the tool lives in.
  4. Parameters — name, type, required/optional, description for each
  5. tshark command — what tshark arguments will this run? (e.g. -r $file -q -z follow,tcp,ascii,$stream_id)

Then generate all four required changes in one response.

If read → add to src/mcp_wireshark/read_tools.py. If write → add to src/mcp_wireshark/write_tools.py.

Step 1 — Tool schema

Append a Tool(...) entry to the READ_TOOLS or WRITE_TOOLS list. Always include ToolAnnotations(...):

For read tools:

annotations=ToolAnnotations(title="Human title", readOnlyHint=True, openWorldHint=False),

For write tools:

annotations=ToolAnnotations(
    title="Human title",
    readOnlyHint=False,
    destructiveHint=False,
    idempotentHint=False,
    openWorldHint=True,
),

Use "type": "number" for numeric params, "type": "string" for strings. Mark required params in the "required" array.

Step 2 — Handler function

Place inside the same module (read_tools.py or write_tools.py). Follow this exact pattern:

async def handle_TOOL_NAME(arguments: dict[str, Any]) -> list[TextContent]:
    """One-line description."""
    file_path = arguments["file_path"]
    # ... extract other params with .get() for optional ones

    try:
        validated_path = validate_file_path(file_path)
        if not validated_path.exists():
            return [TextContent(type="text", text=f"Error: File not found: {file_path}")]
        file_path = str(validated_path)

        # validate display_filter if present
        # if display_filter:
        #     display_filter = validate_display_filter(display_filter)

        args = ["-r", file_path, ...]  # build tshark args
        output = await run_tshark(args, timeout=60)

        if output.strip():
            return [TextContent(type="text", text=f"Result:\n\n{output}")]
        return [TextContent(type="text", text="No results found.")]

    except Exception as e:
        return [TextContent(type="text", text=f"Error in TOOL_NAME: {e}")]

Read the full file on GitHub · 124 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. 11d ago First seen · 124 lines · 0 tokens per session scan A 411eaea73966

Subscribe to this mod's changes

add-tool is a command published in the GitHub repository khuynh22/mcp-wireshark (57 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,027 tokens. 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-30.