Skip to content

Add the bitanon command and MCP server - #3

Merged
dipu-bd merged 3 commits into
mainfrom
claude/project-thread-4jl6dy
Dec 3, 2026
Merged

dipu-bd merged 3 commits into
mainfrom
claude/project-thread-4jl6dy

Conversation

@dipu-bd

@dipu-bd dipu-bd commented Dec 3, 2026

Copy link
Copy Markdown
Member

Requested by Dipu · project thread

Adds bitanon, a native command-line tool, and bitanon mcp, an MCP server on stdio, both over the same engine as bitanon.dev/toolbox.

How it fits together

  • lib/src/catalog.dart lists the 19 tools once (name, parameters, defaults, which parameter takes data from a file or stdin). CLI flags, --help and the MCP inputSchemas all come from it.
  • lib/src/cli.dart and lib/src/mcp.dart talk to a small Host interface; bin/bitanon.dart implements it with dart:io, the tests with a fake.
  • Install: binaries from GitHub Releases, or dart pub global activate --source git https://github.com/bitanon/toolbox.

CLI behaviour

  • Data from the argument, --file, or stdin. File and stdin bytes are read as is (bitanon hash < file.bin matches sha256sum), unless you set the format flag, which reads them as text.
  • hash defaults to SHA-256 instead of the web page's "all algorithms".
  • --json prints the engine result. Exit codes: 0 ok, 1 failure or "no match" from the verify tools, 2 usage mistake.

MCP

Negotiates protocol versions 2025-11-25, 2025-06-18, 2025-03-26 and 2024-11-05. Tools carry read-only annotations; tool errors come back as isError results so the model can fix its input; structuredContent from 2025-06-18 on. It reads no files and makes no network requests.

Release

Push a vX.Y.Z tag that matches pubspec.yaml. release.yml checks the version, builds linux-x64/arm64, macos-arm64/x64 and windows-x64 binaries, runs the end-to-end checks on each, and creates the GitHub release with SHA256SUMS and the CHANGELOG section as notes.

Testing

  • test/cli_test.dart: 31 tests (CLI, catalog, MCP protocol) with known answers from FIPS 180-4 and RFCs 1321, 4231, 4648 and 4226.
  • tool/check_cli.mjs: runs the built binary end to end (argument, stdin, file, exit codes, MCP handshake and call). Passes locally; CI now runs it.
  • Engine tests and check_js.mjs unchanged and passing.

The second commit removes an npm build that the first one added (npm publishing was dropped mid-way). Squash-merging this PR, or letting me force-push one combined commit, keeps main clean.


Generated by Claude Code

One Dart front end over the engine, built two ways: a native binary
(dart compile exe) and a Node.js build for the `bitanon` npm package.
`bitanon mcp` serves every tool over stdio. The tool list, flags, help
and MCP schemas all come from lib/src/catalog.dart.

CI runs both builds end to end; pushing a vX.Y.Z tag builds binaries for
Linux, macOS and Windows, creates the GitHub release and publishes to npm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmuCbtjZ699DghxV5a1A9S
Ship native binaries only: remove the Node.js host, the npm package and
its release job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmuCbtjZ699DghxV5a1A9S
install.sh (Linux, macOS) and install.ps1 (Windows) fetch the binary for
the system from the latest GitHub release, check it against SHA256SUMS
and install it. The README leads with them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmuCbtjZ699DghxV5a1A9S
@dipu-bd
dipu-bd merged commit d748773 into main Dec 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants