mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-16 15:14:38 +00:00
Keep the page named AI Integrations, not MCP
The Integrations page holds more than the agent connection: open PRs add the AI services for Generative Fill and other AI features to it (#10903, #12391, #7007). The menu item stays "AI Integrations…" and the page "Integrations", as on main; messages and docs say Edit › Preferences › AI Integrations.
This commit is contained in:
1 parent
1e3eae08cb
commit
09ad48fcee
27 files changed
+47
-47
No files matched your search
@@ -246,7 +246,7 @@ photocraft-cli batch --help
|
||||
photocraft-cli mcp
|
||||
```
|
||||
|
||||
To let Claude or another AI app drive the open PhotoCraft window without a terminal, turn on **Edit › Preferences › MCP › Let AI agents connect**, then click **Add to Claude Desktop** (or Claude Code, or Cursor) in the same panel. See [`docs/mcp.md`](docs/mcp.md).
|
||||
To let Claude or another AI app drive the open PhotoCraft window without a terminal, turn on **Edit › Preferences › AI Integrations › Let AI agents connect**, then click **Add to Claude Desktop** (or Claude Code, or Cursor) in the same panel. See [`docs/mcp.md`](docs/mcp.md).
|
||||
|
||||
The desktop app also offers an authenticated, loopback-only control channel (`photocraft --control`) for inspecting UI state, driving tools with pointer events, and taking offscreen screenshots. Every image in this README was rendered that way. See [`docs/control-protocol.md`](docs/control-protocol.md).
|
||||
|
||||
|
||||
@@ -276,7 +276,7 @@ pub(crate) struct CommandsArgs {
|
||||
/// Headless: each automation root grants that direction of file access; an omitted root denies it.
|
||||
/// Prefer absolute root paths in MCP client configurations. Bridge: set the roots on the desktop
|
||||
/// app; root flags are refused. The token flags require --bridge (or PHOTOCRAFT_CONTROL_PORT).
|
||||
/// Live: the desktop app with Edit › Preferences › MCP › Let AI agents connect on,
|
||||
/// Live: the desktop app with Edit › Preferences › AI Integrations › Let AI agents connect on,
|
||||
/// found again on every call (no port or token to configure); the roots are for a headless session
|
||||
/// while the app is closed.
|
||||
#[derive(Args)]
|
||||
@@ -284,7 +284,7 @@ pub(crate) struct CommandsArgs {
|
||||
pub(crate) struct McpArgs {
|
||||
#[command(subcommand)]
|
||||
pub(crate) action: Option<McpCommand>,
|
||||
/// Find the desktop app by itself on every call (Edit › Preferences › MCP ›
|
||||
/// Find the desktop app by itself on every call (Edit › Preferences › AI Integrations ›
|
||||
/// Let AI agents connect), with no port or token to configure
|
||||
#[arg(long)]
|
||||
pub(crate) live: bool,
|
||||
|
||||
@@ -2033,7 +2033,7 @@ fn info_detail_adds_text_runs_and_antialiasing() {
|
||||
}
|
||||
|
||||
/// `mcp install --client json` prints the configuration MCP clients start `mcp --live` with;
|
||||
/// Cursor's file gets the same entry, other servers kept (Preferences › MCP).
|
||||
/// Cursor's file gets the same entry, other servers kept (Preferences › AI Integrations).
|
||||
#[test]
|
||||
fn mcp_install_writes_the_live_entry() {
|
||||
let home = tmp("mcp-install");
|
||||
@@ -2115,7 +2115,7 @@ fn mcp_live_without_the_app_explains_what_to_do() {
|
||||
send(json!({"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"ui_inspect","arguments":{}}}));
|
||||
let r = recv(2);
|
||||
assert_eq!(r["result"]["isError"], true, "{r}");
|
||||
assert!(r["result"]["content"][0]["text"].as_str().unwrap().contains("MCP"), "{r}");
|
||||
assert!(r["result"]["content"][0]["text"].as_str().unwrap().contains("Preferences › AI Integrations › Let AI agents connect"), "{r}");
|
||||
drop(stdin);
|
||||
let _ = child.kill();
|
||||
let _ = child.wait();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Preferences › MCP on the desktop: while *Let AI agents connect* is on, the app
|
||||
//! Preferences › AI Integrations on the desktop: while *Let AI agents connect* is on, the app
|
||||
//! serves the control protocol by itself (no `--control`) and publishes the connection file
|
||||
//! `photocraft-cli mcp --live` finds it by ([`photocraft_automation::agent_link`]). Turning it on
|
||||
//! or off, or changing the port or folders, applies at once. The token stays in the settings
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Localhost JSON-lines control server (one request per line, one reply per line).
|
||||
//! Loopback only. This is the transport the MCP server will wrap.
|
||||
//!
|
||||
//! `--control` starts it for the whole run ([`start`]); Preferences › MCP starts and
|
||||
//! `--control` starts it for the whole run ([`start`]); Preferences › AI Integrations starts and
|
||||
//! stops it while the app runs ([`listen`], see `agent_link`).
|
||||
|
||||
use std::io::{BufReader, Write};
|
||||
|
||||
@@ -95,7 +95,7 @@ fn custom_titlebar(prefs_file: Option<&std::path::Path>) -> bool {
|
||||
CUSTOM_TITLEBAR && !prefs.interface.system_title_bar
|
||||
}
|
||||
|
||||
/// Preferences › MCP, read before the window opens the way [`custom_titlebar`] is:
|
||||
/// Preferences › AI Integrations, read before the window opens the way [`custom_titlebar`] is:
|
||||
/// whether agents may drive this launch at all, the port to listen on when no `--control`
|
||||
/// was given (0 = only with `--control`) and the automation folders used when no
|
||||
/// `--automation-read-root` / `--automation-write-root` was given. A missing or unreadable file
|
||||
@@ -146,7 +146,7 @@ fn integration_fields(section: &serde_json::Value, out: &mut photocraft_engine::
|
||||
}
|
||||
|
||||
/// The automation roots: `--automation-read-root` / `--automation-write-root` (or their
|
||||
/// variables) win; a direction without one takes Preferences › MCP' folder. A flag's
|
||||
/// variables) win; a direction without one takes Preferences › AI Integrations' folder. A flag's
|
||||
/// root that can't be opened stops the launch (exit status 2) as before. A preference's root that
|
||||
/// can't be opened, or isn't an absolute path (it would depend on the folder the app was started
|
||||
/// from), is left out, so that direction fails closed, and the warning says why: a folder moved
|
||||
@@ -176,7 +176,7 @@ fn automation_workspace(
|
||||
Ok(w) => workspace = w,
|
||||
Err(e) => {
|
||||
let which = if read { "Automation Read Folder" } else { "Automation Write Folder" };
|
||||
warnings.push(format!("Preferences › MCP › {which} is not used: {e}"));
|
||||
warnings.push(format!("Preferences › AI Integrations › {which} is not used: {e}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -191,7 +191,7 @@ fn control_port_for(cli: Option<u16>, prefs: &photocraft_engine::prefs::Integrat
|
||||
if !prefs.allow_agent_control {
|
||||
let warning = cli.map(|p| {
|
||||
format!(
|
||||
"photocraft: Preferences › MCP › Allow Agent Control is off: not listening on port {p}
|
||||
"photocraft: Preferences › AI Integrations › Allow Agent Control is off: not listening on port {p}
|
||||
"
|
||||
)
|
||||
});
|
||||
@@ -358,7 +358,7 @@ struct ControlNotice {
|
||||
}
|
||||
|
||||
/// The `--control` server's port, token and workspace, when it is on (exits 2 on a bad
|
||||
/// configuration). Preferences › MCP' folders stand in for automation roots no flag
|
||||
/// configuration). Preferences › AI Integrations' folders stand in for automation roots no flag
|
||||
/// names. The server Preferences start (*Let AI agents connect*) is `agent_link`'s, not this.
|
||||
fn control_setup(
|
||||
cli_port: Option<u16>,
|
||||
@@ -368,7 +368,7 @@ fn control_setup(
|
||||
control_setup_in(services::config_dir(), &integrations(services::prefs_file().as_deref()), cli_port, auth, automation)
|
||||
}
|
||||
|
||||
/// [`control_setup`] with the settings folder and Preferences › MCP given.
|
||||
/// [`control_setup`] with the settings folder and Preferences › AI Integrations given.
|
||||
fn control_setup_in(
|
||||
settings: Option<std::path::PathBuf>,
|
||||
prefs: &photocraft_engine::prefs::Integrations,
|
||||
@@ -719,7 +719,7 @@ fn main() -> eframe::Result {
|
||||
log::warn!("couldn't remember GPU backend {}: {e}", b.name());
|
||||
}
|
||||
});
|
||||
// Preferences › MCP: agents connect without a terminal, unless the launch
|
||||
// Preferences › AI Integrations: agents connect without a terminal, unless the launch
|
||||
// flags (`--control`) manage the connection.
|
||||
let mcp = agent_link::mcp_launch();
|
||||
app.agent_link.mcp_command = mcp.as_ref().map(photocraft_automation::agent_link::McpLaunch::shell_line);
|
||||
@@ -1196,7 +1196,7 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
/// Preferences › MCP' folders are the automation roots when no flag names one, and
|
||||
/// Preferences › AI Integrations' folders are the automation roots when no flag names one, and
|
||||
/// a flag wins over its preference, direction by direction.
|
||||
#[test]
|
||||
fn automation_folders_come_from_the_preferences_unless_a_flag_names_one() {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
- **Headless:** an in-process `Headless` session owns the engine and performs file I/O.
|
||||
- **Bridge:** `BridgeClient` forwards tools to a desktop application started with `photocraft --control <port>`.
|
||||
- **Live:** `photocraft-cli mcp --live` finds the desktop application through the connection file it publishes while Edit › Preferences › MCP › *Let AI agents connect* is on, before every tool call; while the app is closed it starts it, serves a headless session, or reports an error, as chosen there.
|
||||
- **Live:** `photocraft-cli mcp --live` finds the desktop application through the connection file it publishes while Edit › Preferences › AI Integrations › *Let AI agents connect* is on, before every tool call; while the app is closed it starts it, serves a headless session, or reports an error, as chosen there.
|
||||
|
||||
The simplest setup needs no terminal: turn on *Let AI agents connect* in PhotoCraft, then click *Add to Claude Desktop* (or Claude Code, or Cursor) in the same panel. See [`docs/mcp.md`](../../../docs/mcp.md#connecting-the-desktop-app-no-terminal).
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ Automation is a privilege boundary because requests can cause filesystem access,
|
||||
Screenshots are decoded under separate dimension, pixel, and allocation ceilings before
|
||||
downscaling; the 5 MiB PNG limit applies to the returned image.
|
||||
- MCP normally uses stdio and can optionally bridge to loopback control TCP.
|
||||
- Edit › Preferences › MCP › *Let AI agents connect* (off by default) opens that loopback
|
||||
- Edit › Preferences › AI Integrations › *Let AI agents connect* (off by default) opens that loopback
|
||||
listener without launch flags. Its token is kept in a user-only file in the settings folder
|
||||
(`agent-control.token`) and stays the same across restarts and port changes: restarting does
|
||||
not revoke it. To revoke an exposed token, delete that file; the next start creates a new one.
|
||||
|
||||
@@ -240,7 +240,7 @@ impl McpLaunch {
|
||||
2. Reload your MCP servers if your client needs that (or tell me to restart you).
|
||||
3. Call the {SERVER_NAME} tool `ui_inspect` and tell me which document is open.
|
||||
|
||||
PhotoCraft must be running with Edit › Preferences › MCP › Let AI agents connect turned on. The command needs no port or token: it finds the app by itself on every call.
|
||||
PhotoCraft must be running with Edit › Preferences › AI Integrations › Let AI agents connect turned on. The command needs no port or token: it finds the app by itself on every call.
|
||||
"
|
||||
)
|
||||
}
|
||||
@@ -852,7 +852,7 @@ mod tests {
|
||||
assert!(prompt.contains("claude mcp add --scope user photocraft -- /x/photocraft-cli mcp --live"), "{prompt}");
|
||||
assert!(prompt.contains("codex mcp add photocraft -- /x/photocraft-cli mcp --live"), "{prompt}");
|
||||
assert!(prompt.contains(&launch.config_json()), "{prompt}");
|
||||
assert!(prompt.contains("Edit › Preferences › MCP › Let AI agents connect"), "{prompt}");
|
||||
assert!(prompt.contains("Edit › Preferences › AI Integrations › Let AI agents connect"), "{prompt}");
|
||||
assert!(!prompt.contains(TOKEN_FILE) && !prompt.contains("token\":"), "{prompt}");
|
||||
}
|
||||
|
||||
@@ -976,7 +976,7 @@ mod tests {
|
||||
assert!(install(Client::Cursor, &launch, &env).is_err(), "no home folder: an error, not a panic");
|
||||
}
|
||||
|
||||
// ---- connection file (Preferences › MCP) ----
|
||||
// ---- connection file (Preferences › AI Integrations) ----
|
||||
|
||||
#[test]
|
||||
fn a_published_connection_reads_back_in_the_documented_shape() {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//! control protocol's envelope, used by `photocraft-cli serve`.
|
||||
//! * [`files`]: open/save any supported format, `.pcraft` natively.
|
||||
//! * [`agent_link`] and [`live`]: connecting agents to the desktop app without a terminal
|
||||
//! (Edit › Preferences › MCP, `photocraft-cli mcp --live` and `mcp install`).
|
||||
//! (Edit › Preferences › AI Integrations, `photocraft-cli mcp --live` and `mcp install`).
|
||||
//!
|
||||
//! L6, no UI-toolkit dependencies.
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
@@ -122,7 +122,7 @@ impl Live {
|
||||
}
|
||||
if Instant::now() >= deadline {
|
||||
return Err(format!(
|
||||
"PhotoCraft didn't accept agents within {} s of starting. If it's still opening, try again in a moment; otherwise check Edit › Preferences › MCP.",
|
||||
"PhotoCraft didn't accept agents within {} s of starting. If it's still opening, try again in a moment; otherwise check Edit › Preferences › AI Integrations.",
|
||||
self.cfg.launch_timeout.as_secs()
|
||||
));
|
||||
}
|
||||
@@ -161,7 +161,7 @@ fn closed(integrations: &Integrations) -> String {
|
||||
if integrations.connect_agents {
|
||||
"PhotoCraft isn't running: open it, then try again.".into()
|
||||
} else {
|
||||
"PhotoCraft doesn't accept AI agents: open it, turn on Edit › Preferences › MCP › Let AI agents connect, then try again.".into()
|
||||
"PhotoCraft doesn't accept AI agents: open it, turn on Edit › Preferences › AI Integrations › Let AI agents connect, then try again.".into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! `photocraft-cli mcp --live` (Preferences › MCP): the MCP server finds the desktop
|
||||
//! `photocraft-cli mcp --live` (Preferences › AI Integrations): the MCP server finds the desktop
|
||||
//! app through its connection file before every call, follows it to a new port and token, and
|
||||
//! applies the closed-app choice (start it, headless, or an error) when no app answers.
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
section!("edit.preferences.type", "Type…"),
|
||||
section!("edit.preferences.enhancedControls", "Enhanced Controls…"),
|
||||
section!("edit.preferences.rawDefaults", "RAW Defaults…"),
|
||||
section!("edit.preferences.integrations", "MCP…"),
|
||||
section!("edit.preferences.integrations", "Integrations…"),
|
||||
spec!(
|
||||
"edit.keyboardShortcuts",
|
||||
"Keyboard Shortcuts…",
|
||||
|
||||
@@ -25,7 +25,7 @@ pub const SECTIONS: [(&str, &str); 18] = [
|
||||
("type", "Type"),
|
||||
("enhancedControls", "Enhanced Controls"),
|
||||
("rawDefaults", "RAW Defaults"),
|
||||
("integrations", "MCP"),
|
||||
("integrations", "Integrations"),
|
||||
];
|
||||
|
||||
/// Preferences that nothing reads yet, so Edit › Preferences doesn't show them: a control that
|
||||
|
||||
@@ -460,7 +460,7 @@ pub struct PhotocraftApp {
|
||||
/// The first digit of a two-digit opacity typed on the number keys (`opacity_keys`, #352).
|
||||
pub(crate) opacity_keys: opacity_keys::Pending,
|
||||
control_rx: Option<Receiver<ControlRequest>>,
|
||||
/// Preferences › MCP: the agent connection's state (see [`Services::agent_link`]).
|
||||
/// Preferences › AI Integrations: the agent connection's state (see [`Services::agent_link`]).
|
||||
pub agent_link: AgentLinkStatus,
|
||||
/// `ui.screenshot` requests: bounded admission, a weak-slot callback per issuance, monotonic
|
||||
/// deadlines and a capture-time geometry epoch (see `screenshot.rs`).
|
||||
|
||||
@@ -151,7 +151,7 @@ pub static CATALOG: &[(&[&str], &str, Option<&str>, &str)] = &[
|
||||
(&["Edit"], "---", None, "---"),
|
||||
(&["Edit", "Preferences"], "General…", Some("Cmd+K"), "edit.preferences.general"),
|
||||
(&["Edit", "Preferences"], "---", None, "---"),
|
||||
(&["Edit", "Preferences"], "MCP…", None, "edit.preferences.integrations"),
|
||||
(&["Edit", "Preferences"], "AI Integrations…", None, "edit.preferences.integrations"),
|
||||
(&["Edit", "Preferences"], "Interface…", None, "edit.preferences.interface"),
|
||||
(&["Edit", "Preferences"], "Workspace…", None, "edit.preferences.workspace"),
|
||||
(&["Edit", "Preferences"], "Tools…", None, "edit.preferences.tools"),
|
||||
|
||||
@@ -16,7 +16,7 @@ fn preferences_submenu_reads_in_the_reference_order_with_two_separators() {
|
||||
&labels[1..],
|
||||
[
|
||||
"---",
|
||||
"MCP…",
|
||||
"AI Integrations…",
|
||||
"Interface…",
|
||||
"Workspace…",
|
||||
"Tools…",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Preferences › MCP: the agent connection (`integrations.connectAgents`), the folders
|
||||
//! Preferences › AI Integrations: the agent connection (`integrations.connectAgents`), the folders
|
||||
//! agents may use, what `photocraft-cli mcp --live` does while the app is closed, and the buttons
|
||||
//! that add PhotoCraft to MCP clients. Changes apply at once, without a restart.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Preferences › MCP (`agents.rs`): the live agent connection and its buttons.
|
||||
//! Preferences › AI Integrations (`agents.rs`): the live agent connection and its buttons.
|
||||
|
||||
use super::tests::app_with_store;
|
||||
use super::*;
|
||||
|
||||
@@ -344,7 +344,7 @@ pub type AutomationCommandFn = Box<dyn Fn(&str, &Value) -> Result<(), String>>;
|
||||
pub type AutomationAuthorizeFn = fn(&str, &Value) -> photocraft_engine::Result<()>;
|
||||
|
||||
/// The automation half of [`Services`]: what control and MCP requests may read, write and run.
|
||||
/// Replaced as a whole when Preferences › MCP starts the agent connection or
|
||||
/// Replaced as a whole when Preferences › AI Integrations starts the agent connection or
|
||||
/// changes its folders ([`Services::set_automation`]).
|
||||
#[derive(Default)]
|
||||
pub struct AutomationServices {
|
||||
@@ -356,7 +356,7 @@ pub struct AutomationServices {
|
||||
pub authorize: Option<AutomationAuthorizeFn>,
|
||||
}
|
||||
|
||||
/// Preferences › MCP: the agent connection as the dialog and `ui.inspect` show it.
|
||||
/// Preferences › AI Integrations: the agent connection as the dialog and `ui.inspect` show it.
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq, serde::Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AgentLinkStatus {
|
||||
@@ -382,7 +382,7 @@ pub struct AgentLink {
|
||||
pub status: AgentLinkStatus,
|
||||
}
|
||||
|
||||
/// Starts, moves or stops the agent connection to match Preferences › MCP.
|
||||
/// Starts, moves or stops the agent connection to match Preferences › AI Integrations.
|
||||
pub type AgentLinkFn = Box<dyn FnMut(&photocraft_engine::prefs::Integrations, &egui::Context) -> AgentLink>;
|
||||
/// Adds PhotoCraft to an MCP client (`claude-desktop`, `claude-code`, `cursor`), returning what
|
||||
/// was done, or returns the configuration to paste into any client (`json`).
|
||||
@@ -582,10 +582,10 @@ pub struct Services {
|
||||
/// each step of `actions.play`. Installed on the session only while a control request or
|
||||
/// an automation-driven [`PhotocraftApp::run`] runs, so a local play of a recorded `file.*` step still works.
|
||||
pub automation_authorize: Option<AutomationAuthorizeFn>,
|
||||
/// Preferences › MCP (desktop): starts, moves or stops the agent connection when
|
||||
/// Preferences › AI Integrations (desktop): starts, moves or stops the agent connection when
|
||||
/// its settings change. `None` on the web, and when `--control` manages the connection.
|
||||
pub agent_link: Option<AgentLinkFn>,
|
||||
/// Preferences › MCP' buttons that add PhotoCraft to MCP clients (desktop).
|
||||
/// Preferences › AI Integrations' buttons that add PhotoCraft to MCP clients (desktop).
|
||||
pub agent_clients: Option<AgentClientFn>,
|
||||
/// Encode an RGBA8 image as PNG (used for screenshots and `ui.render`).
|
||||
pub encode_png: Option<EncodePngFn>,
|
||||
|
||||
@@ -17,9 +17,9 @@ photocraft --control 7878 --control-token-file /private/path/photocraft-control.
|
||||
|
||||
If the file does not exist, PhotoCraft creates it with a fresh 256-bit token. On Unix the new file is mode `0600`; on Windows, protect it with an appropriate user-only ACL. An existing file is reused. If neither a token nor token file is configured, PhotoCraft generates a token for that launch and writes it to standard error. `PHOTOCRAFT_CONTROL_TOKEN` and `PHOTOCRAFT_CONTROL_TOKEN_FILE` are the environment-variable equivalents. A flag wins over its variable and an empty variable counts as unset; with `--control` (or `PHOTOCRAFT_CONTROL_PORT`), a token together with a token file, from flags or variables, is a usage error (exit status 2). Without it no token is read, so the pair is ignored.
|
||||
|
||||
### Without `--control`: Preferences › MCP
|
||||
### Without `--control`: Preferences › AI Integrations
|
||||
|
||||
An app started from the Dock, the Start menu or a file manager has no command line. Edit › Preferences › MCP starts and stops the control server while the app runs: turning *Let AI agents connect* on or off, or changing its port or folders, applies at once, with no restart.
|
||||
An app started from the Dock, the Start menu or a file manager has no command line. Edit › Preferences › AI Integrations starts and stops the control server while the app runs: turning *Let AI agents connect* on or off, or changing its port or folders, applies at once, with no restart.
|
||||
|
||||
| Preference | What it does |
|
||||
|---|---|
|
||||
@@ -418,7 +418,7 @@ magenta alignment lines. `ui.pointer` drives the same code, so agents get identi
|
||||
- **Headless** (`photocraft-cli mcp`): an in-process `photocraft_engine::Session`. There is no window. CPU composition is the default; `--gpu` or `PHOTOCRAFT_GPU=1` enables optional GPU rendering with automatic CPU fallback.
|
||||
- **Bridge** (`photocraft-cli mcp --bridge 127.0.0.1:7878 --control-token-file <path>`): every tool is forwarded to a running `photocraft --control 7878 --control-token-file <path>` over this protocol, so agents see and drive the live app. Explicit `--gpu` / `--no-gpu` flags are rejected with a usage error because the desktop controls rendering; `PHOTOCRAFT_GPU` is ignored in bridge mode. `--bridge 7878` is short for `--bridge 127.0.0.1:7878`. With no `--bridge`, `PHOTOCRAFT_CONTROL_PORT` selects the bridge port (`127.0.0.1:<port>`), and the CLI says so on standard error; with neither (or the variable empty), the MCP runs headless. A value that is not a port is a usage error naming the variable. `--automation-read-root` or `--automation-write-root` with the variable set is a usage error, since the bridge would drop the roots.
|
||||
|
||||
- **Live** (`photocraft-cli mcp --live`): the bridge, with the address and token read before every tool call from `agent-connection.json` in the app's settings folder. The app publishes that file while Edit › Preferences › MCP › *Let AI agents connect* is on (not with `--control`), and removes it when the connection stops; a file left by a crash fails the connection probe and counts as no app. See [MCP conventions](mcp.md#connecting-the-desktop-app-no-terminal).
|
||||
- **Live** (`photocraft-cli mcp --live`): the bridge, with the address and token read before every tool call from `agent-connection.json` in the app's settings folder. The app publishes that file while Edit › Preferences › AI Integrations › *Let AI agents connect* is on (not with `--control`), and removes it when the connection stops; a file left by a crash fails the connection probe and counts as no app. See [MCP conventions](mcp.md#connecting-the-desktop-app-no-terminal).
|
||||
|
||||
`ui.inspect` reports the connection as `agentLink`: `port` while agents can connect, `launchFlags` when `--control` manages it, `error`, and `mcpCommand` (how MCP clients start the CLI).
|
||||
|
||||
@@ -488,7 +488,7 @@ One explicit write-root flag overrides `PHOTOCRAFT_AUTOMATION_WRITE_ROOT`. These
|
||||
variables are not supported by headless `photocraft-cli mcp` or `serve`; supply flags explicitly.
|
||||
In MCP bridge mode, configure roots on the desktop process. Supplying root flags to
|
||||
`photocraft-cli mcp --bridge` is a usage error; a bridge client cannot grant filesystem access.
|
||||
With *Let AI agents connect*, the folders chosen in Preferences › MCP (`readRoot` /
|
||||
With *Let AI agents connect*, the folders chosen in Preferences › AI Integrations (`readRoot` /
|
||||
`writeRoot`) are the agents' roots; `mcp --live` uses them for a headless session only when the
|
||||
app's *When PhotoCraft is closed* choice (or `--when-closed headless`) asks for one.
|
||||
|
||||
|
||||
+1
-1
@@ -324,7 +324,7 @@ At startup the desktop lists recovery metadata, then decodes one document at a t
|
||||
|
||||
- **Headless:** `photocraft-cli mcp --automation-read-root <project> --automation-read-root <library> --automation-write-root <project>`. It drives an in-process engine session with ordered read directories and one write directory.
|
||||
- **Live app:** start `photocraft --control 7878 --control-token-file <private-path> --automation-read-root <project> --automation-read-root <library> --automation-write-root <project>`, then run `photocraft-cli mcp --bridge 127.0.0.1:7878 --control-token-file <private-path>`. The desktop process owns the roots; root flags on the bridging CLI are a usage error. See `docs/control-protocol.md#mcp-bridge`.
|
||||
- **Live app, no flags:** turn on Edit › Preferences › MCP › Let AI agents connect, then point the MCP client at `photocraft-cli mcp --live` (the panel's buttons, or `photocraft-cli mcp install --client <claude-desktop|claude-code|cursor|json>`, do it). The app publishes its port and token file in `agent-connection.json` in the settings folder; `--live` reads it on every call. See [MCP conventions](mcp.md#connecting-the-desktop-app-no-terminal). Test it against a scratch settings folder with `PHOTOCRAFT_CONFIG_DIR`, which both the app and the CLI honour.
|
||||
- **Live app, no flags:** turn on Edit › Preferences › AI Integrations › Let AI agents connect, then point the MCP client at `photocraft-cli mcp --live` (the panel's buttons, or `photocraft-cli mcp install --client <claude-desktop|claude-code|cursor|json>`, do it). The app publishes its port and token file in `agent-connection.json` in the settings folder; `--live` reads it on every call. See [MCP conventions](mcp.md#connecting-the-desktop-app-no-terminal). Test it against a scratch settings folder with `PHOTOCRAFT_CONFIG_DIR`, which both the app and the CLI honour.
|
||||
|
||||
For headless MCP clients, pass absolute paths to deliberately chosen trusted workspace directories in the launch arguments. Desktop `PHOTOCRAFT_AUTOMATION_READ_ROOT` and `PHOTOCRAFT_AUTOMATION_WRITE_ROOT` environment variables do **not** grant headless CLI access. Omitting a root flag deliberately denies that direction of access.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
## Connecting the desktop app (no terminal)
|
||||
|
||||
1. In PhotoCraft, open **Edit › Preferences › MCP** and turn on **Let AI agents
|
||||
1. In PhotoCraft, open **Edit › Preferences › AI Integrations** and turn on **Let AI agents
|
||||
connect (MCP)**. Optionally choose the folders agents can open from and save to, and what
|
||||
happens when an agent needs PhotoCraft while it is closed (open it, work without a window,
|
||||
or ask the user to open it). Click **Apply** or **OK**.
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
# Roadmap
|
||||
|
||||
> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-11-12 · **Change:** minor (M11: the desktop app connects to MCP clients from Edit › Preferences › MCP, no terminal, no restart; alpha gate, focus and estimates unchanged) · **Target:** Adobe Photoshop 2026
|
||||
> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-11-12 · **Change:** minor (M11: the desktop app connects to MCP clients from Edit › Preferences › AI Integrations, no terminal, no restart; alpha gate, focus and estimates unchanged) · **Target:** Adobe Photoshop 2026
|
||||
|
||||
- UI.5: Panels can detach, join other tab groups, split, resize and redock through shared docking transactions. Custom layouts persist with workspaces, respect workspace locking, and retain collapse flags for intact native groups.
|
||||
|
||||
@@ -116,7 +116,7 @@ Each milestone has a **definition of done (DoD)** and must leave `main` green on
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-12 | minor | M11: Edit › Preferences › MCP connects MCP clients to the running app without a terminal or restart; milestones, alpha gate and estimates unchanged |
|
||||
| 2026-11-12 | minor | M11: Edit › Preferences › AI Integrations connects MCP clients to the running app without a terminal or restart; milestones, alpha gate and estimates unchanged |
|
||||
| 2026-10-11 | minor | Linked adaptive Unsharp Mask performance and quality evidence; milestones, alpha gate and estimates unchanged |
|
||||
| 2026-10-10 | minor | Photomerge is implemented; real-world quality validation remains open |
|
||||
| 2026-10-10 | minor | Alpha gate table (core-workflow gate): passes, stage stays alpha |
|
||||
|
||||
+1
-1
@@ -274,7 +274,7 @@ Menu wiring (`docs/parity-checklist.md`): 664 of 664 menu items live (100.0%). T
|
||||
| AUTO-219-8 | xtask check that every panel button routes through a command id | partial | [#219](https://github.com/storytold/photocraft/issues/219) | cargo xtask panel-commands (run by xtask ci and CI) fails on a shell click handler that changes the document or session directly; 1 allowlisted function left (panels/color.rs color_field assigns the foreground/background colour instead of tools.setColors) |
|
||||
| AUTO-219-9 | Headless commands for in-canvas type editing, Liquify/Puppet strokes, transform handles | done | [#219](https://github.com/storytold/photocraft/issues/219) | type.hitTest, type.caret, type.navigate; filter.liquify strokes, edit.puppetWarp pins, type.edit, edit.transform |
|
||||
| AUTO-219-10 | Agent acceptance suite grown to 30-50 workflows | partial | [#219](https://github.com/storytold/photocraft/issues/219) | automation/tests/it/agent_tasks.rs runs 10 workflows over MCP |
|
||||
| AUTO-MCP-LIVE | Connect an MCP client to the running app without a terminal (no flags, ports or tokens to copy) | done | | 2026-11-12 (#5525, #11363): Edit › Preferences › MCP › Let AI agents connect starts and stops the loopback control server while the app runs (no restart) and publishes agent-connection.json; photocraft-cli mcp --live finds the app on every call (launch / headless / error while it is closed); Add to Claude Desktop / Claude Code / Cursor, mcp install --client, and Copy Prompt for an Agent. automation/tests/mcp_live.rs, apps/photocraft/src/agent_link.rs tests |
|
||||
| AUTO-MCP-LIVE | Connect an MCP client to the running app without a terminal (no flags, ports or tokens to copy) | done | | 2026-11-12 (#5525, #11363): Edit › Preferences › AI Integrations › Let AI agents connect starts and stops the loopback control server while the app runs (no restart) and publishes agent-connection.json; photocraft-cli mcp --live finds the app on every call (launch / headless / error while it is closed); Add to Claude Desktop / Claude Code / Cursor, mcp install --client, and Copy Prompt for an Agent. automation/tests/mcp_live.rs, apps/photocraft/src/agent_link.rs tests |
|
||||
|
||||
## Reliability
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ echo "==> assembling $APP"
|
||||
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
|
||||
# Executable and icon carry the display name (CFBundleExecutable / CFBundleIconFile).
|
||||
cp "$WORK/bin/photocraft" "$APP/Contents/MacOS/PhotoCraft"
|
||||
# The CLI too, beside the app: Preferences › MCP points MCP clients at it
|
||||
# The CLI too, beside the app: Preferences › AI Integrations points MCP clients at it
|
||||
# (`photocraft-cli mcp --live`), and it starts the app when an agent needs it.
|
||||
cp "$WORK/bin/photocraft-cli" "$APP/Contents/MacOS/photocraft-cli"
|
||||
cp "$ROOT/assets/app-icon/photocraft.icns" "$APP/Contents/Resources/PhotoCraft.icns"
|
||||
|
||||
@@ -85,4 +85,4 @@ note = "automation/tests/it/agent_tasks.rs runs 10 workflows over MCP"
|
||||
id = "AUTO-MCP-LIVE"
|
||||
target = "Connect an MCP client to the running app without a terminal (no flags, ports or tokens to copy)"
|
||||
status = "done"
|
||||
note = "2026-11-12 (#5525, #11363): Edit › Preferences › MCP › Let AI agents connect starts and stops the loopback control server while the app runs (no restart) and publishes agent-connection.json; photocraft-cli mcp --live finds the app on every call (launch / headless / error while it is closed); Add to Claude Desktop / Claude Code / Cursor, mcp install --client, and Copy Prompt for an Agent. automation/tests/mcp_live.rs, apps/photocraft/src/agent_link.rs tests"
|
||||
note = "2026-11-12 (#5525, #11363): Edit › Preferences › AI Integrations › Let AI agents connect starts and stops the loopback control server while the app runs (no restart) and publishes agent-connection.json; photocraft-cli mcp --live finds the app on every call (launch / headless / error while it is closed); Add to Claude Desktop / Claude Code / Cursor, mcp install --client, and Copy Prompt for an Agent. automation/tests/mcp_live.rs, apps/photocraft/src/agent_link.rs tests"
|
||||
Reference in new issue
Block a user