example-new

A scaffolding command for creating a new mcpkit example using the repository’s documented conventions. It supports a standard scripted walkthrough or an MCP Apps-style example with an HTML interface and iframe bridge.

In plain words
What is it for?
Use it to create a new kebab-case example, optionally with the UI-based MCP Apps structure, after choosing its name, location, description, and tools.
Why use it?
It removes repetitive setup work and keeps new examples aligned with the project’s conventions. It also checks the destination and requires key details before generating files.

Command for Claude Code

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 commands/panyam/mcpkit/example-new
Clone the repo
git clone --depth 1 https://github.com/panyam/mcpkit

Made for: Claude Code.

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,837 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.00000 $0.01837
Opus 5 $0.00000 $0.00919
Sonnet 5 $0.00000 $0.00367
Haiku 4.5 $0.00000 $0.00184

Measured yesterday against content hash 9f9bcad193fc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

example-new 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 yesterday.

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/example-new.md · 60 lines

How it starts

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

Scaffold a new mcpkit example matching the conventions in examples/CONVENTIONS.md.

Args

  • $1 — example name (required, kebab-case, e.g. progress-reports). Used as both the directory name and the demokit Dir(...) value.
  • --ui — optional flag. Scaffold an MCP-Apps-style example (HTML asset + iframe bridge + no walkthrough.go) instead of the default scripted-walkthrough shape.

If $1 is missing, ask the user for one before doing anything else.

Steps

  1. Read examples/CONVENTIONS.md before generating anything. It is the source of truth — if it has changed since this skill was written, follow the doc, not this file. If anything below contradicts CONVENTIONS.md, CONVENTIONS.md wins.

  2. Confirm the destination:

    • Path: examples/<name>/ (or examples/events/<name>/ if the user says it's an events example — ask if ambiguous).
    • Refuse if the directory already exists. Suggest /example-audit <name> instead.
  3. Ask the user three questions (one shot, not back-and-forth):

    • One-paragraph description of what the example demonstrates (goes into demokit.Description(...) and the README intro).
    • List of MCP tools the example will register (names + one-line each). If UI, also which ones ship apps.
    • Whether the example needs static fixtures (testdata/) or live event injection (/inject POST endpoint) — see CONVENTIONS.md §3 "Fixtures." Skip for UI examples.
  4. Generate files matching the layout in CONVENTIONS.md §1:

    Non-UI (default):

    • main.go — dual-mode dispatcher + serve() using common.MCPServerOptions(*addr, "[mcp] ") for the listen + canonical logger middleware (single-line replacement for the older 12-line block; see CONVENTIONS.md §2), srv.ListenAndServe(server.WithStreamableHTTP(true)), demokit.FilterArgs(os.Args[1:], demokit.BoolFlag("--serve"), demokit.ValueFlag("--url")) (add more ValueFlag(...) for example-specific flags). Append example-specific options (server.WithListTTL, server.WithExtension, etc.) onto the slice returned by MCPServerOptions. If the example needs side endpoints (e.g. /inject), wire them via server.WithMux(...) — never hand-roll an http.Server{}. Add the examples/common dependency to go.mod (require github.com/panyam/mcpkit/examples/common ... + replace ... => ../common).
    • walkthrough.gorunDemo() skeleton from CONVENTIONS.md §3. Pre-fill: title, Dir("<name>"), the description from step 3, two actors (Host / Server), a Setup section pointing to just serve, one placeholder Step() per tool with // TODO markers in the Run() body for the user to fill in, the closing "Where to look in the code" Section(), and common.SetupRenderer(demo) + demo.Execute(). Use common.ServerURL() (no args) as the default endpoint — honors --url, $MCPKIT_SERVER_URL, then falls back to :8080. Error-path steps use common.PrintRPCError(err, wantReason); pass wantReason="" unless asserting a specific spec-defined reason.
    • README.md — Quick Start (just serve / just demo), What it demonstrates (mirrors the step list), Architecture placeholder (Mermaid block stub if the topology is non-trivial — leave blank otherwise), Where to look in the code (mirrors walkthrough.go).
    • justfile — exactly the four baseline recipes (demo, serve, readme, build) with doc comments above each recipe and default: demo. No example-specific extras at scaffold time — the user adds those after.
    • Makefile — the make twin of the justfile during the transition: the same four baseline targets (demo, serve, readme, build) with ## help-text comments, .PHONY line, .DEFAULT_GOAL := demo.
    • go.mod — module name github.com/panyam/mcpkit/examples/<name> (or .../examples/events/<name>), Go 1.23+, dependencies on github.com/panyam/mcpkit/{core,server,client} and github.com/panyam/demokit at the version currently used by examples/file-inputs/go.mod. Add a local replace github.com/panyam/mcpkit => ../.. directive (relative path from the new example).
    • testdata/ — only if the user said static fixtures in step 3. Empty directory with a .gitkeep is fine; user adds the actual files.

Read the full file on GitHub · 60 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. yesterday First seen · 60 lines · 0 tokens per session scan A 9f9bcad193fc

Subscribe to this mod's changes

example-new is a command published in the GitHub repository panyam/mcpkit (5 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,837 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-31.