Repository navigation
Transcribe local files: create_upload_url + /upload/<token> - #7
Open
hsingh-aai wants to merge 2 commits into
Open
hsingh-aai wants to merge 2 commits into
hsingh-aai wants to merge 2 commits into
Conversation
The server can't read files on the user's computer, and an agent signed in with OAuth never sees an API key to upload with. create_upload_url returns a 10-minute link whose token is the caller's key encrypted with AES-256-GCM; the agent POSTs the file there with curl, and the route forwards it to AssemblyAI's private /v2/upload and returns upload_url. Nothing is stored. The tool only registers when UPLOAD_TOKEN_SECRET is set. Files are capped at 4.5 MB by Vercel's request body limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- submit_transcript only mentions create_upload_url when it's offered - 4.5 MB limit uses Vercel's decimal cap; the tool tells agents what a plain-text 413 means and how to shrink the file - Upload route maps AssemblyAI errors in one small helper; 5xx becomes 502 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hsingh-aai
marked this pull request as ready for review
October 30, 2026 21:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
submit_transcriptonly takes a public URL. An agent in Claude Code, Cursor or Codex can see a file on the user's computer, but our server can't, and an agent signed in with OAuth never sees an API key it could upload with. So today "transcribe this file on my Mac" fails.How it works
create_upload_url. It returns a link,https://mcp.assemblyai.com/upload/<token>, and a readycurlcommand.curl --data-binary @file <link>./upload/<token>decrypts the token, forwards the bytes to AssemblyAI's privatePOST /v2/uploadwith the caller's key, and returns{ "upload_url": ... }.upload_urltosubmit_transcriptas usual.The token is the caller's API key plus an expiry, encrypted with AES-256-GCM under
UPLOAD_TOKEN_SECRET. The agent never sees the key, and the server stores nothing.Security notes (for review)
keyHash). Tampered, expired or other-secret tokens get a 401 without calling AssemblyAI.UPLOAD_TOKEN_SECRETis set, so merging changes nothing in production until we add the secret.Limits
curl, so ChatGPT and Claude.ai are not covered. ChatGPT uploads get their own change (fileParams).Rollout
UPLOAD_TOKEN_SECRET(32+ random characters) to Production and Preview in Vercel.How it was tested
npm run typecheckandnpm run buildpass.npm test: 114 smoke tests (13 new, #45–48) + 32 OAuth tests. The new tests cover:/v2/uploadwith the raw key andapplication/octet-stream;next start+ a fake AssemblyAI):tools/call create_upload_urlreturned a link on the request's host;curluploaded a 396 KB file and gotupload_urlback; the fake API received all 396,000 bytes with the raw key; a bogus link got a 401; logs held only the key hash.🤖 Generated with Claude Code