Example Apps
Mosaic MCP Server
LLM-friendly wrapper around Mosaic’s REST API – run locally or deploy to the cloud.
This example spins up a tiny server that turns Mosaic REST calls into FastMCP tools – perfect for ChatGPT function-calling or your own agents.
mosaic-mcp/
is a FastMCP 2.0 micro-service that exposes Mosaic helpers as callable tools – perfect for ChatGPT function-calling, custom agents, or simple HTTP usage.
1 · What it does
• Streams uploads directly to Mosaic (no local disk bloat)
• Offers tools like upload_video_from_local_file
, create_or_run_agent
, get_output_urls
• Transport-agnostic: run as streamable HTTP (default) or pure stdio for CLI embedding.
2 · Environment variables
3 · Install & run
Container (Fly.io example)
4 · Tool reference
Tool | Key args | Notes |
---|---|---|
upload_video_from_local_file | file bytes/path, filename? | Streams with 1 MiB chunks |
upload_video_from_url | url | Size-checked download then upload |
create_or_run_agent | file_id , either agent or prompt , auto? | If prompt present → agent_id null |
get_run_status | run_id | {status, progress} |
get_output_urls | run_id | Array of CDN links |
list_agents | — | Returns curated AGENTS dict |
The helper coroutines are async. When called over HTTP, FastMCP awaits them for you.
5 · Customising / extending
- Add new helper – decorate an
async def
with@mcp.tool
; FastMCP auto-docs it. - Swap in your own
AGENTS
mapping (copy IDs fromGET /get-user-agents-simple
). - Deploy multiple replicas – uploads go straight to Mosaic’s storage so the service stays stateless.