1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Claude Desktop に Docker を使って MCP Server を構築する方法 ~①Systemfile編~

Last updated at Posted at 2025-03-26

以下は、MCP Severs に含まれる Systemfile MCP Server を Windows に Docker Desktop を使って構築する手順をまとめたものです。

1. 事前準備

1.1 ソフトウェアのインストール

以下を事前にインストールします。Docker を利用するため、uvnodejs のインストールが不要になります。

1.2. Claude の開発者モードを有効化

開発者モードを有効化を選択します。
※ 私はすでに有効にしているので表示されていません。

image.png

2. MCP Servers のソースコードの取得

Filesystem を含む公式の MCP Servers のソースコードを取得します。

git clone https://github.com/modelcontextprotocol/servers.git
cd servers

※私は以下のディレクトリで実行しました。
C:/Users/username/mcp_projects

3. Filesytem MCP Server の Docker イメージのビルド

先ほど取得した Filesystem MCP Server のソースをビルドし、Docker イメージを作成します。

docker build -t mcp/filesystem -f src/filesystem/Dockerfile .

4. Claude Desktop用設定ファイルの編集

Claude Desktop が Filesystem MCP Serer をハンドリングできるように設定ファイルを変更します。

image.png

image.png

Claude Desktopの設定ファイル(例: claude_desktop_config.json)に以下を追記します。

{
  "mcpServers": {
    "filesystem": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--mount", "type=bind,src=<YOUR_LOCAL_PATH>,dst=/projects/<MOUNT_POINT>",
        "mcp/filesystem",
        "/projects"
      ]
    }
  }
}
  • <YOUR_LOCAL_PATH>: ローカルの共有したいフォルダパス
  • <MOUNT_POINT>: コンテナ内でのディレクトリ名

dst は必ず /projects 以下にする必要があります。
※ 私は以下のように設定しました。
src=C:/Users/username/mcp_projects/shared
dst=/projects/shared

5. 動作確認

Claude Desktopを再起動します。

※ ウィンドウを閉じるだけでなく、以下から完全に終了させます。

image.png

Claude Desktop 再起動時に、Filesystem MCP Server のコンテナが自動で立ち上がります。

image.png

Claude に次のようなプロンプトを送って動作確認します:

/projects/shared/test.txt に HelloWorld と記載したテキストを出力して。

ツールを使用するか確認が入るので、許可して継続します。

image.png

テストファイルが生成されれば成功です。

image.png

SearXNG編に続く...

Claude Desktop に Docker を使って MCP Server を構築する方法 ~②SearXNG編~

1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?