AI Gateway MCP
io.github.ArmuleePublished by GitHub account Armuleev0.1.0Updated Oct 24, 2026
Pictures, video, voice and transcripts from any Vercel AI Gateway model, on your own Vercel copy.
Overview
Self-hosted Vercel connector that lets a chat app generate images, video, speech and transcripts through Vercel AI Gateway models, billed to your own credits.
- What you can do
- Generate and edit images, upscale them, and list media you made earlier
- Start, edit, extend, upscale and fetch video jobs, including motion transfer from a reference clip
- Turn text into speech and transcribe audio or video files, optionally with timestamps
- List AI Gateway models with catalog prices, generate text with another model, and check credits and spend
- Estimate the price of an image or video call before running it
- When to use it
- Useful when you want an assistant to produce media (pictures, clips, narration, transcripts) from inside a chat, with many models selectable and costs paid at provider list price through your own Vercel AI Gateway credits rather than a subscription.
- Requirements
- A Vercel account plus a GitHub, GitLab or Bitbucket account to deploy your own copy; a private Blob store for video and file links; a connector secret set as MCP_SECRET_SHA256 (or MCP_SECRET) in the URL path; Vercel AI Gateway credits; optional AI_GATEWAY_API_KEY for local use.
Installation
In SourceWeft
- Open AI Gateway MCP in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.
Other MCP clients
Follow the launch instructions in the repository.
README
[Deploy your own copy on Vercel, in one click]
One click, and you are done.
Vercel copies this repo to your account, makes your private storage and asks for one secret. Your copy then walks you through the rest.
[MIT license] [MCP over Streamable HTTP] [Next.js 16] [AI SDK with Vercel AI Gateway]
What you can make · How it works · Get started · What it costs · Tools · Keep it safe
The provider's own price, right inside your chat. No markup, no subscription, no API key. Add this connector to Claude, ChatGPT or any MCP app and it can make pictures, video and voice with 400+ models on Vercel AI Gateway: Veo, Kling, Seedance, Nano Banana, GPT Image, FLUX and more. You run your own copy on your own Vercel account, so every call is paid from your own Gateway credits at the price the provider sets.
[A chat on claude.ai: asked to paint a little fox collecting stars in watercolour the cheapest way, Claude compares prices, picks Recraft v4.1 Flash and shows the picture for $0.007. Asked to turn it into a short video the cheapest way, it picks HeyGen Video 1 and the five-second video plays in the chat, for $0.09.] A real chat on claude.ai, October 2026: a picture for $0.007, then a five-second video for $0.09 (HeyGen Video 1). Waiting while models work is sped up. See the demo.
What you can make
Ask in plain words. Your chat does the thinking and the writing with everything it already knows about you; the connector makes the pictures, the video and the voice.
Costs are AI Gateway catalog prices from October 2026, for the example quantities shown. They are examples, not quotes: the provider's bill can differ from the catalog (see What it costs), and each call reports what it actually cost. Ask list_models for today's catalog.
How it works
- You ask in chat. Claude, ChatGPT or any app that speaks MCP picks the right tool.
- Your own copy answers. It runs on your Vercel account and checks your secret link.
- AI Gateway runs the model, billed to your own credits at the provider's price. No API key: your copy signs in with Vercel's own token.
What is MCP? The Model Context Protocol is how chat apps plug in outside tools. This project is one of those tools: once you add its link, your chat app can make things with any model on AI Gateway.
Get started
You need a Vercel account and a GitHub, GitLab or Bitbucket account.
[Deploy your own copy on Vercel, in one click]
Then set a spend budget in the Vercel dashboard (AI Gateway → Budgets). It is the real limit on what your link can ever spend.
Your copy comes with its own setup page
Open your copy and it shows where you are: an arch of six stones, one per step. Set stones glow, the next one breathes, and clicking a stone opens its step.
Once every step is done, the guide steps aside for good. From then on your page opens on the brand and goes straight to your usage. If anything comes undone later (say MCP_SECRET_SHA256 is removed), the guide comes back by itself.
[Your usage, shown with sample numbers: $19.48 spent through this connector in the last 30 days, and spend per day as columns of light.]
Your usage, unlocked with your secret (shown here with sample numbers): what this connector spent, day by day, by model and by chat app.
What it costs
Nothing from this project: it is free and MIT licensed, with no plan and no fee. You pay what each provider charges, with no markup, through your own AI Gateway credits, and every Vercel team gets free monthly credits for a set of models. In Vercel's words (AI Gateway pricing):
AI Gateway charges no markup and no platform fee on tokens. You pay the provider's list price on a pay-as-you-go basis.
From the AI Gateway catalog, October 2026. The catalog is a guide, not the bill: the provider's charge can differ. In October 2026 bfl/flux-3-image was listed at $0.024 for a 1024x1024 picture while Black Forest Labs billed $0.048 (passed on with no surcharge); the catalog has since been corrected. Each call reports its actual cost; ask list_models for today's catalog.
This project is not made by or affiliated with Vercel. Version 1 means you run your own copy, so setup is as short as I could make it: the goal is for everyone to use AI at the price providers actually set.
Tools
Your chat app picks these for you; you never have to name them. Every tool returns readable errors that name the model: unknown model, not enough credits, video not on your plan, provider errors.
Every tool and its inputs
Inline viewer. In chat apps that support MCP Apps (Claude on the web, desktop and phone), generate_image, edit_image, upscale_image, get_video and list_files show their result right in the conversation: a picture grid, a video player and audio players, with Download, Upscale and Extend. Upscale and Extend ask the chat to run the tool, so nothing is spent behind your back. Other apps get the same pictures and links as plain content. If the Claude desktop app shows "Unable to reach AI Gateway" where the viewer should be after you change the connector URL (for example after rotating the secret), quit it fully (Cmd+Q on a Mac) and open it again.
Keep it safe
- Your link works like a password that spends money. Anyone who has it can use your AI Gateway credits. Keep it private.
- Set an AI Gateway budget. Only Vercel's budget limits your total spend.
- If the link leaks, make a new secret on your setup page, put its fingerprint in Project Settings → Environment Variables and redeploy. The old link stops working at once.
- Your usage is yours. Anyone can open your setup page, but the numbers only appear for someone who has your secret.
More on security and costs
- Your connector URL works like a password that spends money. Anyone who has it can use your AI Gateway credits and generate content under your Vercel account.
- Set an AI Gateway budget. This server caps each call (
MAX_VIDEO_SECONDS,MAX_IMAGES_PER_CALL,MAX_SPEECH_CHARACTERS,ALLOWED_MODELS), but only Vercel's budget limits your total spend. Tools that start from your own video (motion_control,upscale_video,edit_video) follow its length, which the per-call caps cannot see. - Rotate the secret if the URL leaks. Set a new fingerprint (or
MCP_SECRET) and redeploy. The old URL stops working right away, and any unfinished video jobs are abandoned. - Optional: rate-limit the endpoint. Guessing is hopeless, but every wrong request still counts toward your project's usage. If your plan includes Vercel Firewall rate limiting, add a rule for paths starting with
/mcp/(for example, by IP). Do not turn on Attack Challenge Mode for it: Claude's and ChatGPT's servers cannot solve the challenge, so your connector would stop working. - Files are private, but links are not. Pictures, videos and audio are stored in a private Blob store. Anyone who holds one of the links returned in chat can open that file until the link expires (
SIGNED_URL_TTL_HOURS). - Usage stats need the secret.
POST /api/statschecks it in constant time and answers 404 otherwise. Remembering the secret in a browser lets anyone using that browser see your usage; "Forget" removes it. - Logs: this app never logs the secret or request URLs. Vercel's own request logs record request paths, so members of your Vercel team can see the secret there.
- Generated media is stored exactly as the provider returns it. Watermarks and metadata are never removed.
Reference
Your secret
Your connector link is your deployment's address plus the secret. The setup page builds it in your browser:
The secret is a random value of at least 32 characters. The Deploy button doesn't ask for it: a fresh copy starts with the endpoint off, and its setup page makes one in your browser and remembers it there, so your link is filled in after the redeploy.
Vercel never gets the secret itself, only its SHA-256 fingerprint as MCP_SECRET_SHA256. A fingerprint can't be turned back into the secret, so anyone who can read your environment variables, or the chat you pasted the setup prompt into, still can't use your connector. The other side of this: Vercel can't show you your secret either. If you lose the browser that holds it (and it isn't in your phone or your chat app's connector settings), make a new one and redeploy.
To do it yourself: make a secret with openssl rand -hex 32, and set MCP_SECRET_SHA256 to the output of printf %s '<your-secret>' | shasum -a 256 (the hex part). For local development a plain MCP_SECRET=<your-secret> is simpler; the fingerprint wins when both are set. Use URL-safe characters only; hex is ideal.
A random 64-character hex secret holds 256 bits: guessing it over the network is not possible in practice, and every wrong guess gets the same 404 as any unknown URL, compared in constant time. Secrets typed by hand are the weak spot, so the endpoint also stays off when the secret has fewer than 8 different characters or repeats one short block (aaaa…, passwordpassword…).
claude.ai custom connectors only support OAuth or no auth, and they can't send custom headers, so the secret goes in the URL path. If no secret is set (or a plain MCP_SECRET is shorter than 32 characters, or the fingerprint isn't 64 hex characters), the MCP endpoint is disabled. A wrong secret gets the same 404 page as any unknown URL.
Configuration
Vercel sets the Blob variables (BLOB_STORE_ID, plus BLOB_READ_WRITE_TOKEN as a fallback) and VERCEL_OIDC_TOKEN automatically when the store is connected. Without a Blob store, text, pictures and voice still work inline; video and file links need one. Create a private Blob store under the project's Storage tab, connect it and redeploy. The setup page links there.
Local development
Test the server with the MCP Inspector:
Choose Streamable HTTP and connect to http://localhost:3000/mcp/<MCP_SECRET>.
The same tools also run over stdio, for local MCP clients and for directories that start the server to list its tools (Glama does this). Your deployment does not use it.
A stdio server is a process you start yourself, so it has no secret check: it spends whatever Gateway key it is given. MCP_SECRET only signs video job ids there. Listing the tools needs no variables at all.
Two development-only addresses preview states you cannot reach without a deployment: /?preview-open shows the page as it looks once setup is done, and /?sample-stats fills the usage with sample numbers.
How it works inside
- Setup page:
/checks the deployment live and guides each step, then hides the guide once every required step is done (agateway-opencookie, ignored whenever a server check fails). Black and white, drawn in code, with motion that rests finished under reduced motion./setupredirects there. - Usage stats: every call from this server carries AI Gateway tags (
ai-gateway-mcp,tool:<name>,client:<app>, the app guessed from its User-Agent). The setup page reads AI Gateway's own spend report filtered by those tags, so there is no database. The report is a paid-plan feature: on Hobby, Vercel answers 403 and the page says so instead (credits still show). Keeping our own log in Blob was ruled out: Hobby includes 2,000 Blob advanced operations a month, and going over blocks Blob for 30 days. - Inline viewer: one MCP Apps resource,
ui://gateway-mcp/media.html, built fromui/byscripts/build-ui.mjs(esbuild, beforedev,buildandtypecheck). Its CSP allowshttps://*.blob.vercel-storage.comfor images and media. - Stack: Next.js (App Router) and TypeScript. MCP is served over Streamable HTTP using
mcp-handlerv2, and model calls go through the AI SDK with the AI Gateway provider. - Secret check:
proxy.tsrejects a wrong secret before routing by rewriting it to the standard 404 page. The route handler then checks the secret again, in constant time. - Media in, media out: files you give a tool are downloaded by the server (https only, size-capped), so this server's own private links work as input. Video jobs send theirs as links, since AI Gateway keeps a job's start request small.
- Video jobs: no database. Each
job_idholds the model and the AI Gateway job id, signed with a key derived from the fingerprint (orMCP_SECRET) and only accepted from callers holding the secret, so it can't be forged.
License
MIT
Source: README.md at commit ebef21f
Tools
0Version history
1- v0.1.0LatestOct 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 daysRequired25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declaredRequired10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts