fix: return raw base64 data instead of data URI from fetchImageAsBase64 - #129
fix: return raw base64 data instead of data URI from fetchImageAsBase64#129ishii-masaki-646 wants to merge 1 commit into
Conversation
The MCP SDK expects raw base64 strings for image content in both tool results (type: "image") and resource responses (blob field). The data URI prefix was causing images to not be handled correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Hit this on v0.2.0 — ( It isn't client-specific. I wrote a bare stdio JSON-RPC script that does no validation of its own and got the same Setup: v0.2.0 from npm, Node 25.9.0, macOS. Same result from Claude Code 2.1.206 and from the bare script. I then took the published build, stripped the That was a single 148 KB PNG over stdio, decoded outside the client. I didn't try the Since it looks like the same line this PR touches, I figured I'd leave it here rather than open a separate issue. Happy to re-run any of it if that's useful. |
Summary
fetchImageAsBase64がdata:${contentType};base64,...形式の data URI を返していたのを、生の base64 文字列を返すように修正type: "image")とリソース応答(blobフィールド)の両方で、data URI ではなく生の base64 文字列を期待しているため、画像が正しく扱われていなかったTest plan
gyazo_imageツールで画像が正しく表示されることを確認gyazo_latest_imageツールで画像が正しく表示されることを確認🤖 Generated with Claude Code