Skip to main content

Claude CodeでSnykを始める

3つの簡単なステップで、Claude Codeから直接Snykのセキュリティスキャンを始めましょう。

1. 1行でインストール

ターミナルでこのコマンドをコピーして実行し、Snyk Studioをインストールします

npx -y snyk@latest mcp configure --tool=claude-cli

注: npxをサポートしていない環境をお使いの場合は、Snyk CLIのインストールが必要になることがあります。 詳しくはこちらをご覧ください。 
詳しくは、Snykの Claude Code公式ドキュメントをご覧ください。

2. 認証する

  1. インストール時に、Snykから認証フローの実行を求められます。

  2. 希望するログイン方法を選択し、必要な権限を付与してください。

  3. ブラウザーウィンドウをすべて閉じて、Claude Codeに戻ってください。

3. 試してみましょう!

Snyk Studioは、コードが生成されるたびに実行されるようデフォルト設定されています。現在のプロジェクトでClaude Codeとのチャットを始めるか、次のプロンプトを使って新しいプロジェクトを開始しましょう。

In a new file, write a Python function named `is_palindrome` that takes a single string argument and returns `True` if the string is a palindrome and `False` otherwise. Per the Snyk Secure At Inception rules, this will demonstrate that all generated code is tested for security issues using the Snyk scanning tools and any issues identifies can be fixed automaticallyPer the secure at inception rules, this will demonstrate that all generated code is tested for security issues using the Snyk MCP server and any issues identified can be fixed automatically.