> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/ai-totsru/aikido-mcp/anthropic-claude-code-mcp/claude-code-internal-plugin.md).

# Aikidoを独自のClaude Codeプラグインにバンドルする

Aikido MCPサーバーと独自のスキルを社内用Claude Codeプラグインにまとめ、開発者が何も設定しなくても固定構成を使えるようにします。

次の [Aikido 公式プラグイン](/docs/docs-ja/ai-totsru/aikido-mcp/anthropic-claude-code-mcp.md) 常に独自のスキルを同梱します。開発者にどのスキルを使わせるかを正確に決めたいなら、選んだスキルと Aikido MCP サーバーをまとめた独自の社内プラグインを作成し、自分たちのマーケットプレイスから配布してください。プラグインとは、Claude Code が 1 つの単位として読み込む設定フォルダーです。スキル、エージェント、フック、MCP サーバーが含まれます。

次のような場合に使用します:

* 固定されたスキルセットが必要な場合: 自分のスキル、Aikido の一部、またはその両方
* 開発者が何もインストールしたり、セットアップ手順を実行したりする必要がないこと
* 展開を自分たちのリポジトリでバージョン管理し、レビューしたい場合

{% hint style="info" %}
公式の Aikido プラグインを独自のプラグインと並べてインストールしないでください。両方が Aikido MCP サーバーを登録してしまい、2 セットのスキルが表示されます。
{% endhint %}

## プラグインを作成する

{% stepper %}
{% step %}
**プラグインフォルダーを作成する**

```
aikido-internal/
├── .claude-plugin/
│   └── plugin.json
├── .mcp.json
└── skills/
    └── scan/
        └── SKILL.md
```

Only `plugin.json` が入るのは `.claude-plugin/`だけです。その他はすべてプラグインのルートに置きます。

`.claude-plugin/plugin.json`:

```json
{
  "name": "aikido-internal",
  "displayName": "Aikido（社内用）",
  "description": "独自のスキルによる Aikido のセキュリティスキャン",
  "version": "1.0.0"
}
```

次の `name` はスキルの名前空間です。そのため、次のようなスキルフォルダー `scan/` は `/aikido-internal:scan`.
{% endstep %}

{% step %}
**Aikido MCP サーバーを追加する**

`.mcp.json` をプラグインのルートに:

```json
{
  "mcpServers": {
    "aikido": {
      "command": "npx",
      "args": ["-y", "@aikidosec/mcp@latest"]
    }
  }
}
```

プラグインが有効になると、サーバーは自動的に起動します。Aikido ツールを初めて使うと、サーバーはブラウザー経由でのサインインを求めます。

ヘッドレス環境の場合やブラウザーでのサインインを省略したい場合は、Personal Access Token (PAT) を使用してください。サーバーは継承した環境変数から `AIKIDO_API_KEY` を読み取るので、開発者のシェルプロファイルまたはデバイス管理ツールで設定し、上記の設定は変更しないでください。そうすることで、トークンをプラグインのリポジトリ外に置けます。PAT の作成方法については [トークン認証](/docs/docs-ja/ai-totsru/aikido-mcp/token-authentication.md) を参照してください。

代わりに、Claude Code に各開発者へ一度だけトークンを要求させ、安全に保存したい場合は、次に定義してください: `plugin.json` 以下の `userConfig` そして次のように参照します: `${user_config.aikido_token}` を `env` ブロック内で:

```json
{
  "userConfig": {
    "aikido_token": {
      "type": "string",
      "title": "Aikido トークン",
      "description": "あなたの Aikido Personal Access Token",
      "sensitive": true
    }
  }
}
```

その後、次のようにサーバーに渡します: `.mcp.json`:

```json
"env": {
  "AIKIDO_API_KEY": "${user_config.aikido_token}"
}
```

{% endstep %}

{% step %}
**必要なスキルを追加する**

各スキルは `skills/` 配下の `SKILL.md` ファイルを持つフォルダーです。 `description` で、Claude にいつ使うかを伝えます。

`skills/scan/SKILL.md`:

```markdown
---
description: 変更されたコードを Aikido でスキャンして、脆弱性やハードコードされたシークレットを検出します。コードの作成または編集後、コミット前に使用してください。
---

作業ツリーで変更されたファイルに対して Aikido の `aikido_scan_paths` ツールを実行します。

検出された項目をすべて、重大度とファイルの場所とともに報告し、その後、
あなたが導入したものを修正してください。重大な検出事項が残っている状態ではコミットしないでください。
```

必要な数だけ追加できます。たとえば、次を使うトリアージ用スキル: `aikido_issues_list` 現在のリポジトリのオープンな issue を取得します。次を参照してください: [利用可能な MCP ツール](/docs/docs-ja/ai-totsru/aikido-mcp/using-aikido-mcp.md#available-tools) サーバーが公開している内容について。
{% endstep %}

{% step %}
**ローカルでテストする**

```shellscript
claude --plugin-dir ./aikido-internal
```

その後、次を実行します: `/aikido-internal:scan` スキルを確認するために、 `/plugin` Aikido MCP サーバーが起動したことを確認します。次を実行してください: `/reload-plugins` 再起動せずに変更を反映します。

出荷前に構成を検証します:

```shellscript
claude plugin validate ./aikido-internal
```

{% endstep %}
{% endstepper %}

## チームに配布する

開発者が読み取れるリポジトリにプラグインを置き、マーケットプレイスファイルを `.claude-plugin/marketplace.json` に配置します:

```json
{
  "name": "acme-tools",
  "owner": {
    "name": "プラットフォームチーム",
    "email": "platform@acme.com"
  },
  "plugins": [
    {
      "name": "aikido-internal",
      "source": "./aikido-internal",
      "description": "独自のスキルによる Aikido のセキュリティスキャン"
    }
  ]
}
```

プライベートリポジトリでも問題ありません。Claude Code は各開発者が既に持っている Git 認証情報を使ってそれをクローンします。

その後、これをプロジェクトの `.claude/settings.json`:

```json
{
  "extraKnownMarketplaces": {
    "acme-tools": {
      "source": {
        "source": "github",
        "repo": "acme/claude-plugins"
      }
    }
  },
  "enabledPlugins": {
    "aikido-internal@acme-tools": true
  }
}
```

開発者がリポジトリフォルダーを信頼すると、Claude Code はマーケットプレイスを追加し、追加のプロンプトなしでプラグインを有効にします。

{% hint style="warning" %}
プラグインフォルダーはマーケットプレイスのリポジトリ内に置き、上記のように相対 `./` パスで参照してください。別の GitHub リポジトリなど外部ソースを指すプラグインは、設定ファイルだけではインストールされません。各開発者が次を実行する必要があります: `claude plugin install` を最初に。
{% endhint %}

## ツールができることを制御する

独自のプラグインをまとめることで、開発者のマシンに存在するスキルを制御できます。Aikido ツールに許可される動作は変わりません。それは Aikido のワークスペース レベルの設定のままです。参照 [MCP権限](/docs/docs-ja/ai-totsru/aikido-mcp/mcp-permissions.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.aikido.dev/docs/docs-ja/ai-totsru/aikido-mcp/anthropic-claude-code-mcp/claude-code-internal-plugin.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
