aws-samples / aws-samples/sample-spec-driven-presentation-maker

[Feature Request] 外部MCPクライアント(Claude.ai等)から画像をデッキに取り込む手段がない

Open
#75 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
128
Forks
10
Avg merge
4d 40m
Merged PRs (30d)
8

Description

素晴らしいプロジェクトを公開いただきありがとうございます。Layer 2 を Kiro から、Layer 3 を Claude.ai のカスタムコネクタから利用しています。


やりたいこと


Claude.ai のチャットに添付した写真やスクリーンショットを、スライドに埋め込みたい。


現状の制約


外部 MCP クライアント(Claude.ai、Claude Desktop、Kiro 等)から Layer 3 のリモート MCP サーバーを利用する場合、ユーザーがクライアント側で添付した画像をデッキのワークスペースに取り込む導線がありません。



既存ツール | 制約
-- | --
save_web_image | 公開 URL が必要。ローカル画像は不可
read_uploaded_file | Layer 4 Web UI 経由の upload_id が必要。外部クライアントが発行できない
run_python(files=...) | テキストファイルのみ。バイナリ非対応


Layer 4 の Web UI は REST API 経由で S3 に直接アップロードし、MCP サーバーと同じバケットを共有しているため問題が起きません。しかし、Layer 3 を Layer 4 の Web UI なしで使う場合(MCP クライアントから直接接続)、この導線が存在しません。


提案


以下のいずれか(または両方)の対応を検討いただけないでしょうか。


案 A: base64 画像受け取りツールの追加(最小改修)


python
@mcp.tool()

async def upload_image(deck_id: str, filename: str, data_base64: str) -> str:
"""Base64エンコードされた画像をデコードしてデッキのimages/に保存する"""
image_bytes = base64.b64decode(data_base64)
await storage.put_file(f"decks/{deck_id}/images/{filename}", image_bytes)
return json.dumps({"status": "ok", "key": f"decks/{deck_id}/images/{filename}"})

Claude.ai はコンテキスト内の画像を base64 として認識できるため、このツールがあれば save_web_image と同様にスライドへの画像埋め込みが可能になります。


案 B: run_python(files=...) のバイナリ対応


既存の files パラメータが base64 エンコードされたバイナリも受け取れるように拡張する。


補足



  • スキーマは dict リテラルで定義すれば Gateway の $ref 制約に抵触しません

  • ファイル名のサニタイズ、拡張子ホワイトリスト、サイズ上限は必要です

  • 既存の _check_deck_access() による認可チェックはそのまま適用できます


環境



  • Layer 3 + AgentCore Gateway 経由

  • クライアント: Claude.ai カスタムコネクタ(モバイル含む)、Kiro

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.