Black Forest Labs MCP server for AI agents

Live

API KEY

IMAGE GENERATION

AI

Black Forest Labs gives your agent the FLUX models: generate and edit images from text and reference images, fill, expand, and erase regions, generate and upscale video, and check task results and credits.

  • Per-user credentials: each call uses the actual user's API key, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
Black Forest Labs
agent · Acme Q3
Run
Generate a hero image of a glass greenhouse at dawn with FLUX.2 [pro].
S
blackforestlabs_generate_image
131ms
Creative agent
The task is submitted to FLUX.2 [pro] and is generating now. The polling URL will return the image once its status is Ready.
Sources: 1 generation task
blackforestlabs
1 task
18:29
Message Claude...

Tools your creative agent reaches for on Black Forest Labs, scoped per user.

CALL ANY TOOL
23 tools for image generation in Black Forest Labs: generate images with FLUX.2, FLUX 3, and FLUX1.1, edit with Kontext, fill, expand, outpaint, and erase regions, generate, edit, and upscale video, and poll results.
blackforestlabs_deblur_image
Deblur image
Sharpen a blurry image with FLUX Deblur while keeping the scene, identity, colors and composition. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this to fix blur without a prompt. Use blackforestlabs_generate_image for other instruction-based edits. Then call blackforestlabs_get_result with the returned id until status is Ready.
Parameters
Name
Type
Required
Description
image
string
Required
Blurry image to sharpen, as a public http(s) URL or a base64-encoded image.
output_format
string
Optional
File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (png). One of: `jpeg`, `png`, `webp`.
safety_tolerance
integer
Optional
Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-5 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seed
integer
Optional
Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
blackforestlabs_edit_image_kontext
Edit image kontext
blackforestlabs_edit_video
Edit video
blackforestlabs_erase_object
Erase object
blackforestlabs_expand_image
Expand image
blackforestlabs_fill_image
Fill image
blackforestlabs_generate_image
Generate image
blackforestlabs_generate_image_finetuned
Generate image finetuned
blackforestlabs_generate_image_flux11_pro
Generate image flux11 pro
blackforestlabs_generate_image_flux11_ultra
Generate image flux11 ultra
blackforestlabs_generate_image_flux1_dev
Generate image flux1 dev
blackforestlabs_generate_image_flux2_flex
Generate image flux2 flex
blackforestlabs_generate_image_flux2_klein
Generate image flux2 klein
blackforestlabs_generate_image_flux3
Generate image flux3
blackforestlabs_generate_image_flux3_klein
Generate image flux3 klein
blackforestlabs_generate_video
Generate video
blackforestlabs_get_credits
Get credits
blackforestlabs_get_finetune_details
Get finetune details
blackforestlabs_get_result
Get result
blackforestlabs_list_finetunes
List finetunes
blackforestlabs_outpaint_image
Outpaint image
blackforestlabs_upscale_video
Upscale video
blackforestlabs_virtual_try_on
Virtual try on
Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// Black Forest Labs tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["blackforestlabs"], toolNames: [
    "blackforestlabs_generate_image",
    "blackforestlabs_edit_image_kontext",
    "blackforestlabs_get_result"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "Generate a hero image of a greenhouse at dawn and return the result" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["blackforestlabs"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "Generate a hero image of a greenhouse at dawn and return the result" }],
  tools,
});

// Execute the tool call with the user's vaulted Black Forest Labs API key
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["blackforestlabs"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Generate a hero image of a greenhouse at dawn and return the result" }],
  tools,
});

// Tool call runs with the user's vaulted Black Forest Labs API key
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["blackforestlabs"] }, pageSize: 100,
});

const agent = new Agent({
  name: "creative_agent",
  model: "gemini-2.5-pro",
  instruction: "Black Forest Labs tools scoped to this user",
  tools,
});

await agent.run("Generate a hero image of a greenhouse at dawn and return the result");
Try these prompts
Copy any prompt into your agent. Each maps directly to a Black Forest Labs tool. Click to copy, paste into your agent, done.
Generate images
Copy the prompt
Copied
Generate a product shot of a ceramic mug on a walnut desk with FLUX 3.
Copy the prompt
Copied
Generate a 4 megapixel landscape poster with FLUX1.1 [pro] Ultra.
Copy the prompt
Copied
Generate an image of our office mascot with our brand finetune.
Edit images
Copy the prompt
Copied
Change the background of this photo to a beach at sunset.
Copy the prompt
Copied
Erase the coffee cup from this image using this mask.
Copy the prompt
Copied
Expand this square image to a wide banner by adding sky on both sides.
Video and account
Copy the prompt
Copied
Generate a short video of waves hitting a pier with FLUX 3.
Copy the prompt
Copied
Upscale this video clip 2x toward 4K.
Copy the prompt
Copied
How many credits are left on our Black Forest Labs account?
SEE HOW AUTH WORKS
Each user connects their own Black Forest Labs API key once, and Scalekit sends it with every call. Keys stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
Black Forest Labs
once. We tie it to their identity and the meetings they approved — no shared bot account, no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Black Forest Labs
token lives in a vault scoped to them. User A's meetings are never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tokens:
auto-refreshed
3
Resolve
When your agent calls a
Black Forest Labs
tool, we fetch the right token server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Black Forest Labs
tool call is logged — who triggered it, which meeting was fetched, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other AI image and design connectors.
GTM and RevOps Teams
Competitive intelligence briefing agent
Scans Gong calls for competitor mentions, matches each one to its Notion battlecard, and DMs every affected rep a single Slack digest per cycle. Every call runs as the PMM who owns the briefing, never a shared bot.
Test other agents
See the same per-user auth pattern across other AI image and design connectors.
GTM
Competitive intelligence briefing agent
Scan Gong calls for competitor mentions, match each one to its Notion battlecard, and DM every affected rep a single Slack digest.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared Black Forest Labs API key looks fine in a demo. In production every generation request looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared key
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Black Forest Labs today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access Black Forest Labs as the user or through a shared API key?
As the user. Each user connects their own Black Forest Labs API key once, and Scalekit sends it with every call. Audit logs attribute every image generation and edit to that user, not a shared service account.
Where is the Black Forest Labs API key stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. To rotate it, the user reconnects with a new API key. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in Black Forest Labs?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example the image generation tools and blackforestlabs_get_result without blackforestlabs_generate_video and blackforestlabs_upscale_video. Scalekit also enforces scope checks before every API call.
What happens when a user revokes Black Forest Labs access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
How does the agent get the finished image?
Every generation and edit tool returns a task id and polling_url instead of the image. The agent calls blackforestlabs_get_result with the id until the status is Ready, then reads the output. blackforestlabs_get_credits shows the balance before large jobs.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""blackforestlabs"": {
""url"": ""https://mcp.scalekit.com/blackforestlabs"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.blackforestlabs]
url = ""https://mcp.scalekit.com/blackforestlabs""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""blackforestlabs"": {
""url"": ""https://mcp.scalekit.com/blackforestlabs"",
""type"": ""http""
}
}
}