1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

この記事では、WSL + VSCode 環境で Dev Containers を使い、AWS Documentation MCP Serverを動作させる方法を紹介します。

MCP (Model Context Protocol) は、VSCode や GitHub Copilot Chat などの AIエージェントから外部ツールやデータソースを安全に利用するための新しい標準仕様です。

この構成を作ると、Copilot Chat から直接 AWS 公式ドキュメントを参照できるようになります。

VSCode に「DevContainers」をインストール

$ mkdir .devcontainer

cd .devcontainer
$ touch Dockerfile
$ touch devcontainer.json

Dockerfileの内容

ベースイメージに Python 3.12 を使用し、uvをシステムパスにインストールします。

FROM mcr.microsoft.com/devcontainers/python:3.12

RUN curl -fsSL https://astral.sh/uv/install.sh | UV_INSTALL_DIR=/usr/local/bin sh

USER vscode
WORKDIR /workspaces

devcontainer.jsonの設定

mcp.servers に AWS Documentation MCP Server を定義し、uvx コマンドで最新バージョンを起動するようにします。

また、chat.mcp.access: "all" により Copilot Chat から利用可能にしています。

{
  "name": "aws-doc-mcp (uv)",
  "build": { "dockerfile": "Dockerfile" },
  "features": { },
  "customizations": {
    "vscode": {

      "mcp": {
        "servers": {
          "aws-documentation": {
            "command": "uvx",
            "args": ["awslabs.aws-documentation-mcp-server@latest"],
            "env": {
              "FASTMCP_LOG_LEVEL": "ERROR",
              "AWS_DOCUMENTATION_PARTITION": "aws"
            }
          }
        }
      },
      "settings": {
        "chat.mcp.access": "all"
      },
      "extensions": [
        "GitHub.copilot-chat" 
      ]
    }
  },
  "remoteUser": "vscode",
  "postCreateCommand": "uv --version && python3 --version"
}

コンテナ起動

VSCode コマンドパレットから「Dev Containers: Reopen in Container」 を選択し開発コンテナを起動します。

Running the postCreateCommand from devcontainer.json...

[8403 ms] Start: Run in container: /bin/sh -c uv --version && python3 --version
uv 0.9.6
Python 3.12.12
任意のキーを押してターミナルを終了します。

Copilot Chat から動作確認

チャット画面の「ツール」一覧に aws-documentation が表示されれば成功です。
チェックを入れ「OK」ボタンをクリックしましょう。

image.png

Copilot Chat から実際に質問すると aws-documentation経由で回答が帰ってきました。

image.png

以上

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?