No description
This repository has been archived on 2026-06-17. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Go 94.9%
  • Shell 2.8%
  • Makefile 2.3%
Find a file
Kai Siren 8845e2536d
Some checks failed
ci / test (push) Has been cancelled
ci / lint (push) Has been cancelled
ci / govulncheck (push) Has been cancelled
ci / docs (push) Has been cancelled
codeql / analyze (go) (push) Has been cancelled
pages / build (push) Has been cancelled
pages / deploy (push) Has been cancelled
chore: clean up code-comments violations + adopt agentic-os v0.2.8
Sweep cli-mcp for v0.2.8 pre-commit suite compatibility:

- Compress code-comment blocks to <=2 contiguous lines / 90-char cap.
- Move durable godoc detail into docs/attach.md, climcp.md, schema.md,
  serve.md, session.md, godoc-snapshot.md, lockdown.md.
- Regenerate godoc-current.txt against the trimmed docstrings.
- Bump .pre-commit-config.yaml rev v0.2.6 -> v0.2.8.
- Adopt check-yaml --unsafe so mkdocs.yml's python-tagged emoji
  extension parses.
- Fold per-example READMEs (examples/*/README.md, banned outside
  docs/) into docs/examples.md.
- Trim CODE_OF_CONDUCT.md + docs/CODE_OF_CONDUCT.md under the
  4000-char cap, pointing to upstream for the standard enforcement
  ladder.
- Tighten docs/FEATURES.md under the 4000-char cap.
- Restructure AGENTS.md with the catalog-trifecta-required H2
  sections (Scope, Project shape, Repo boundaries, Commands,
  Validation, Safety, Cross-repo contracts, Release, Agent rules).
- Pull .claude/settings.json + .claude/lockdown-deny.sh refresh from
  coily lockdown into the same sweep commit. Coily's lockdown
  generator still emits a non-compliant 5-line header; tracked at
  coilysiren/coily#343.

closes #66

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 20:58:25 -07:00
.agent-guard rename: update cross-repo refs after coilyco-ai to agentic-os-kai 2026-05-15 02:28:05 -07:00
.claude chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
.github chore(ci): remove codex-review-gate + undraft-and-poke-codex workflows 2026-05-16 15:42:05 -07:00
deploy Add Streamable HTTP transport + serve-http example + Caddyfile 2026-05-13 05:01:06 -07:00
docs chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
examples chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
scripts chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
.gitignore Repository hygiene sweep: tier-A + CONTRIBUTING + godoc-current + auto-merge 2026-05-13 05:48:23 -07:00
.golangci.yaml Adopt coily's strict .golangci.yaml + pre-commit 2026-05-13 05:59:45 -07:00
.pre-commit-config.yaml chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
AGENTS.md chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
attach.go chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
attach_test.go chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
climcp.go chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
climcp_test.go feat!: default NameJoiner to '_' for safer MCP client interop 2026-05-13 07:39:06 -07:00
CODE_OF_CONDUCT.md chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
CONTRIBUTING.md Move .coily/coily.yaml to .agent-guard/agent-guard.yaml 2026-05-14 06:50:49 -07:00
example_test.go chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
go.mod Adopt cli-guard audit.WithSessionID as canonical session-id ctx key 2026-05-14 04:32:40 -07:00
go.sum Adopt cli-guard audit.WithSessionID as canonical session-id ctx key 2026-05-14 04:32:40 -07:00
godoc-current.txt chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
LICENSE Scaffold cli-mcp: project urfave/cli v3 command tree as MCP server 2026-05-13 04:31:32 -07:00
Makefile Wire cli-web-docs into docs surface, closes #46 2026-05-13 12:04:33 -07:00
mkdocs-requirements.txt Add mkdocs (urfave palette) + docs CI verification 2026-05-13 05:28:45 -07:00
mkdocs.yml Wire cli-web-docs into docs surface, closes #46 2026-05-13 12:04:33 -07:00
README.md chore: complete trifecta + re-enable catalog-doc-size + catalog-trifecta 2026-05-15 23:44:49 -07:00
schema.go chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
SECURITY.md Add SECURITY.md (urfave shape) + nav and Support links 2026-05-13 05:36:34 -07:00
serve.go chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
serve_test.go chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
session.go chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
session_test.go chore: clean up code-comments violations + adopt agentic-os v0.2.8 2026-05-25 20:58:25 -07:00
staticcheck.conf Adopt urfave-shaped README + trifecta + staticcheck.conf 2026-05-13 05:23:20 -07:00

cli-mcp

[![Go Reference][goreference_badge]][goreference_link] [![Go Report Card][goreportcard_badge]][goreportcard_link] [![Tests status][test_badge]][test_link]

cli-mcp turns a [urfave/cli][urfave/cli] v3 command tree into a CLI by default, with a batteries-included [Model Context Protocol][mcp] server attached. One binary, three usage forms, same code path.

app := &cli.Command{Name: "demo", Commands: []*cli.Command{ /* your tree */ }}
climcp.AttachMCP(app, climcp.Options{Name: "demo", Version: "v0.0.0"})
app.Run(ctx, os.Args)

That's it. app is now a regular CLI you can run directly, AND an MCP server when invoked as app mcp serve (stdio) or app mcp serve-http (Streamable HTTP).

The three forms

Given a hello subcommand, the same code is reachable as:

1. Plain CLI — humans run subcommands directly:

./demo hello kai --loud
# HELLO, KAI!

2. MCP server, raw JSON-RPC over the [Streamable HTTP][streamable] transport: start ./demo mcp serve-http --addr 127.0.0.1:8080, POST a tools/call payload to /mcp with the standard MCP headers. Returns "HELLO, KAI!" for the same args.

3. MCP server, called via [mcporter][mcporter] — the client wraps MCP tools as subcommands, so the caller sees a CLI shape again:

# mcporter.json
# {"mcpServers":{"demo":{"command":"./demo","args":["mcp","serve"]}}}
mcporter call demo hello kai --loud
# HELLO, KAI!

Form 1 runs the Action directly. Forms 2 and 3 round-trip through MCP and end up running the same Action with the same flags and args. The mcp subcommand group is auto-excluded from the MCP tool surface so calling MCP doesn't expose "how to start MCP".

See examples/dual-mode for the runnable version.

Features

  • Every leaf command becomes an MCP tool; tool name is the dot-joined path from the root's children.
  • Input schema derived from urfave flags (typed) and positional args.
  • stdio transport for editor/agent integrations, [Streamable HTTP][streamable] (current spec) for remote.
  • Built on the official [modelcontextprotocol/go-sdk][go-sdk].
  • Relays webops.* metadata onto MCP tool.Meta for [cli-web-ops] consumption.
  • Composes with [cli-guard]: Guard-wrapped actions audit and validate every tool call.

Documentation

docs/FEATURES.md inventory, examples/ demos, CLI reference, deploy/Caddyfile.example production posture. Dev verbs in .agent-guard/agent-guard.yaml; agent-guard lint validates against the Makefile.

Support

Bug or feature request: [create a new issue]. Conduct: Code of Conduct. Security: SECURITY.md. Siblings: [cli-guard], [cli-web-docs], [cli-web-ops].

See also

Cross-reference convention from coilysiren/agentic-os#59.