loading…
Search for a command to run...
loading…
A media transcoding proxy with an MCP control surface for generating optimized media URLs, primarily for offline delivery in Bible translation projects.
A media transcoding proxy with an MCP control surface for generating optimized media URLs, primarily for offline delivery in Bible translation projects.
A media transcoding proxy. An automagic URL that drops into an <img> or <audio> tag with zero integration, plus an MCP control surface so an LLM can generate optimized URLs on behalf of a user.
The primary use case is packaging media resources for offline delivery in Bible translation projects — ensuring images and audio attached to a pericope assignment are as small as possible for a cheap Android phone with limited storage and a slow connection.
Outcome: smaller files at acceptable perceived quality, delivered fast and cheap, for offline packaging on constrained devices.
Cost function (what we minimize): bytes per delivered media asset.
Constraints in tension (the quality attributes this project holds simultaneously, per klappy://canon/methods/quality-attribute-tension-survey):
| Constraint | Floor / ceiling | Why it tensions |
|---|---|---|
| Perceived quality | ≥ the floor set by the request's q=low/med/high preset |
A smaller file that looks unacceptable is a failure, not a win |
| Transcode wall time | Worker + container budget; first-request latency | A perfect file the user waited too long for is a failure |
| Implementation simplicity | One Worker, one Container, presets as data, no per-request classification | Sophistication that won't survive a year of maintenance is a failure |
| Maintainability | One person can operate it indefinitely | Configuration sprawl is a failure |
| Bandwidth cost (egress) | Cloudflare egress on cache miss; R2 cost on hit | Bytes paid twice is a failure |
| Storage cost (R2) | Content-addressed; lifecycle GC | Stored variants that won't be re-read are a failure |
Decision protocol: any encoder choice (resolution, quality, format, codec, sample rate) is evaluated against ALL of these simultaneously. There is no single "right value" derived from geometry. There is a set of candidate configurations, each scored on bytes-and-quality-and-time-and-simplicity, and the one that holds all the constraints with the smallest byte cost wins. When constraints conflict, the operator (or the canon planning doc for the relevant class) names the trade explicitly — not implicitly by picking one and ignoring the others.
Core principle (canon/handoffs/2026-05-26-exploration-journal.md): spend nothing on what the human can't perceive; control the character of the loss; the system of constraints is the trick.
If a proposed rule reduces bytes but degrades quality below the floor — reject. If it improves quality but costs bytes the user can't perceive — reject. If it improves both but adds a per-request classifier that won't survive maintenance — reject. The art is in holding all of them at once.
Orientation: Before I speak, I observe. Before I claim, I verify. Before I confirm, I prove. What I have not seen, I do not know. What I have not verified, I will not imply.
See full details in canon/values/project-identity.md and the full goal framing in canon/values/project-goal.md.
Execution phase — Core functionality live
generate_transcode_url (with perceptual half-class math) + docs (canon proxy via oddkit)/image/* and /audio/*generate_transcode_url to get optimized proxy URLs.docs Tool: Proxies natural language queries to the project's canon (following the PTXprint-MCP / oddkit pattern).See ARCHITECTURE.md for current state.
The MCP server is tested at four layers, in order of feedback speed:
bun test runs the suite. The pure URL-construction and tool-response builders are tested directly (no MCP SDK, no network):
bun test
Covers: viewport → s= mapping, raw w/h escape hatch precedence, quality and format passthrough, the full response shape (proxy_path, full_url, embed, request echo, guidance), audio passthrough, source-aspect-aware shortest-side resolution, URL parser validation.
smoke-mcp.ts is a no-mocks JSON-RPC client that POSTs to a deployed /mcp endpoint and asserts the responses. Same protocol Claude Desktop / Cursor / the Inspector would use.
bun smoke-mcp.ts # production
bun smoke-mcp.ts preview # current branch preview
bun smoke-mcp.ts https://your-deploy.workers.dev
Covers: initialize handshake (protocol version, server info, tools capability), tools/list (schema advertises viewport + q/f/w/h), tools/call for image (viewport → s=, w overrides), tools/call for audio. Exits non-zero on first failure.
The official MCP Inspector is a web UI that connects to any MCP server, shows the advertised tools/schemas, and lets you fire tools/call requests by hand. Best for human verification and exploring the response payload.
npx @modelcontextprotocol/inspector
# In the UI:
# Transport: Streamable HTTP
# URL: https://transcode-mcp.klappy.workers.dev/mcp
Point a real client at the deployed /mcp endpoint to verify it integrates correctly with the runtime an LLM agent would actually use.
Claude Desktop — edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"transcode-mcp": {
"type": "http",
"url": "https://transcode-mcp.klappy.workers.dev/mcp"
}
}
}
Restart Claude Desktop. Ask the model to "use the transcode tool to make a proxy URL for [image URL] at 720px shortest side."
Cursor / Claude Code — same config shape in their respective MCP settings, pointing at the same /mcp URL.
The project's durable record lives in canon/. Exploration artifacts, planning decisions, and session journals are committed there as they are produced. The canon is the source of truth — not this README, not inline comments, not conversation memory.
canon/handoffs/ — session journalscanon/encodings/ — DOLCHEO+ structured decision recordscanon/planning/ — planning session artifactscanon/values/ — project identity, orientation, axioms, and the goalcanon/constraints/ — definition of done, core governance baselineAgent operating protocol: at the start of every session in this repo, the first oddkit calls are get on canon/values/project-goal.md and canon/values/project-identity.md. The goal is the cost function; the identity is the creed. Skipping either is how rules get built against the wrong objective.
TBD ("pay it forward, pay it back" model under consideration)
Run in your terminal:
claude mcp add transcode-mcp -- npx Security
Low riskAutomated heuristic from public metadata — not a security guarantee.