cli

module
v0.0.1-dev.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: MIT

README

holon

CI Go Downloads MIT License

holon generates typed clients for MCP servers. This allows invoking an MCP server as a function call your type checker understands.

This is currently supported via the Python SDK, TypeScript SDK, and UI SDK.

Install

curl -fsSL https://holon-labs.dev/install.sh | sh

Or alternatively with Go 1.27+, build and install from source:

go install github.com/holon-sh/cli/cmd/holon@latest

Usage

holon types generate
Generate typed clients for MCP servers

Usage:
  holon types generate [DIR...] [flags]

Flags:
      --contract   Output the app's MCP contract
  -v, --verbose    Show generation details
holon types check
Type-check apps

Usage:
  holon types check [DIR...] [flags]

Examples

The examples directory contains MCP servers implemented in different languages that make type-safe invocations.

In examples/checkout/server.ts, it invokes a tool in the same repository as

import { apps } from "holon-sh";

const order = await apps.orders.tools.lookup({ id }); // { id: string; total: number }
Without holon
import { Client, StreamableHTTPClientTransport } from "@modelcontextprotocol/client";

const client = new Client({ name: "checkout", version: "1.0.0" });
await client.connect(
  new StreamableHTTPClientTransport(new URL("http://localhost:3001/mcp")),
);
const result = await client.callTool({
  name: "lookup",
  arguments: { id },
});
const order = result.structuredContent as { id: string; total: number }; // unchecked

In examples/checkout/server.ts, it invokes a tool from a remote server as

import { apps } from "holon-sh";

const result = await apps.context7.callTool({
  name: "resolve-library-id",                 // tool names are checked
  arguments: { libraryName: library, query }, // arguments are typed
});
Without holon
import { Client, StreamableHTTPClientTransport } from "@modelcontextprotocol/client";

const client = new Client({ name: "checkout", version: "1.0.0" });
await client.connect(
  new StreamableHTTPClientTransport(new URL("https://mcp.context7.com/mcp")),
);
const result = await client.callTool({
  name: "resolve-library-id",                 // unchecked
  arguments: { libraryName: library, query }, // unchecked
});

In examples/checkout/ui/main.ts, an MCP Apps view invokes a tool as

import { App } from "holon-ui";

const view = new App({ name: "checkout-view", version: "1.0.0" });
await view.connect();
const { total } = await view.tools.total({ id }); // { total: number }
Without holon
import { App } from "@modelcontextprotocol/ext-apps";

const view = new App({ name: "checkout-view", version: "1.0.0" });
await view.connect();

const result = await view.callServerTool({ name: "total", arguments: { id } });
const { total } = result.structuredContent as { total: number }; // unchecked

Directories

Path Synopsis
cmd
holon command
internal
pkg
cli
Package cli provides the portable Holon commands for standalone and extended executables.
Package cli provides the portable Holon commands for standalone and extended executables.
mcpcontract
Package mcpcontract holds the typed-contract wire format Holon publishes in image metadata and helpers for generated files.
Package mcpcontract holds the typed-contract wire format Holon publishes in image metadata and helpers for generated files.
mcptype
Package mcptype compares MCP typed contracts and generates typed client packages.
Package mcptype compares MCP typed contracts and generates typed client packages.
tooling
Package tooling embeds the public SDK extraction and checking tools.
Package tooling embeds the public SDK extraction and checking tools.
typegen
Package typegen prepares portable typed MCP clients without a Holon installation.
Package typegen prepares portable typed MCP clients without a Holon installation.
oauthscope module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL