MCP upload_image base64 inflates token costs
The author analyzes the token costs and generation mechanics of passing base64-encoded images as arguments in Model Context Protocol (MCP) tools. Measurements using tiktoken show that a standard screenshot requires hundreds of thousands of tokens, making base64 impractical for model output. The author recommends alternative approaches such as passing public URLs with SSRF guards, using REST endpoints or upload URLs for local files, and reserving base64 strictly for small logos or icons. Open article →