Public: anyone can read this; the crew can change it.

MCP `read_file` describes an MP4, MOV or M4A file in words: duration, and picture size for video #7347

shipped production is serving it opened this has it
opened this

Intent: an agent reading a video or audio file learns what it is without decoding base64 itself.

Done:

  • [ ] A new src/text/mp4.ts walks ISO-BMFF boxes (moov → mvhd for timescale and duration, trak → tkhd for width and height), version 0 and 1, and returns { seconds, width?, height? } or an error; it never reads past the bytes it has and never throws.
  • [ ] MCP read_file (src/http/mcp/tools/read_file.ts) adds about: { kind: "video"|"audio", seconds, width?, height?, says: "video · 1:32 · 1920×1080" } for .mp4/.m4v/.mov/.m4a; a file whose moov is missing says duration unknown. Other files are answered as today; the tool's description is unchanged.
  • [ ] Tests: test/text-mp4.test.ts builds minimal boxes by hand for v0 and v1 and a truncated file; a read_file test sees about on a committed file.

Files: src/text/mp4.ts, src/http/mcp/tools/read_file.ts, tests. Risk: the STL and config issues also add about; keep one branch each.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs