Skip to main content
Glama
chanrute

MCP File Upload Sample

by chanrute

MCP File Upload Sample

MCP 経由でファイルを MinIO(S3 互換)にアップロードするサンプルです。MCP 実装は公式 TypeScript SDK を使用しています。

サーバーはクライアントがペイロードとして送り込んだデータ(Base64 または multipart)のみを処理し、ローカルディスクのファイルを読み出すことはありません。

前提

  • Node.js 20+

  • Yarn 1.x(packageManager: yarn@1.22.22

  • Docker(MinIO 用)

動作確認済みバージョン

ソフトウェア

バージョン

Claude Desktop

0.9.5

Claude Code

2.1.80

@modelcontextprotocol/sdk

1.27.1

Related MCP server: minio_mcp

セットアップ

MinIO の起動

docker compose up -d
  • API: http://127.0.0.1:9000

  • コンソール: http://127.0.0.1:9001(認証情報は docker-compose.ymlMINIO_ROOT_*

アプリの起動

yarn install
yarn build

# サーバー起動
yarn dev

環境変数

.env.example を参考に .env を作成してください。デフォルト値が設定されているため、MinIO をそのまま使う場合は .env なしでも動作します。

エンドポイント(HTTP モード)

パス

用途

GET /health

ヘルスチェック

POST /upload

HTTP マルチパートアップロード(フィールド名 file

POST /mcp

MCP(Streamable HTTP)

MCP ツール

ツール

デフォルト

用途

upload_file

有効

Base64 エンコードされたファイルを MinIO にアップロード

upload_via_curl

コメントアウト

HTTP POST /upload への curl コマンドを返す

upload_via_curl を有効にするには src/mcpServer.tsregisterUploadViaCurl(server, config) のコメントを外してビルドしてください。

Claude Desktop の設定

claude_desktop_config.json に Stdio 設定を記述します。

{
  "mcpServers": {
    "file-upload-sample": {
      "command": "/Users/YOURNAME/.nvm/versions/node/v22.x.x/bin/node",
      "args": [
        "/Users/YOURNAME/project/mcp-file-upload-sample/dist/index.js",
        "--stdio"
      ],
      "env": {
        "MINIO_ENDPOINT": "http://127.0.0.1:9000",
        "MINIO_ROOT_USER": "minioadmin",
        "MINIO_ROOT_PASSWORD": "minioadmin"
      }
    }
  }
}
  • command には Node.js 20+ のフルパスを指定してください(command -v node で確認)。

  • args のスクリプトパスには ~ を使わない絶対パスを指定してください(Desktop はシェルを経由しないため ~ が展開されません)。

  • パスの取得: リポジトリルートで echo "$(pwd -P)/dist/index.js" を実行し、出力をそのまま args[0] に使います。

Claude Code の設定

claude mcp add file-upload-sample \
  -s user \
  -e MINIO_ENDPOINT=http://127.0.0.1:9000 \
  -e MINIO_ROOT_USER=minioadmin \
  -e MINIO_ROOT_PASSWORD=minioadmin \
  -- node /Users/YOURNAME/project/mcp-file-upload-sample/dist/index.js --stdio
claude mcp list                        # 一覧
claude mcp remove file-upload-sample   # 削除

注意

サンプル用途のコードです。オープンな環境では使わないようにしてください。

F
license - not found
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    An MCP server that enables users to upload local files to S3-compatible storage and retrieve shareable public URLs. Files are automatically organized into unique UUID-based folders to prevent naming conflicts while preserving original filenames.
    Last updated
    21
    MIT
  • F
    license
    C
    quality
    D
    maintenance
    A FastMCP-based server that enables uploading text and base64-encoded content to MinIO object storage through an HTTP transport. It supports automated bucket management and secure file path generation to streamline remote storage operations.
    Last updated
  • F
    license
    A
    quality
    D
    maintenance
    Provides tools for interacting with MinIO and S3-compatible object storage through MCP clients like Claude. It enables comprehensive bucket and object management, including listing, creating, uploading, and generating presigned URLs.
    Last updated
    13
    2
  • A
    license
    -
    quality
    D
    maintenance
    MCP server for uploading, listing, and retrieving files on S3-compatible storage (AWS S3, DigitalOcean Spaces) with public/private access and temporary URLs.
    Last updated
    5
    MIT

View all related MCP servers

Related MCP Connectors

  • Encoding MCP — Base64 / Base64URL / Base32 / Hex.

  • File uploads for AI agents. Upload, list, and manage files. No signup required.

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chanrute/mcp-file-upload-sample'

If you have feedback or need assistance with the MCP directory API, please join our Discord server