Claude Code をIssueやPull RequestのリアクションをClaude Codeにやらせる場合、
一旦ローカルPCにClaude Codeをインストールして、git cloneしたGitHubリポジトリ内でclaudeコマンドで実行した後、/install-github-app したあとgit pushすることで設定できます。
が、上記方法ではMCPツールは(ローカルPC上のClaude CodeにMCPツールを設定していても)登録されません。
MCPツールを増やすには先の作業で追加した .github/workflows/claude.yaml や .github/workflows/claude-code-review.yaml に GitHub Claude Code Actions に書かれている通り設定すればいいのですが、allowed_toolsに2つのMCPツールの名前をstringで記述する必要があります。
stringなのでシングルクォートをつかって以下のように設定すれば動作します:
:
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
mcp_config: |
{
"mcpServers": {
"sequential-thinking": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sequential-thinking"
]
},
"perplexity-ask": {
"command": "npx",
"args": [
"-y",
"server-perplexity-ask"
],
"env": {
"PERPLEXITY_API_KEY": "${{ secrets.PERPLEXITY_API_KEY }}"
}
}
}
}
allowed_tools: '["mcp__sequential-thinking__sequentialthinking", "mcp__perplexity-ask__perplexityask"]':
ご参考まで。
#あと、インテントにも注意。allowed_toolsはmcp_configと同じインテントです
0 件のコメント:
コメントを投稿