> 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/opencode-mcp.md).

# OpenCode MCP

Aikido MCPプラグインは、AikidoのセキュリティエンジンをAIコーディングツールに接続します。AIが生成したコードが作成されるとすぐに、脆弱性やハードコードされたシークレットを自動でスキャンします。

AIアシスタントは自分の出力をレビューできますが、そのレビューは完全ではありません。Aikidoは、実績のあるスキャンルールで生成されたすべてのスニペットをチェックする、信頼性が高く一貫したセキュリティレイヤーを追加します。

**Aikido MCPを使う理由**

* コミットされる前に、すべてのAI生成スニペットに対して決定的で独立したセキュリティチェックを実施
* AI支援ワークフローにおける脆弱性とハードコードされたシークレットを即座に検出し、修正
* リアルタイムのフィードバックにより、AI主導の開発を標準でより安全にします

MCP サーバーが公開するツールの一覧については、参照してください [利用可能なツール](/docs/docs-ja/ai-totsru/aikido-mcp/using-aikido-mcp.md#available-tools).

## インストール

{% stepper %}
{% step %}
**Aikido MCP サーバーを OpenCode の設定に追加する**

開くか、作成する `~/.config/opencode/opencode.json` そして、次の内容をファイルの以下に追加してください `mcp`

```shellscript
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "aikido": {
      "type": "local",
      "command": ["npx", "-y", "@aikidosec/mcp@latest"],
      "enabled": true
    }
  }
}
```

{% endstep %}

{% step %}
**認証**

初回使用時、MCP サーバーは認証が設定されていないことを検出します。エージェントに次を実行するよう依頼してください `aikido_login`。ブラウザリンクが返されます。そのリンクを開いて Aikido にログインしてください。ログインが完了すると、トークンは安全に保存されます。
{% endstep %}

{% step %}
**Aikido ルールを Global AGENTS ファイルに追加する**

まだ存在しない場合は、vibe の prompts ディレクトリを作成してください。

```shellscript
mkdir -p ~/.config/opencode/skills/aikido/
```

Aikido ルールをダウンロードして次に追加します `~/.config/opencode/skills/aikido/SKILL.md`.

```shellscript
curl -fsSL "https://gist.githubusercontent.com/kidk/1d2c1e754d5a5ddd05c9966d2507ae42/raw/ea8183c0ae1af5ec9bcb8b93275145adbe936c20/aikido-skill.txt" \
  -o ~/.config/opencode/skills/aikido/SKILL.md
```

{% endstep %}

{% step %}
**完了**

Aikido MCP は OpenCode で利用できるようになりました。

{% hint style="info" %}
OpenCode が開いていた場合は再起動してください。
{% endhint %}
{% endstep %}
{% endstepper %}

{% hint style="info" %}
ブラウザログインができない CI/CD やヘッドレス環境については、参照してください [トークン認証](/docs/docs-ja/ai-totsru/aikido-mcp/token-authentication.md).
{% endhint %}

エージェントに Aikido を使用させる方法については、次を参照してください [プロンプト例](/docs/docs-ja/ai-totsru/aikido-mcp/using-aikido-mcp.md#example-prompts).


---

# 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/opencode-mcp.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.
