Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GitHub CopilotでMCPを使いこなす

Avatar for raku raku
July 15, 2025
710

GitHub CopilotでMCPを使いこなす

Avatar for raku

raku

July 15, 2025
Tweet

Transcript

  1. VSCodeでのMCP設定方法 プロジェクトのルートに .vscode/mcp.json を使う コミットしてチームでMCPの設定を共有可能 ユーザー設定のmcp.jsonを使う 他のMCPクライアントの設定を自動検知・再利用 setting.jsonの chat.mcp.discovery.enabled で有効化

    "chat.mcp.discovery.enabled": { "claude-desktop": false, "windsurf": false, "cursor-global": false, "cursor-workspace": false } GitHub Copilot活用術~MCP・レビュー・issue・Coding Agentまで!~
  2. VSCodeのmcp.jsonの基本構造(ダミーコード) 主な要素: inputs : APIキーなど、ユーザーに入力を促す設定値のプレースホルダーを定義します servers : 起動するMCPサーバーのリストを定義します "servers": {

    "MyServer": { "type": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-example"], "env": { "API_KEY": "${input:api-key}" } } } { "inputs": [ { "type": "promptString", "id": "api-key", "description": "APIキー", "password": true } ], } GitHub Copilot活用術~MCP・レビュー・issue・Coding Agentまで!~
  3. VSCodeのmcp.jsonの基本構造(ダミーコード) 主な要素: inputs : APIキーなど、ユーザーに入力を促す設定値のプレースホルダーを定義します servers : 起動するMCPサーバーのリストを定義します "env": {

    "API_KEY": "${input:api-key}" } { "inputs": [ { "type": "promptString", "id": "api-key", "description": "APIキー", "password": true } ], "servers": { "MyServer": { "type": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-example"], } } } GitHub Copilot活用術~MCP・レビュー・issue・Coding Agentまで!~
  4. VSCodeのmcp.jsonの基本構造(ダミーコード) 主な要素: inputs : APIキーなど、ユーザーに入力を促す設定値のプレースホルダーを定義します servers : 起動するMCPサーバーのリストを定義します "inputs": [

    { "type": "promptString", "id": "api-key", "description": "APIキー", "password": true } ], { "servers": { "MyServer": { "type": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-example"], "env": { "API_KEY": "${input:api-key}" } } } } GitHub Copilot活用術~MCP・レビュー・issue・Coding Agentまで!~
  5. VSCodeのmcp.jsonの基本構造(ダミーコード) 主な要素: inputs : APIキーなど、ユーザーに入力を促す設定値のプレースホルダーを定義します servers : 起動するMCPサーバーのリストを定義します "env": {

    "API_KEY": "${input:api-key}" } { "inputs": [ { "type": "promptString", "id": "api-key", "description": "APIキー", "password": true } ], "servers": { "MyServer": { "type": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-example"], } } } GitHub Copilot活用術~MCP・レビュー・issue・Coding Agentまで!~
  6. CloudWatch MCPサーバーで利用可能なツール一覧 CloudWatch Metrics get_metric_data : 詳細なメトリクスデータを取得 get_metric_metadata : 特定メトリクスのメタデータを取得

    get_recommended_metric_alarms : メトリクスに対する推奨アラームを取 得 CloudWatch Alarms ←これ get_active_alarms : 現在作動中のアラームを特定 get_alarm_history : 特定アラームの履歴(状態変化)を取得 CloudWatch Logs describe_log_groups : ロググループのメタデータを検索 analyze_log_group : ロググループから異常やエラーパターンを分析 execute_log_insights_query : Logs Insightsクエリを実行 get_logs_insight_query_results : クエリ結果を取得 cancel_logs_insight_query : 実行中のクエリをキャンセル GitHub Copilot活用術~MCP・レビュー・issue・Coding Agentまで!~
  7. 具体的な設定例 (.vscode/mcp.json) 補足: 🙅‍♂️現状、AWS LabsのMCPサーバーは複数のAWSプロファイルを直接切り替える機能にできます応していま せん。 プロファイル毎にMCPサーバー名を分けて定義して擬似的に複数環境に対応させています { "inputs": [

    { "type": "promptString", "id": "service-A-profile", "description": "サービスAのaws-vaultに設定しているプロファイル名", "password": false }, { "type": "promptString", "id": "service-B-profile", "description": "サービスBのaws-vaultに設定しているプロファイル名", "password": false } ], "servers": { "serviceA-cloudwatch": { "command": "aws-vault", "args": [ "exec", "${input:service-A-profile}", "--", " " GitHub Copilot活用術~MCP・レビュー・issue・Coding Agentまで!~
  8. 具体的な設定例 (.vscode/mcp.json) 補足: 🙅‍♂️現状、AWS LabsのMCPサーバーは複数のAWSプロファイルを直接切り替える機能にできます応していま せん。 プロファイル毎にMCPサーバー名を分けて定義して擬似的に複数環境に対応させています "description": "サービスAのaws-vaultに設定しているプロファイル名", {

    "inputs": [ { "type": "promptString", "id": "service-A-profile", "password": false }, { "type": "promptString", "id": "service-B-profile", "description": "サービスBのaws-vaultに設定しているプロファイル名", "password": false } ], "servers": { "serviceA-cloudwatch": { "command": "aws-vault", "args": [ "exec", "${input:service-A-profile}", "--", GitHub Copilot活用術~MCP・レビュー・issue・Coding Agentまで!~
  9. 具体的な設定例 (.vscode/mcp.json) 補足: 🙅‍♂️現状、AWS LabsのMCPサーバーは複数のAWSプロファイルを直接切り替える機能にできます応していま せん。 プロファイル毎にMCPサーバー名を分けて定義して擬似的に複数環境に対応させています "description": "サービスBのaws-vaultに設定しているプロファイル名", "inputs":

    [ { "type": "promptString", "id": "service-A-profile", "description": "サービスAのaws-vaultに設定しているプロファイル名", "password": false }, { "type": "promptString", "id": "service-B-profile", "password": false } ], "servers": { "serviceA-cloudwatch": { "command": "aws-vault", "args": [ "exec", "${input:service-A-profile}", "--", "uvx", "awslabs cloudwatch-mcp-server@latest" GitHub Copilot活用術~MCP・レビュー・issue・Coding Agentまで!~
  10. 具体的な設定例 (.vscode/mcp.json) 補足: 🙅‍♂️現状、AWS LabsのMCPサーバーは複数のAWSプロファイルを直接切り替える機能にできます応していま せん。 プロファイル毎にMCPサーバー名を分けて定義して擬似的に複数環境に対応させています "serviceA-cloudwatch": { p

    "description": "サービスBのaws-vaultに設定しているプロファイル名", "password": false } ], "servers": { "command": "aws-vault", "args": [ "exec", "${input:service-A-profile}", "--", "uvx", "awslabs.cloudwatch-mcp-server@latest" ] }, "service-B-cloudwatch": { "command": "aws-vault", "args": [ "exec", "${input:service-B-profile}", "--", "uvx", "awslabs cloudwatch-mcp-server@latest" GitHub Copilot活用術~MCP・レビュー・issue・Coding Agentまで!~
  11. 具体的な設定例 (.vscode/mcp.json) 補足: 🙅‍♂️現状、AWS LabsのMCPサーバーは複数のAWSプロファイルを直接切り替える機能にできます応していま せん。 プロファイル毎にMCPサーバー名を分けて定義して擬似的に複数環境に対応させています "service-B-cloudwatch": { "serviceA-cloudwatch":

    { "command": "aws-vault", "args": [ "exec", "${input:service-A-profile}", "--", "uvx", "awslabs.cloudwatch-mcp-server@latest" ] }, "command": "aws-vault", "args": [ "exec", "${input:service-B-profile}", "--", "uvx", "awslabs.cloudwatch-mcp-server@latest" ] } } } GitHub Copilot活用術~MCP・レビュー・issue・Coding Agentまで!~
  12. .github/prompts/でプロンプトをテンプレート化 check_all_cloudwatch_alerm.prompt.md : 現在アラート状態になっているCloudWatch Alarmを取得したい --- mode: 'agent' tools: ['cancel_logs_insight_query',

    'describe_log_groups', 'execute_log_insights_query', 'get_active_alarms', 'get_alarm_history', 'get_logs_insig --- serviceA,serviceBそれぞれのアラート状態のアラームをMCPで取得してください。 - **対象リージョン**:ap-northeast-1 - **取得対象**:アラート状態(`ALARM`)のアラーム - **取得したアラームの除外条件**:アラーム名に「Low」が含まれるものはAutoScalingアラームなので除外 GitHub Copilot活用術~MCP・レビュー・issue・Coding Agentまで!~
  13. GitHub Copilot Business & Enterpriseのユーザー向け version 1.102 より、MCPの設定をGitHub Copilotのポリシーで管理できるようになりました。(デフォルトで無効 になっているので⚠️)

    In addition, organizations can now control the availability of MCP servers with a GitHub Copilot policy. Learn more about Managing policies and features for Copilot in your enterprise in the GitHub Copilot documentation. GitHub Copilot活用術~MCP・レビュー・issue・Coding Agentまで!~