@channel.io/mclip
v0.2.0
Published
Hybrid Swagger/OpenAPI code generator for Go CLI and Go MCP servers
Downloads
257
Readme
mclip
mclip generates a Go CLI and a Go MCP server from Swagger/OpenAPI.
It is designed as an open-source first tool that can also be used inside Channel:
npxentrypoint for adoption.- Go codegen core for speed and extensibility.
- Generated Go CLI for single-binary API tooling.
- Generated Go MCP server using the official Go MCP SDK.
- Auth hooks instead of fragile Swagger-based auth guessing.
Usage
npx @channel.io/mclip generateNon-interactive generation:
npx @channel.io/mclip generate \
--swagger ./swagger.json \
--out ./generated/sample \
--name sample \
--categories Utility \
--cli \
--mcp \
--auth env \
--mcp-transport both \
--yesWhat Gets Generated
mclip writes a standalone Go module to the output directory.
Generated projects can include:
- A Cobra-based CLI with
api list,api run, and tag commands. - A Go MCP server with
stdio,http, orbothtransport support. - A shared operation catalog and runner.
noopor env-token auth hook.- A generated GitHub Actions workflow for build verification.
Supported Inputs
mclip accepts local files or URLs for Swagger/OpenAPI documents.
Supported formats:
- Swagger 2.0 or OpenAPI 3.x.
- JSON or YAML.
- Tagged operations for category selection.
- Untagged operations, grouped under
default.
Auth
mclip does not infer auth requirements from Swagger/OpenAPI.
Generated auth modes:
noop: no auth header is applied.env:API_AUTH_HEADERandAPI_AUTH_TOKENare injected into requests.
Service-specific auth can be added by replacing the generated auth provider.
Development
pnpm install
pnpm test
pnpm build:core
cd core
go test ./...Run the local wrapper:
pnpm mclip generate --helpRelease
Releases are managed with release-please.
Merging a release PR creates a GitHub release. Publishing to npm is handled by .github/workflows/npm-publish.yml through npm trusted publishing with GitHub Actions OIDC, so no long-lived NPM_TOKEN is required.
Configure the trusted publisher on npm with:
- Package:
@channel.io/mclip - Owner/repository:
channel-io/mclip - Workflow filename:
npm-publish.yml
License
MIT
