MediaStore¶
Storage abstraction for binary media content.
Interface¶
Implementations¶
LocalMediaStore¶
Default backend. Stores files on the local filesystem.
| Config | Default | Description |
|---|---|---|
MCP_MESH_MEDIA_STORAGE_PATH | /tmp/mcp-mesh-media | Base directory |
MCP_MESH_MEDIA_STORAGE_PREFIX | media/ | Subdirectory prefix |
URI format: file:///path/to/file
S3MediaStore¶
Production backend for S3-compatible storage (AWS S3, MinIO).
| Config | Default | Description |
|---|---|---|
MCP_MESH_MEDIA_STORAGE_BUCKET | (required for s3 — no default) | Bucket name — must be set when backend is s3 |
MCP_MESH_MEDIA_STORAGE_ENDPOINT | (none) | Custom endpoint URL |
MCP_MESH_MEDIA_STORAGE_PREFIX | media/ | Key prefix |
MCP_MESH_MEDIA_STORAGE_VALIDATE | false | When true, run a head_bucket probe at startup |
AWS_ACCESS_KEY_ID | (none) | S3 access key (or use an IAM role) |
AWS_SECRET_ACCESS_KEY | (none) | S3 secret key (or use an IAM role) |
URI format: s3://bucket/prefix/filename
Fail-fast. There is no default bucket. When MCP_MESH_MEDIA_STORAGE=s3, construction fails fast: a missing boto3 raises RuntimeError, and an unset MCP_MESH_MEDIA_STORAGE_BUCKET raises ValueError. Set MCP_MESH_MEDIA_STORAGE_VALIDATE=true to also probe credentials and bucket reachability (opt-in head_bucket) before serving traffic.
Factory¶
Backend selected by MCP_MESH_MEDIA_STORAGE environment variable (local or s3).
See Also¶
- MediaStore Configuration -- Full setup guide
- Environment Variables -- All config options