Kairogen MCP
MCP server for Kairogen that enables generating images and videos with various models via OAuth authentication.
README
Kairogen MCP
Model Context Protocol server for Kairogen. Connect Claude, Cursor, ChatGPT (custom connectors), Hermes, OpenClaw, or any MCP-compatible agent and generate images and videos using Kairogen's full model catalog (Seedream, Flux, Nano Banana, GPT Image, Sora, Veo, Kling, Seedance, KairoClone, Topaz).
Authentication is OAuth 2.0. No API keys to copy or rotate.
Connect in 30 seconds
Claude.ai (Custom Connector)
- Settings → Connectors → Add custom connector
- URL:
https://mcp.kairogen.ai/mcp - Click Connect → sign in with Kairogen → approve
Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"kairogen": {
"url": "https://mcp.kairogen.ai/mcp"
}
}
}
Restart Cursor and click Connect when prompted.
ChatGPT (Custom Connector)
Settings → Connectors → New custom connector → paste https://mcp.kairogen.ai/mcp. Sign in when ChatGPT prompts.
Claude Code
claude mcp add --transport http kairogen https://mcp.kairogen.ai/mcp
The --transport http flag is required for remote OAuth-protected MCP servers. Without it, the CLI assumes stdio and tries to exec the URL as a local binary.
Hermes / OpenClaw / NemoClaw (chat-only agents)
Paste this prompt into the agent:
Connect the Kairogen MCP at https://mcp.kairogen.ai/mcp. It supports OAuth device flow,
discovery at https://mcp.kairogen.ai/.well-known/oauth-protected-resource. Run the device
flow and reply with: Authorize here: https://app.kairogen.ai/device?code=XXXX-XXXX. Then
poll the token endpoint until I authorize and confirm once it succeeds.
The agent will reply with a link. Open it, click Permitir acesso, you're connected.
Local stdio (Claude Desktop, headless dev, offline)
{
"mcpServers": {
"kairogen": {
"command": "npx",
"args": ["-y", "@kairogen/mcp"]
}
}
}
On first launch the CLI runs the OAuth device flow, opens your browser, and caches the tokens at ~/.kairogen/tokens.json with auto-refresh. No env vars required.
Tools
| Tool | What it does | Scope |
|---|---|---|
list_models |
Discover all image/video models | (public) |
get_credits |
Check remaining credit balance | kairogen:read |
estimate_cost |
Preview the credit cost before generating | (public) |
generate_image |
Generate one or more images. Blocks until done (default 10 min). | kairogen:generate |
generate_video |
Generate a video (text-to-video or image-to-video). Blocks until done (default 15 min). | kairogen:generate |
upscale_image |
Upscale an image 2x or 4x with Topaz Photo AI | kairogen:generate |
get_generation |
Poll the status of a previous generation | kairogen:read |
All generate_* tools support wait_for_completion: false to return the generation_id immediately and let you poll via get_generation. They emit MCP notifications/progress heartbeats every 5 seconds during the poll, so Claude Desktop / Cursor / etc. show a live progress indicator and the connection never times out mid-render.
Configuration
Environment variables (all optional, sensible defaults):
| Var | Default | Purpose |
|---|---|---|
KAIROGEN_API_BASE |
https://api.kairogen.ai |
Override for staging or self-hosted |
KAIROGEN_ISSUER |
https://api.kairogen.ai |
OAuth issuer base URL |
KAIROGEN_CLIENT_ID |
kairogen-mcp |
Pre-registered OAuth client id |
KAIROGEN_API_KEY |
(empty) | Override OAuth and use a static token (CI / headless) |
KAIROGEN_CONFIG_DIR |
~/.kairogen |
Where to cache OAuth tokens |
Local development
git clone https://github.com/kairogenai/kairogen-mcp.git
cd kairogen-mcp
npm install
npm run build
# stdio mode (with OAuth device flow on first run):
node dist/stdio.js
# remote HTTP mode (validates Bearer tokens against api.kairogen.ai/.well-known/jwks.json):
PORT=8080 node dist/http.js
Smoke test (no agent needed):
KAIROGEN_API_KEY=eyJ... node -e "
const init = JSON.stringify({jsonrpc:'2.0',id:1,method:'initialize',params:{protocolVersion:'2025-11-25',capabilities:{},clientInfo:{name:'smoke',version:'0'}}});
const initd = JSON.stringify({jsonrpc:'2.0',method:'notifications/initialized'});
const list = JSON.stringify({jsonrpc:'2.0',id:2,method:'tools/list'});
process.stdout.write(init+'\\n'+initd+'\\n'+list+'\\n');
" | node dist/stdio.js
Deploy (mcp.kairogen.ai)
fly launch --no-deploy --copy-config --name kairogen-mcp
fly secrets set \
MCP_RESOURCE=https://mcp.kairogen.ai \
OAUTH_ISSUER=https://api.kairogen.ai \
OAUTH_AUDIENCE=kairogen-api \
MCP_AUTH_SERVERS=https://api.kairogen.ai \
KAIROGEN_API_BASE=https://api.kairogen.ai
fly deploy
fly certs add mcp.kairogen.ai
MCP_AUTH_SERVERS is required: it populates the authorization_servers field in /.well-known/oauth-protected-resource, which is how MCP clients discover where to run the OAuth flow. Comma-separated if you ever need multiple issuers.
Backend env vars the OAuth issuer needs
The auth server (kairogen-backend-development) needs these set in its own deploy environment:
| Var | Required | Purpose |
|---|---|---|
OAUTH_JWT_PRIVATE_KEY |
yes (prod) | RSA PEM. Generate with openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048. |
OAUTH_ISSUER |
recommended | Default https://api.kairogen.ai. Must match what MCP server expects. |
OAUTH_AUDIENCE |
recommended | Default kairogen-api. Must match what MCP server expects. |
OAUTH_WEBSITE_DOMAIN |
yes | Origin of the frontend hosting /oauth/consent and /device. Default https://app.kairogen.ai. In dev, override to http://localhost:3000 (or wherever your Nuxt dev server runs) or the consent endpoints will 403. |
OAUTH_INTROSPECTION_SECRET |
optional | 32+ char random string. Empty value disables /oauth/introspect. |
CORS_ORIGINS |
yes (prod) | Comma-separated allowlist of origins. Empty in production now refuses all cross-origin requests. Set to https://app.kairogen.ai (plus any other UI origins) to allow the consent page. |
DNS: point mcp.kairogen.ai (CNAME) to the Fly app hostname.
Architecture
- Frontend (kairogen-frontend-development) hosts the consent screens at
/oauth/consent,/device, and/settings/connections. - Backend (kairogen-backend-development) is the OAuth issuer. Mounts
/.well-known/oauth-authorization-server,/.well-known/jwks.json,/oauth/authorize/approve,/oauth/token,/oauth/device_authorization,/oauth/device/approve,/oauth/connections. - MCP server (this repo) is a Resource Server. Validates Bearer JWTs issued by the backend against the published JWKS, then proxies tool calls to
api.kairogen.aiwith the user's token.
Roadmap
- [x] v0.1 stdio + sAccessToken paste (deprecated)
- [x] v0.2 OAuth device flow on stdio first run
- [x] v0.3 hosted Streamable HTTP at
mcp.kairogen.ai - [ ] v0.4 Resources (
kairogen://models,kairogen://prompt-guide/{model}) - [ ] v0.5 Marketing Studio + Cinema Control flows as higher-level tools
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.