Clihubのロゴ

Clihub

コミュニティ
thellimist

Turn any MCP server into CLI

公開者thellimist
リポジトリclihub
言語Go
フォーク
39
スター
666
利用可能なツール
0
通信方式stdio
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Clihubは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには666件のスターと39件のフォークがあります。

clihub

Turn any MCP server into a compiled CLI binary. One command. Designed for agents.

clihub generate --url https://mcp.linear.app/mcp
# → ./out/linear (6.5MB static binary, zero runtime dependencies)

Every tool the server exposes becomes a subcommand with flags derived from its JSON Schema. Auth is handled automatically — OAuth, bearer tokens, API keys, and more.

Full blog post

Install

bash
go install github.com/thellimist/clihub@latest

If clihub is not found after install, run export PATH="$(go env GOPATH)/bin:$PATH" to add Go-installed binaries (usually ~/go/bin) to your current shell PATH.

Or build from source:

bash
git clone https://github.com/thellimist/clihub.git
cd clihub
go build -o clihub .
install -m 755 clihub ~/.local/bin/clihub

If you're contributing, run bash scripts/install-hooks.sh once after cloning.

If ~/.local/bin is not in your PATH, add it in your shell config (for example ~/.zshrc):

bash
export PATH="$HOME/.local/bin:$PATH"

Requires Go 1.24+.

AI Usage

Add the following to your AGENTS.md

## Tools

- Check if tool exists in `bin`.
- If not, check if official CLI exists. If so, download it and add it to AGENTS.md
- If not, check official MCP exists. If so, use clihub `go run github.com/thellimist/clihub@latest <server>` (see `--help`). to create a CLI and move the executable to bin folder. Then add it to AGENTS.md
- If both failed, give suggestions to create a CLI using official docs and https://clig.dev/

Quick Start

HTTP MCP server

bash
clihub generate --url https://mcp.linear.app/mcp
./out/linear list-teams

HTTP server with OAuth

bash
clihub generate --url https://mcp.notion.com/mcp --oauth
./out/notion notion-search --query "meeting notes"

Stdio MCP server

bash
clihub generate --stdio "npx @modelcontextprotocol/server-github" \
  --env GITHUB_TOKEN=$GITHUB_TOKEN
./out/github list-repos --owner octocat

Cross-compile

bash
clihub generate --url https://mcp.stripe.com \
  --platform linux/amd64,darwin/arm64,windows/amd64

Pass tool input as JSON

Generated CLIs include a --from-json flag on each tool command. This lets you pass the full tool input object directly.

bash
./out/linear create-issue --from-json '{"title":"Bug report","priority":"high"}'

Rules:

  • --from-json bypasses typed tool flags.
  • --from-json cannot be combined with typed flags in the same call.
  • If a tool already has a --from-json flag from its schema, clihub uses --clihub-from-json for passthrough instead.

How It Works

  1. Connect to the MCP server (HTTP or stdio)
  2. Discover all tools via tools/list
  3. Generate a Go CLI with one subcommand per tool
  4. Compile to a static binary for your target platform(s)

The generated binary is standalone — no runtime dependencies, no config files, no clihub needed.

Authentication

Generated CLIs handle auth at runtime. For HTTP servers, the auth subcommand manages credentials:

bash
# OAuth browser flow (auto-discovers endpoints via RFC 9728 / RFC 8414)
./out/linear auth

# Manual bearer token
./out/linear auth --token $TOKEN

# Check status
./out/linear auth status

# Logout
./out/linear auth logout

Some MCPs require generatin-time auth. Use

bash
clihub generate --help-auth

Auth is resolved in this order:

  1. --auth-token flag
  2. --auth-type + related flags (--auth-header-name, --auth-key-file, etc.)
  3. CLIHUB_AUTH_TOKEN environment variable
  4. ~/.clihub/credentials.json (persisted from previous auth)
  5. Unauthenticated

Supported Auth Types

TypeDescription
OAuth 2.0Browser flow with PKCE, auto-discovery, token refresh
Dynamic Client RegistrationRFC 7591 — auto-registers OAuth clients
Bearer TokenStatic Authorization: Bearer <token>
API KeyCustom header (e.g. X-API-Key)
Basic AuthUsername/password
S2S OAuth 2.0Client credentials grant (no browser)
Google Service AccountJWT signed with service account key

Flags

clihub generate [flags]

Connection:
  --url string              Streamable HTTP URL of an MCP server
  --stdio string            Shell command that spawns a stdio MCP server
  --timeout int             Connection timeout in ms (default 30000)
  --env strings             Environment variables for stdio servers (KEY=VALUE)

Output:
  --name string             Override the inferred binary name
  --output string           Output directory (default "./out/")
  --platform string         Target GOOS/GOARCH pairs or 'all' (default current platform)

Auth (shown via `--help-auth`):
  --oauth                   Use OAuth for authentication (browser flow)
  --auth-token string       Bearer token
  --auth-type string        Auth type: bearer, api_key, basic, none
  --auth-header-name string Custom header for api_key auth (default X-API-Key)
  --auth-key-file string    Path to Google service account JSON key
  --client-id string        Pre-registered OAuth client ID
  --client-secret string    Pre-registered OAuth client secret
  --save-credentials        Persist auth token to credential store

Filtering:
  --include-tools string    Only include these tools (comma-separated)
  --exclude-tools string    Exclude these tools (comma-separated)

Other:
  --help-auth              Show authentication flags and exit
  --verbose                 Show detailed progress
  --quiet                   Suppress all output except errors

Project Structure

cmd/              CLI commands (root, generate)
internal/
  auth/           Auth providers, OAuth flow, credential store
  codegen/        Go template for generated CLIs
  compile/        Go compiler invocation, cross-compilation
  nameutil/       Binary name inference from URLs/commands
  schema/         JSON Schema → Go flag mapping
  toolfilter/     Tool include/exclude with fuzzy matching
  gocheck/        Go installation detection
main.go           Entry point

Contributing

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/my-change)
  3. Install repo hooks: bash scripts/install-hooks.sh
  4. Make your changes
  5. Run tests: go test ./...
  6. Commit with conventional format: feat(scope): description
  7. Open a PR

Hooks

Hook files are tracked in this repo (.githooks/), so git clone downloads them automatically. Run this once per clone to activate them:

bash
bash scripts/install-hooks.sh

The repo-managed pre-push hook runs:

  • gofmt formatting check (fails on unformatted .go files)
  • go vet ./...
  • go test ./...
  • golangci-lint run (if installed)

Pushes to main also require both:

  • VERSION updated in the pushed commits
  • annotated git tag vX.Y.Z that matches VERSION and points at pushed main HEAD

scripts/install-hooks.sh also sets push.followTags=true, so matching annotated tags are pushed automatically.

Example release bump flow:

bash
bash scripts/bump-version.sh --prepare-push patch   # bumps VERSION, amends HEAD, creates vX.Y.Z tag
git push --follow-tags origin main

Tag-only repair flow (if VERSION is already correct but tag is missing/misaligned):

Docs

Before changing behavior, review docs in docs/:

  • docs/project/project.md for scope and goals
  • docs/architecture/architecture.md for generation and command flow
  • docs/auth/auth.md for auth behavior and precedence
  • docs/releasing/releasing.md for release/version/tag rules
bash
bash scripts/bump-version.sh --sync-tag
git push --follow-tags origin main

Running Tests

bash
go test ./...

Building

bash
go build -o clihub .

License

MIT

ClihubのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Clihubに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Clihubをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. ClihubのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "clihub": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてClihubのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. ClihubのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Clihubを使ってこのタスクを手伝ってもらえますか?
Clihub
はい、読みました。
Clihubで調べた結果をお伝えします。

よくある質問

Clihub MCPサーバーは何に使いますか?

Clihubは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでClihub MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでClihubを利用できます。

TypingMindでClihub MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Clihubを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Clihub MCPをTypingMindに接続するにはどうすればよいですか?

ClihubはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでClihub MCPのどのようなツールを利用できますか?

ClihubはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Clihub MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Clihubで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇