Skip to main content
Glama
theonedev

mcp-onedev

by theonedev

TOD - TheOneDev CLIツール

TOD (TheOneDev) は、OneDev 13以降向けの強力なコマンドラインツールです。 ローカルの変更に対してCI/CDジョブを実行したり、プルリクエストをローカルの作業ディレクトリにチェックアウトしたり、イシュー/PR/ビルドのクエリや編集を行ったり、提供されているスキルファイルを通じてAIエージェントからこれらすべてを操作したりすることで、開発ワークフローを効率化します。

機能

  • OneDevエンティティのクエリと編集 — イシュー、プルリクエスト、ビルドをシェルから直接操作できます。

  • ローカルの変更、ブランチ、タグに対するCI/CDジョブの実行 — リアルタイムのログストリーミングに対応しています (tod build run --local, --branch, または --tag)。

  • プルリクエストのローカルチェックアウト (tod pr checkout)。

  • .onedev-buildspec.yml のチェックと移行 — 最新バージョンへの更新をサポートします (tod build check-spec)。

  • エージェントスキルskills/ 配下のスキルファイルにより、Claude Code、Cursor、その他 SKILL.md 対応エージェントが tod を介してOneDevワークフローを操作できるようになります。

  • クロスプラットフォーム対応 (Windows, macOS, Linux)。

Related MCP server: AlibabaCloud DevOps MCP Server

インストール

tod をインストールするには、バイナリを PATH に配置してください。

ビルド済みバイナリのダウンロード

https://code.onedev.io/onedev/tod/~builds?query=%22Job%22+is+%22Release%22

ソースからのビルド

要件: Go 1.22.1 以上。

git clone https://code.onedev.io/onedev/tod.git
cd tod
go build

設定

tod config set を実行して、対話形式で設定ファイルを作成または更新します:

tod config set
# OneDev server URL (e.g. https://onedev.example.com): ...
# OneDev personal access token (input is visible): ...

または、非対話型セットアップのためにすべてをフラグとして渡します:

tod config set \
  --server-url https://onedev.example.com \
  --access-token your-personal-access-token \
  --non-interactive

tod config get はアクティブな設定(トークンは非表示)を表示し、tod config get <プロパティ名> は単一のプロパティを表示し、tod config set <プロパティ名> <プロパティ値> はプロパティを更新します。プロパティ名は server-urlaccess-token です。tod config path は使用されているパスを表示します。

設定ファイルは以下の場所で検索されます(最初に見つかったものが優先されます):

  1. $XDG_CONFIG_HOME/tod/config

  2. ~/.config/tod/config

  3. ~/.todconfig (レガシーフォールバック)

INI形式を使用し、モード 0600 で書き込まれます:

server-url=https://onedev.example.com
access-token=your-personal-access-token

クイックスタート

# Run CI against your uncommitted changes
cd /path/to/onedev-git-repository
tod build run --local ci

# Run ci job against the main branch
tod build run --branch main ci

# Check out pull request PROJ-123 into the current working directory
tod pr checkout PROJ-123

# Query open issues assigned to you
tod issue list --query 'assignee is me and state is "Open"'

# Inspect the most recent failing build for a project
tod build list --query 'successful is false' --count 1
tod build get <ref>
tod build get-log <ref>

コマンドの詳細は cli.md を参照してください。

エージェントスキル

TODには、skills/ 配下に4つのツール非依存な SKILL.md ファイルが含まれており、AIエージェントがCLIを通じて一般的なOneDevワークフローを操作する方法を学習させることができます:

  • using-todtod を介したOneDev操作全般のガイド

  • edit-build-spec.onedev-buildspec.yml の作成または編集

  • investigate-build-problems — 失敗したビルドのデバッグ

  • review-pull-request — 構造化されたプルリクエストレビューの実行

これらをClaude Code、Cursor、または SKILL.md ファイルを読み取るその他のエージェントにインストールする方法については skills.md を参照してください。

ローカルCI実行時の注意点

Nginxの設定

OneDevがNginxの背後で動作している場合、ログストリーミングのためにHTTPバッファリングを無効にしてください:

location /~api/streaming {
    proxy_pass http://localhost:6610/~api/streaming;
    proxy_buffering off;
}

詳細は OneDev Nginxセットアップドキュメント を参照してください。

セキュリティに関する考慮事項

ジョブがジョブシークレットにアクセスする場合、すべてのジョブを許可するために認証フィールドがクリアされていることを確認してください。認証をすべてのブランチに対して許可する設定だけでは不十分です。ローカルの変更は、どのブランチにも属さない一時的な参照にプッシュされるためです。

パフォーマンスのヒント

  1. 大規模リポジトリ — 完全な履歴ではなく、チェックアウトステップで適切なクローン深度を使用してください。

  2. 外部依存関係 — ダウンロードや中間ファイルには キャッシュ を使用してください。

  3. ビルドの最適化 — 生成に時間がかかる中間ファイルをキャッシュしてください。

コントリビューション

TODはOneDevエコシステムの一部です。コントリビューション、イシュー、機能リクエストについては、OneDevプロジェクト を参照してください。

ライセンス

license.txt を参照してください。

Related MCP Connectors

Related MCP Servers

  • -
    license
    B
    quality
    Not graded
    maintenance
    Enables comprehensive Git and GitHub operations through 30 DevOps tools including repository management, file operations, workflows, and advanced Git features. Provides complete Git functionality without external dependencies for seamless integration with Gitea and GitHub platforms.
    18
    819 npm
    -
  • A
    license
    C
    quality
    A
    maintenance
    Enables AI assistants to interact with Alibaba Cloud Yunxiao DevOps platform for managing projects, code repositories, work items, pipelines, deployments, and testing workflows through comprehensive organization, development, and delivery tools.
    81
    965 npm
    169
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Automates iteration management and code review submission workflows with DingTalk authentication. Supports interactive 5-step iteration creation, Git integration, smart time estimation, and automatic submission to company CodeReview systems.
    5 npm
    1
    ISC