mirror of
https://github.com/Dasemu/gemini-media-mcp.git
synced 2026-11-26 07:16:09 +00:00
chore: drop Zenvairo branding ahead of repo transfer
Removes the org name/URLs from docs, deploy configs, package scope and internal service/test strings, and drops the stale shared-LXC nginx snapshot (deploy/default.conf.lxc210) that also exposed sibling services. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c93abc1781
commit
685c02ed81
17 files changed
+29
-177
No files matched your search
+1
-1
@@ -2,7 +2,7 @@ GEMINI_API_KEY=
|
||||
MCP_SERVER_TOKEN=replace-with-a-long-random-secret
|
||||
HOST=127.0.0.1
|
||||
PORT=8087
|
||||
PUBLIC_BASE_URL=https://mcp.zenvairo.es/zenvairogoogle
|
||||
PUBLIC_BASE_URL=https://mcp.example.com/media-mcp
|
||||
PUBLIC_MEDIA_SIGNING_SECRET=replace-with-at-least-32-random-characters
|
||||
PUBLIC_MEDIA_URL_TTL_SECONDS=86400
|
||||
MEDIA_DIR=/opt/gemini-veo-mcp/media
|
||||
|
||||
+2
-2
@@ -4,8 +4,8 @@ dist/
|
||||
deploy/.basic-password
|
||||
deploy/.server-token
|
||||
deploy/gemini-veo-mcp.env
|
||||
deploy/zenvairogoogle.conf
|
||||
deploy/zenvairogoogle.htpasswd
|
||||
deploy/media-mcp.conf
|
||||
deploy/media-mcp.htpasswd
|
||||
media/*
|
||||
!media/.gitkeep
|
||||
gemini-veo-mcp.env
|
||||
@@ -25,7 +25,7 @@ MCP tool handlers in `src/tools.ts` dispatch to `src/provider.ts` (Gemini/Veo AP
|
||||
- No `development` branch exists yet; branch from `main` until one is created.
|
||||
|
||||
## Deployment
|
||||
Deployed to an Alpine LXC container (OpenRC service `gemini-veo-mcp`, bound to `127.0.0.1:8087`, nginx reverse-proxying `/zenvairogoogle/`). See `README.md` for the update/restart commands and `docs/deployment.md` for full details.
|
||||
Deployed to an Alpine LXC container (OpenRC service `gemini-veo-mcp`, bound to `127.0.0.1:8087`, nginx reverse-proxying `/media-mcp/`). See `README.md` for the update/restart commands and `docs/deployment.md` for full details.
|
||||
|
||||
## Gotchas
|
||||
- Veo 3.1 always generates audio; `with_audio=false` is rejected explicitly.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Zenvairo Media Generator MCP
|
||||
# Gemini Veo Media MCP
|
||||
|
||||
Remote, stateless (Streamable HTTP) MCP server for image generation with Gemini and video generation with Veo 3.1. It follows the `submit + poll` contract: `generate_image`/`generate_video` return a UUID immediately and `query_tasks` delivers the final result.
|
||||
|
||||
|
||||
@@ -1,148 +0,0 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
|
||||
location /zenvairogit/ {
|
||||
auth_basic "ZenvairoGit MCP";
|
||||
auth_basic_user_file /etc/nginx/htpasswd/zenvairogit;
|
||||
|
||||
proxy_pass http://127.0.0.1:8081/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host 127.0.0.1;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Origin "";
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
|
||||
proxy_set_header Mcp-Protocol-Version $http_mcp_protocol_version;
|
||||
proxy_set_header Mcp-Session-Id $http_mcp_session_id;
|
||||
}
|
||||
|
||||
location /zenvairocloud/ {
|
||||
auth_basic "ZenvairoCloud MCP";
|
||||
auth_basic_user_file /etc/nginx/htpasswd/zenvairocloud;
|
||||
|
||||
proxy_pass http://127.0.0.1:8082/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host 127.0.0.1:8082;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Origin "";
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
|
||||
proxy_set_header Mcp-Session-Id $http_mcp_session_id;
|
||||
}
|
||||
|
||||
location /zenvairoanalytics/ {
|
||||
auth_basic "ZenvairoAnalytics MCP";
|
||||
auth_basic_user_file /etc/nginx/htpasswd/zenvairoanalytics;
|
||||
|
||||
proxy_pass http://127.0.0.1:8083/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host 127.0.0.1:8083;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Origin "";
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
|
||||
proxy_set_header Mcp-Session-Id $http_mcp_session_id;
|
||||
}
|
||||
|
||||
location /zenvairomail/ {
|
||||
auth_basic "ZenvairoMail MCP";
|
||||
auth_basic_user_file /etc/nginx/htpasswd/zenvairomail;
|
||||
|
||||
proxy_pass http://127.0.0.1:8084/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host 127.0.0.1:8084;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Origin "";
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
|
||||
proxy_set_header Mcp-Session-Id $http_mcp_session_id;
|
||||
}
|
||||
|
||||
location /zenvairocrm/ {
|
||||
auth_basic "ZenvairoCRM MCP";
|
||||
auth_basic_user_file /etc/nginx/htpasswd/zenvairocrm;
|
||||
|
||||
proxy_pass http://127.0.0.1:8085/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host 127.0.0.1:8085;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Origin "";
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
|
||||
proxy_set_header Mcp-Session-Id $http_mcp_session_id;
|
||||
}
|
||||
|
||||
# Archivos subidos con upload_media: SIN Basic Auth, para que Meta pueda
|
||||
# descargarlos al publicar (nombre de archivo aleatorio tipo UUID).
|
||||
location /zenvairosocial/media/ {
|
||||
proxy_pass http://127.0.0.1:8086/media/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host 127.0.0.1:8086;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
}
|
||||
|
||||
location /zenvairosocial/ {
|
||||
auth_basic "ZenvairoSocial MCP";
|
||||
auth_basic_user_file /etc/nginx/htpasswd/zenvairosocial;
|
||||
|
||||
proxy_pass http://127.0.0.1:8086/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host 127.0.0.1:8086;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Origin "";
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
|
||||
proxy_set_header Mcp-Protocol-Version $http_mcp_protocol_version;
|
||||
proxy_set_header Mcp-Session-Id $http_mcp_session_id;
|
||||
}
|
||||
|
||||
include /etc/nginx/http.d/zenvairogoogle.inc;
|
||||
|
||||
location = / {
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ GEMINI_API_KEY=
|
||||
MCP_SERVER_TOKEN=__MCP_SERVER_TOKEN__
|
||||
HOST=127.0.0.1
|
||||
PORT=8087
|
||||
PUBLIC_BASE_URL=https://mcp.zenvairo.es/zenvairogoogle
|
||||
PUBLIC_BASE_URL=https://mcp.example.com/media-mcp
|
||||
PUBLIC_MEDIA_SIGNING_SECRET=replace-with-at-least-32-random-characters
|
||||
PUBLIC_MEDIA_URL_TTL_SECONDS=86400
|
||||
MEDIA_DIR=/opt/gemini-veo-mcp/media
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Public only when the application validates the expiring HMAC signature.
|
||||
location /zenvairogoogle/public-media/ {
|
||||
location /media-mcp/public-media/ {
|
||||
auth_basic off;
|
||||
|
||||
proxy_pass http://127.0.0.1:8087/public-media/;
|
||||
@@ -14,9 +14,9 @@
|
||||
proxy_read_timeout 600s;
|
||||
}
|
||||
|
||||
location /zenvairogoogle/media/ {
|
||||
auth_basic "Zenvairo Google Media MCP";
|
||||
auth_basic_user_file /etc/nginx/htpasswd/zenvairogoogle;
|
||||
location /media-mcp/media/ {
|
||||
auth_basic "Media MCP";
|
||||
auth_basic_user_file /etc/nginx/htpasswd/media-mcp;
|
||||
|
||||
proxy_pass http://127.0.0.1:8087/media/;
|
||||
proxy_http_version 1.1;
|
||||
@@ -32,9 +32,9 @@
|
||||
proxy_send_timeout 600s;
|
||||
}
|
||||
|
||||
location /zenvairogoogle/ {
|
||||
auth_basic "Zenvairo Google Media MCP";
|
||||
auth_basic_user_file /etc/nginx/htpasswd/zenvairogoogle;
|
||||
location /media-mcp/ {
|
||||
auth_basic "Media MCP";
|
||||
auth_basic_user_file /etc/nginx/htpasswd/media-mcp;
|
||||
client_max_body_size 40m;
|
||||
|
||||
proxy_pass http://127.0.0.1:8087/;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
# Deployment on LXC 210 (Alpine/OpenRC)
|
||||
|
||||
The operational install lives in `/opt/gemini-veo-mcp`, runs as `mcp:mcp`, binds to `127.0.0.1:8087` and is supervised by OpenRC (`gemini-veo-mcp`). nginx protects `/zenvairogoogle/` with Basic auth and leaves only `/zenvairogoogle/public-media/` public; the application requires a valid, expiring HMAC signature on that route.
|
||||
The operational install lives in `/opt/gemini-veo-mcp`, runs as `mcp:mcp`, binds to `127.0.0.1:8087` and is supervised by OpenRC (`gemini-veo-mcp`). nginx protects `/media-mcp/` with Basic auth and leaves only `/media-mcp/public-media/` public; the application requires a valid, expiring HMAC signature on that route.
|
||||
|
||||
To add the API key:
|
||||
|
||||
@@ -22,7 +22,7 @@ Reference for the deployment files in `deploy/`:
|
||||
|
||||
- `gemini-veo-mcp.openrc`: OpenRC service.
|
||||
- `gemini-veo-mcp.env.template`: environment variable template (no real secrets).
|
||||
- `default.conf.lxc210`, `nginx-location.conf`: nginx configuration.
|
||||
- `nginx-location.conf`: nginx configuration.
|
||||
|
||||
## Paid integration test
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
`query_tasks` uses `include_base64=false` by default so binaries do not accidentally enter the LLM context. Each output returns `index`, `mimeType`, `sizeBytes`, `sha256`, the protected `downloadUrl` and a signed `publicUrl` that Meta can download without credentials. Base64 remains available explicitly with `include_base64=true` when the job's aggregate binary size is at most **25 MiB exactly (26,214,400 bytes)**.
|
||||
|
||||
`publicUrl` uses the same domain under `/zenvairogoogle/public-media/...`, carries an HMAC signature bound to the file name and expiry, and lasts 24 hours by default (`PUBLIC_MEDIA_URL_TTL_SECONDS=86400`). The route accepts neither Basic nor Bearer because Meta must read it directly; without a valid signature it responds 403 and an expired signature responds 410. Each later `query_tasks` call issues a fresh URL while the result is still retained.
|
||||
`publicUrl` uses the same domain under `/media-mcp/public-media/...`, carries an HMAC signature bound to the file name and expiry, and lasts 24 hours by default (`PUBLIC_MEDIA_URL_TTL_SECONDS=86400`). The route accepts neither Basic nor Bearer because Meta must read it directly; without a valid signature it responds 403 and an expired signature responds 410. Each later `query_tasks` call issues a fresh URL while the result is still retained.
|
||||
|
||||
The `downloadUrl` under `/zenvairogoogle/media/...` stays protected by the connector's HTTP Basic credentials. A Google, GCS or third-party CDN URL is never returned. The HMAC key (`PUBLIC_MEDIA_SIGNING_SECRET`, minimum 32 characters) exists only on the server and never appears in schemas, logs or responses.
|
||||
The `downloadUrl` under `/media-mcp/media/...` stays protected by the connector's HTTP Basic credentials. A Google, GCS or third-party CDN URL is never returned. The HMAC key (`PUBLIC_MEDIA_SIGNING_SECRET`, minimum 32 characters) exists only on the server and never appears in schemas, logs or responses.
|
||||
|
||||
To publish without copying or moving base64, pass `outputs[].publicUrl` directly to SocialMCP's `publish_post` as `imageUrl`, `videoUrl` or `media[].url`. Do not call `upload_media` first.
|
||||
|
||||
|
||||
Generated
+2
-2
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@zenvairo/gemini-veo-mcp",
|
||||
"name": "gemini-veo-mcp",
|
||||
"version": "1.1.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@zenvairo/gemini-veo-mcp",
|
||||
"name": "gemini-veo-mcp",
|
||||
"version": "1.1.0",
|
||||
"dependencies": {
|
||||
"@google/genai": "2.23.0",
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@zenvairo/gemini-veo-mcp",
|
||||
"name": "gemini-veo-mcp",
|
||||
"version": "1.1.0",
|
||||
"private": true,
|
||||
"description": "Remote Streamable HTTP MCP server for Google Gemini image and Veo video generation",
|
||||
|
||||
@@ -2,7 +2,7 @@ import sys, json
|
||||
from PIL import Image, ImageDraw, ImageFont, ImageFilter
|
||||
|
||||
W, H = 720, 1280
|
||||
POPPINS_BOLD = "/usr/share/fonts/zenvairo/Poppins-Bold.ttf"
|
||||
POPPINS_BOLD = "/usr/share/fonts/truetype/poppins/Poppins-Bold.ttf"
|
||||
NAVY = (10, 22, 48)
|
||||
CYAN = (45, 224, 234)
|
||||
WHITE = (255, 255, 255)
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ export async function composeVideoOverlay(
|
||||
baseOutput: StoredOutput,
|
||||
overlays: VideoOverlay[],
|
||||
): Promise<StoredOutput[]> {
|
||||
const workDir = await mkdtemp(path.join(os.tmpdir(), "zenvairo-compose-"));
|
||||
const workDir = await mkdtemp(path.join(os.tmpdir(), "media-compose-"));
|
||||
const temporaryOutput = path.join(mediaDir, `${generationId}-0.download`);
|
||||
try {
|
||||
const metadata = await probeVideo(baseOutput.path);
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@ const orphanCleanupInterval = setInterval(() => void orphanCleanup().catch((erro
|
||||
orphanCleanupInterval.unref();
|
||||
|
||||
function buildServer(): McpServer {
|
||||
const server = new McpServer({ name: "zenvairo-google-media", version: "1.0.0" });
|
||||
const server = new McpServer({ name: "gemini-veo-media", version: "1.0.0" });
|
||||
registerTools(server, jobs);
|
||||
return server;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ app.get("/public-media/:filename", async (req, res) => {
|
||||
|
||||
app.use(authenticate);
|
||||
|
||||
app.get("/health", (_req, res) => res.json({ ok: true, service: "zenvairo-google-media", googleCredentialsConfigured: Boolean(process.env.GEMINI_API_KEY), publicMediaSigningConfigured: publicMediaSigningConfigured() }));
|
||||
app.get("/health", (_req, res) => res.json({ ok: true, service: "gemini-veo-media", googleCredentialsConfigured: Boolean(process.env.GEMINI_API_KEY), publicMediaSigningConfigured: publicMediaSigningConfigured() }));
|
||||
app.get("/media/:filename", (req, res) => {
|
||||
if (!/^[0-9a-f-]{36}-\d+\.(png|jpg|mp4)$/.test(req.params.filename)) return res.status(404).json({ error: "not_found" });
|
||||
return res.sendFile(req.params.filename, { root: mediaDir, dotfiles: "deny", maxAge: 0 }, (error) => {
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ export function validatePublicMediaSignature(
|
||||
|
||||
function sign(filename: string, expires: number, secret: string): string {
|
||||
return createHmac("sha256", secret)
|
||||
.update(`zenvairo-public-media-v1\n${filename}\n${expires}`, "utf8")
|
||||
.update(`media-mcp-public-media-v1\n${filename}\n${expires}`, "utf8")
|
||||
.digest("base64url");
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@ export function registerTools(server: McpServer, jobs: JobManager): void {
|
||||
server.tool("who_am_i", "List available Google image/video models, accepted arguments and current cost estimates.", {
|
||||
taskTraceId: taskTraceIdSchema,
|
||||
}, async ({ taskTraceId }) => jsonResult({
|
||||
service: "Zenvairo Google Media MCP",
|
||||
service: "Gemini Veo Media MCP",
|
||||
taskTraceId,
|
||||
backend: "Gemini Developer API",
|
||||
authentication: { googleCredentialsConfigured: Boolean(process.env.GEMINI_API_KEY), credentialsExposed: false },
|
||||
@@ -133,7 +133,7 @@ export function registerTools(server: McpServer, jobs: JobManager): void {
|
||||
if (job.status === "COMPLETED" && job.outputs) {
|
||||
const allPresent = (await Promise.all(job.outputs.map(outputExists))).every(Boolean);
|
||||
if (!allPresent) return jsonResult({ ...payload, status: "FAILED", error: { code: "MEDIA_EXPIRED", message: "Generated media is no longer available", retryable: false } }, true);
|
||||
payload.outputs = await outputPayload(job.outputs, process.env.PUBLIC_BASE_URL || "https://mcp.zenvairo.es/zenvairogoogle", include_base64);
|
||||
payload.outputs = await outputPayload(job.outputs, process.env.PUBLIC_BASE_URL || "http://127.0.0.1:8087", include_base64);
|
||||
}
|
||||
return jsonResult(payload, job.status === "FAILED");
|
||||
});
|
||||
|
||||
@@ -37,7 +37,7 @@ test("real Veo generation -> local overlay composition -> signed public URL", {
|
||||
base_generation_id: submitted.generationId,
|
||||
taskTraceId,
|
||||
overlays: [
|
||||
{ kicker: "ZENVAIRO", text: "La automatización no debería sentirse genérica", style: "normal", start_time: 0.6, duration: 2.5 },
|
||||
{ kicker: "DEMO", text: "La automatización no debería sentirse genérica", style: "normal", start_time: 0.6, duration: 2.5 },
|
||||
{ kicker: "ACTÚA AHORA", text: "Convierte procesos en ventaja", style: "cta", start_time: 4.8, duration: 2.5 },
|
||||
],
|
||||
} }));
|
||||
@@ -46,7 +46,7 @@ test("real Veo generation -> local overlay composition -> signed public URL", {
|
||||
assert.equal(composed.model, "ffmpeg-overlay");
|
||||
assert.equal(composed.outputs[0].mimeType, "video/mp4");
|
||||
assert.equal(composed.outputs[0].base64, undefined);
|
||||
assert.match(composed.outputs[0].publicUrl, /^https:\/\/mcp\.zenvairo\.es\/zenvairogoogle\/public-media\//);
|
||||
assert.match(composed.outputs[0].publicUrl, /^http:\/\/127\.0\.0\.1:8087\/public-media\//);
|
||||
|
||||
const publicResponse = await fetch(composed.outputs[0].publicUrl);
|
||||
assert.equal(publicResponse.status, 200);
|
||||
|
||||
Reference in new issue
Block a user