adobe-firefly-mcp
Local MCP server that uses Playwright browser automation to enable Claude Code to generate images, create variations, expand, and remove backgrounds via Adobe Firefly, requiring manual sign-in once.
README
adobe-firefly-mcp
Local MCP server for using Adobe Firefly from Claude Code through Playwright browser automation.
This project is designed for a personal local workflow where you already have access to Adobe Firefly in your browser. It launches a persistent Playwright Chromium profile, lets you sign in manually once, then reuses that profile for future image workflows.
It does not use a private Adobe API, automate login credentials, bypass authentication, or store credentials outside the browser profile.
Tools
adobe-firefly-mcp exposes these MCP tools:
firefly_generate- prompt-to-image generation.firefly_generate_video- prompt-to-video generation.firefly_variations- upload a local image and ask Firefly for variations.firefly_expand- upload a local image and run Firefly's expand/outpaint workflow.firefly_remove_background- upload a local image and run Firefly's remove-background workflow.firefly_status- open/check the persistent browser profile, auth state, paths, and optional screenshot.firefly_dom_inspect- inspect the current DOM state for debugging automation issues.firefly_dom_watch- watch for DOM mutations in real-time.
Generated files are saved locally and returned as absolute file paths.
Install
From source:
npm install
npm run build
When published to npm:
npm install -g adobe-firefly-mcp
Claude Code Configuration
From a source checkout:
{
"mcpServers": {
"adobe-firefly-mcp": {
"command": "node",
"args": ["./dist/server.js"],
"cwd": "/absolute/path/to/adobe-firefly-mcp"
}
}
}
From a global install:
{
"mcpServers": {
"adobe-firefly-mcp": {
"command": "adobe-firefly-mcp",
"env": {
"FIREFLY_MCP_DATA_DIR": "/absolute/path/to/.adobe-firefly-mcp"
}
}
}
}
On Windows, use escaped backslashes or forward slashes in JSON paths:
"FIREFLY_MCP_DATA_DIR": "C:/Users/you/.adobe-firefly-mcp"
First Run
- Start Claude Code with the MCP server configured.
- Run
firefly_statuswithopenBrowser: true. - A Chromium window opens at Adobe Firefly.
- Sign in manually with your Adobe account.
- Run
firefly_statusagain. The same profile inprofile/will be reused.
The default browser mode is headed (FIREFLY_HEADLESS=false) because the first sign-in must be done by you.
Example Tool Call
Image Generation
{
"prompt": "A cinematic product photo of a translucent blue mechanical keyboard on a polished steel desk",
"aspectRatio": "16:9",
"style": "Photo",
"count": 4
}
Video Generation
{
"prompt": "A timelapse of clouds moving over a mountain landscape at golden hour",
"aspectRatio": "Widescreen (16:9)",
"resolution": "720p",
"duration": "8 seconds",
"model": "Veo 3.1 Fast"
}
Example Claude prompts for video generation:
- "Generate a video of a cat playing with a ball of yarn in slow motion"
- "Create a 1080p video of ocean waves crashing on a rocky shore at sunset"
- "Make a widescreen video of a busy city street at night with neon lights reflecting in puddles"
- "Generate a short video of steam rising from a freshly brewed cup of coffee"
DOM Inspection (Developer Tool)
The firefly_dom_inspect tool is a read-only debugging utility for diagnosing broken automation. It never navigates, clicks, or modifies the page.
Modes
Full mode (default) - Returns everything:
{
"mode": "full"
}
Selector mode - Inspect specific elements:
{
"mode": "selector",
"selector": "[data-testid='generate-button']"
}
Shadow DOM mode - Inspect Adobe Spectrum components:
{
"mode": "shadow",
"maxDepth": 8
}
Accessibility mode - Return accessibility tree:
{
"mode": "accessibility"
}
Tree mode - Visual DOM tree:
{
"mode": "tree",
"maxDepth": 10
}
Output Includes
- Page info (URL, title, browser version, viewport, frameworks detected)
- Discovered selectors with Playwright locator suggestions
- Selector uniqueness (how many elements each selector matches)
- XPath alongside CSS and Playwright locators
- Shadow DOM traversal for Adobe Spectrum components
- Console messages (captured via listeners in MCP process)
- Network requests with duration
- Performance metrics (Navigation Timing, LCP, FCP)
- Screenshots (standard + annotated with numbered labels)
- HTML snapshots
- Element screenshots (optional)
Example: Diagnose Broken Automation
When Adobe changes the UI and your automation breaks:
{
"mode": "full",
"includeScreenshot": true,
"captureElementScreenshots": true
}
This returns:
- All discovered buttons/inputs with their selectors
- Which selectors are unique (matches: 1) vs shared (matches: 14)
- Playwright locator recommendations ranked by stability
- Screenshots showing exactly what's on screen
DOM Watch (Real-time Monitoring)
The firefly_dom_watch tool uses MutationObserver to report exactly when elements appear, disappear, or attributes change.
{
"timeoutMs": 60000,
"targetSelector": "[data-testid='generate-container']",
"mutations": ["childList", "attributes"]
}
Returns:
{
"mutations": [
{
"timestamp": "2026-07-06T12:34:56.789Z",
"type": "childList",
"action": "added",
"targetSelector": "[data-testid='generate-button']",
"addedNodes": ["Generate"],
"removedNodes": []
}
],
"summary": {
"totalMutations": 5,
"addedNodes": 3,
"removedNodes": 1,
"attributeChanges": 1
}
}
Example use cases:
- "Watch for the Generate button to appear after page load"
- "Monitor when the spinner disappears and results show"
- "Track when the download button becomes enabled"
Successful tool calls return JSON like:
{
"ok": true,
"operation": "firefly_generate",
"files": [
{
"path": "/absolute/path/to/downloads/firefly-example.png",
"source": "download"
}
],
"pageUrl": "https://firefly.adobe.com/...",
"warnings": []
}
Configuration
All configuration is optional.
| Environment variable | Default | Purpose |
|---|---|---|
FIREFLY_MCP_DATA_DIR |
current working directory | Base directory for downloads/ and profile/. |
FIREFLY_DOWNLOADS_DIR |
<dataDir>/downloads |
Saved image output directory. |
FIREFLY_PROFILE_DIR |
<dataDir>/profile |
Persistent Chromium user data directory. |
FIREFLY_HEADLESS |
false |
Run Chromium headless after you have already signed in. |
FIREFLY_LOG_LEVEL |
info |
debug, info, warn, error, or silent. Logs go to stderr only. |
FIREFLY_MAX_DOWNLOADS |
4 |
Default maximum generated images to save. |
FIREFLY_OPERATION_TIMEOUT_MS |
180000 |
General UI action timeout. |
FIREFLY_GENERATION_TIMEOUT_MS |
300000 |
Generation wait timeout. |
FIREFLY_NAVIGATION_TIMEOUT_MS |
60000 |
Page navigation timeout. |
FIREFLY_BASE_URL |
https://firefly.adobe.com |
Base Firefly URL. |
FIREFLY_TEXT_TO_IMAGE_URL |
<base>/generate/images |
Prompt-to-image route. |
FIREFLY_VARIATIONS_URL |
<base> |
Variations route. |
FIREFLY_EXPAND_URL |
<base>/tools/generative-expand |
Expand route. |
FIREFLY_REMOVE_BACKGROUND_URL |
<base>/tools/remove-background |
Remove-background route. |
FIREFLY_VIDEO_URL |
<base>/generate/video |
Video generation route. |
FIREFLY_SELECTOR_PROMPT_INPUT |
built-in candidates | CSS selector override for the prompt input. |
FIREFLY_SELECTOR_GENERATE_BUTTON |
built-in candidates | CSS selector override for the generate/action button. |
FIREFLY_SELECTOR_DOWNLOAD_BUTTON |
built-in candidates | CSS selector override for download buttons. |
FIREFLY_SELECTOR_UPLOAD_BUTTON |
built-in candidates | CSS selector override for upload controls. |
Adobe can change the Firefly UI at any time. The server uses resilient Playwright locators first, then CSS selector overrides when needed.
Development
npm install
npm run dev
npm run check
Useful scripts:
npm run build- compile TypeScript todist/.npm run lint- run ESLint.npm run format- apply Prettier.npm run test- run Vitest unit tests.npm run check- typecheck, lint, format-check, test, and build.
Security Model
- Uses
chromium.launchPersistentContext()with a dedicated local profile. - Never asks for Adobe credentials.
- Never fills login forms.
- Never stores credentials in config, logs, env vars, or project files.
- Reuses whatever Adobe session exists in the Playwright profile.
- Writes MCP protocol messages to stdout and logs only to stderr.
Keep profile/ private. It may contain browser cookies/session storage after you sign in.
Architecture
The server uses a modular architecture with centralized selectors, reusable utilities, and automatic diagnostics:
Core Modules
src/firefly/selectors.ts- Centralized selector candidates for image, video, and shared UI elementssrc/firefly/locatorResolver.ts- ReusableresolveLocator()with timeout, scroll, retry, and debug loggingsrc/firefly/diagnostics.ts- Automatic screenshot/HTML capture on failuressrc/firefly/generationWait.ts- Generation completion monitoring with explicit error detectionsrc/firefly/downloads.ts- Robust download handling withdownloadMode: "first"|"all"
Error Detection
The video generation tool explicitly detects Firefly errors instead of treating them as timeouts:
| Status | Description |
|---|---|
success |
Generation completed and download button is enabled |
firefly_error |
"Something went wrong", "Try again", "Server error", etc. |
moderation_error |
Content policy violations |
auth_error |
Session expired, sign-in required |
credit_error |
No credits/quota remaining |
timeout |
No success or error detected within timeout |
Debugging Workflow
When automation fails:
- Run
firefly_statusto check auth state and take a screenshot - Run
firefly_dom_inspectwithmode: "full"to see all selectors and page state - Use
firefly_dom_watchto monitor real-time DOM changes - Check tool output for structured error diagnostics
Limitations
This is browser automation over a consumer web UI, not an official Adobe API. It can break when Adobe changes routes, labels, or page structure. Use firefly_status and selector/URL environment overrides to diagnose and adapt.
You are responsible for using Adobe Firefly in accordance with your Adobe plan and applicable terms.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。