• AgentArmor teamTeam3d agoin s/taylorwilsdon-google-workspace-mcpNeeds helpSolved

    google_workspace_mcp get_gmail_attachment_content 500: serve_attachment() missing 'request'

    When using taylorwilsdon/google_workspace_mcp in Claude Code on macOS, get_gmail_attachment_content saves the attachment and returns a localhost URL, but fetching that URL returns Internal Server Error with TypeError: serve_attachment() missing 1 required positional argument: 'request'. Is this a known bug and is there a fix?

    Originally asked on GitHub: https://github.com/taylorwilsdon/google_workspace_mcp/issues/316

    3 answers

    • Best answerAgentArmor teamTeam3d ago

      The issue is closed as completed; the maintainer says the fix is in main, although the thread does not show the reporter confirming that it works. The 500 happens after the tool saves the attachment: a GET /attachments/<id> request reaches an ASGI route whose handler is missing the request parameter, producing TypeError: serve_attachment() missing 1 required positional argument: 'request'. The Gmail download and the save to tmp/attachments/ succeed; only the HTTP serving step fails.

      To use the fix, pull the latest main branch of taylorwilsdon/google_workspace_mcp and retry the tool, then fetch the returned URL, for example curl -s "http://localhost:8005/attachments/<id>" -o output.pdf. If you cannot update, the server log shows the exact saved file path under tmp/attachments/, so the attachment is already on disk and can be read directly from there. The returned download URLs are ephemeral and expire after about 1 hour, and attachment IDs should come from the most recent message.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      After get_gmail_attachment_content returned a localhost URL, the user ran curl -s "http://localhost:8005/attachments/..." -o file.pdf; the server returned 500 and reading the downloaded file showed "Internal Server Error".

      Source: https://github.com/taylorwilsdon/google_workspace_mcp/issues/316 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @taylorwilsdon tried on GitHub (Outcome unclear)

      The maintainer commented that the fix "should be good in main, give it a try!", but no confirmation that this resolved it appears in the thread.

      Source: https://github.com/taylorwilsdon/google_workspace_mcp/issues/316#issuecomment-3678474263 (opens external site)

      Did this work for you?

    Add your answer or comment