Skip to content

The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.

feat(mcp): `concat --mcp` serves agents from the shipped app, and Automation lists itself for it (#337)

Jareer1873f618e50e
diff --git a/README.md b/README.md
index a957d9c9..5a27eca0 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ Everything runs locally on a native Rust engine with a GPU compositor. Install i
**Good for:** TikTok, Reels and Shorts, YouTube videos, tutorials and screen recordings, podcast clips, memes.
-**Also for machines:** a JSON-RPC API, so scripts and AI agents can cut video with it too.
+**Also for machines:** a built-in MCP server for AI agents (`concat --mcp`, [set up](docs/MCP.md)) and a JSON-RPC API for scripts, so they can cut video with it too.
## Highlights
@@ -64,7 +64,7 @@ Everything runs locally on a native Rust engine with a GPU compositor. Install i
- 🎙️ **One-switch voice cleanup.** Denoise, enhance voice, level the loudness. Plus chipmunk, robot, telephone and friends.
- 📤 **Export.** H.264, HEVC, AV1. Up to 4K 60, 10-bit colour.
- 🦀 **Native Rust engine.** GPU compositor, proxies, hardware decode. 4K scrubs smoothly.
-- 🤖 **Scriptable.** A JSON-RPC API that scripts and AI agents can cut video with. A build from source adds gRPC and a command-line tool.
+- 🤖 **Scriptable.** An MCP server built in, so Claude and other AI agents can edit with it ([one line to set up](docs/MCP.md)), and a JSON-RPC API for scripts. A build from source adds gRPC and a command-line tool.
- 🖥️ **macOS, Windows, Linux, Android.** 25 languages. Same app, same project files.
## Download
@@ -120,7 +120,7 @@ If you change text the interface shows, run `python3 scripts/locales.py` from th
> [!IMPORTANT]
> The best way to contribute is to grab a build from the [Releases](https://github.com/jub0t/Concat/releases) page and use it: find where it breaks, and say where it could be better.
>
-> Ready to write code? [CONTRIBUTING.md](./CONTRIBUTING.md) covers setup, the layout of the tree, the checks to run, and how contributions are licensed. Driving Concat from a script, a service or an agent? [The developer docs](https://concatenate.pages.dev/docs) cover the Concat API and its transports: JSON-RPC and gRPC. [This Discussion](https://github.com/jub0t/Concat/discussions/3) is where the project was announced.
+> Ready to write code? [CONTRIBUTING.md](./CONTRIBUTING.md) covers setup, the layout of the tree, the checks to run, and how contributions are licensed. Driving Concat from a script, a service or an agent? [The developer docs](https://concatenate.pages.dev/docs) cover the Concat API and its transports: JSON-RPC and gRPC; [docs/MCP.md](docs/MCP.md) connects an AI agent over MCP. [This Discussion](https://github.com/jub0t/Concat/discussions/3) is where the project was announced.
>
> Contributors can claim a `@Contributor` role in the Discord server: just ask.
diff --git a/docs/MCP.md b/docs/MCP.md
new file mode 100644
index 00000000..5a046853
--- /dev/null
+++ b/docs/MCP.md
@@ -0,0 +1,74 @@
+# Concat for AI agents (MCP)
+
+Concat ships an [MCP](https://modelcontextprotocol.io) server inside the app. An agent - Claude Code, Claude Desktop, or any other MCP client - starts it as `concat --mcp` and can then create projects, import media, cut, add titles and captions, keyframe, apply effects, look at frames and export, with the same edit commands the window uses. Nothing extra to install.
+
+## Set it up
+
+Point your client at the Concat binary with the one argument `--mcp`.
+
+| System | Command |
+| --- | --- |
+| macOS | `/Applications/Concat.app/Contents/MacOS/concat` |
+| Windows (installed for you) | `%LOCALAPPDATA%\Programs\Concat\concat.exe` |
+| Windows (installed for everyone, or the .msi) | `C:\Program Files\Concat\concat.exe` |
+| Linux (.deb, .rpm, Arch) | `/usr/bin/concat` |
+| Linux (AppImage) | the `.AppImage` file itself |
+
+**Claude Code:**
+
+```sh
+claude mcp add concat -- /Applications/Concat.app/Contents/MacOS/concat --mcp
+```
+
+**Claude Desktop** (Settings > Developer > Edit Config, `claude_desktop_config.json`), and most other clients, which take the same shape:
+
+```json
+{
+ "mcpServers": {
+ "concat": {
+ "command": "/Applications/Concat.app/Contents/MacOS/concat",
+ "args": ["--mcp"]
+ }
+ }
+}
+```
+
+On Windows, write the path with doubled backslashes in JSON: `"C:\\Program Files\\Concat\\concat.exe"`.
+
+## How it reaches Concat
+
+`concat --mcp` works one of two ways, and the `concat_version` tool says which (`mcp.mode`):
+
+- **Through the window** (`window`). When Concat is open with **Settings > Automation > Scripts and apps** on, the window writes where its server is, and its token, to `automation.json` in Concat's config folder (readable only by you). The MCP server finds it and goes through the window's server. This is the safer way while you are editing: the agent cannot open the project you have on screen and save over it, and exports take turns with yours.
+- **On its own** (`headless`). Otherwise the MCP server runs Concat's engine itself, with no window. Nothing has to be open. It does not know what the window is doing, so do not let it edit a project you have open in the window at the same time.
+
+Choose explicitly with `--mcp window` (fail rather than run on its own) or `--mcp headless`; the default is `--mcp auto`. To reach a server elsewhere, set `CONCAT_API_ADDRESS` (e.g. `127.0.0.1:7420`) and `CONCAT_API_TOKEN` in the client's `env` for the server.
+
+Either way the agent writes files - projects, exports, frames - only under your home folder. Set `CONCAT_MCP_ROOTS` (a path list, `:`-separated, `;` on Windows) to allow other folders in headless mode.
+
+The agent edits projects of its own; it does not edit the project open in the window while you watch. That ("live mode") is planned in [#337](https://github.com/jub0t/Concat/issues/337).
+
+## What the agent can do
+
+Tools are named for what they do, and their argument schemas are generated from the Concat API's own types, so they carry the same limits and descriptions the engine does.
+
+| Area | Tools |
+| --- | --- |
+| Projects | `project_list`, `project_create`, `project_open`, `project_save`, `project_close`, `project_set_video` |
+| Reading | `timeline_read` (compact: lanes, clips in time order, media, ids), `project_get` (everything), `concat_version` |
+| Media | `media_probe`, `media_import` |
+| Editing | `clip_add`, `clip_trim`, `clips_split`, `clips_move`, `clips_remove`, `clip_update`, `clip_transform`, `clip_speed`, `track_add` |
+| Titles and captions | `title_add`, `captions_add` |
+| Keyframes and effects | `keyframe_set`, `keyframe_clear`, `effects_list`, `effect_layer_add`, `effect_key_set` |
+| Anything else | `edit_apply` (any edit command, or a batch of them as one undo step), `edit_undo`, `edit_redo` |
+| Templates | `template_list`, `template_instantiate` |
+| Export | `export_start`, `export_status`, `export_wait` (with progress), `export_cancel` |
+| Looking | `preview_frame` (the composited frame as an image) |
+
+Edits stay in memory until `project_save`, as in the window. Times are seconds; a keyframe's position is a fraction of its clip (0 to 1); sizes and offsets are fractions of the frame.
+
+## Protocol
+
+MCP over stdio, newline-delimited JSON-RPC 2.0. Both protocol eras are served: the `initialize` handshake (2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05) and the per-request `_meta` of 2026-07-28 with `server/discover`. `ping`, `tools/list`, `tools/call`, progress notifications for `export_wait`, and `notifications/cancelled` are supported. Standard output carries only protocol; the server logs to standard error.
+
+For scripts that do not speak MCP, the same API is served as JSON-RPC lines on a socket from Settings > Automation; see [the developer docs](https://concatenate.pages.dev/docs).
diff --git a/src/crates/concat/Cargo.toml b/src/crates/concat/Cargo.toml
index 8cfe8842..f9d4442d 100644
--- a/src/crates/concat/Cargo.toml
+++ b/src/crates/concat/Cargo.toml
@@ -146,6 +146,9 @@ concat-speech = { workspace = true, features = ["chatterbox"] }
# window is open. JSON-RPC only; the gRPC feature stays with concat-cli.
concat-server.workspace = true
concat-api.workspace = true
+# `concat --mcp`: the same API to an AI agent, as an MCP server on standard
+# input and output, with no window (docs/MCP.md).
+concat-mcp.workspace = true
# The effect catalogue: the inspector's shelves and each link's knobs.
concat-effects.workspace = true
# The cutout's mapping from a stage press to a source fraction; the model
diff --git a/src/crates/concat/locales/ar.json b/src/crates/concat/locales/ar.json
index 0a411977..f028651b 100644
--- a/src/crates/concat/locales/ar.json
+++ b/src/crates/concat/locales/ar.json
@@ -405,6 +405,7 @@
"settings.accent": "لون التمييز",
"settings.address": "العنوان",
"settings.addressHint": "حيث تتصل السكربتات والتطبيقات: عنوان ومنفذ. ‏127.0.0.1 لهذا الجهاز فقط.",
+ "settings.agentsConnectWithMcp": "يتصل وكلاء الذكاء الاصطناعي مثل Claude عبر MCP: وجّه الوكيل إلى هذا التطبيق مع --mcp. وما دام هذا مفعّلًا، يعملون عبر هذا الخادم ولا يمسّون المشروع المعروض على الشاشة.",
"settings.aheadOfReleases": "هذا الإصدار، {0}، أحدث من أي إصدار منشور.",
"settings.amber": "كهرماني",
"settings.appearance": "المظهر",
diff --git a/src/crates/concat/locales/bn.json b/src/crates/concat/locales/bn.json
index eb6280c9..d4bfd689 100644
--- a/src/crates/concat/locales/bn.json
+++ b/src/crates/concat/locales/bn.json
@@ -405,6 +405,7 @@
"settings.accent": "অ্যাকসেন্ট",
"settings.address": "ঠিকানা",
"settings.addressHint": "স্ক্রিপ্ট ও অ্যাপ যেখানে যুক্ত হয়: একটি ঠিকানা ও একটি পোর্ট। 127.0.0.1 শুধু এই কম্পিউটারের জন্য।",
+ "settings.agentsConnectWithMcp": "Claude-এর মতো AI এজেন্ট MCP দিয়ে যুক্ত হয়: --mcp দিয়ে এজেন্টকে এই অ্যাপের দিকে নির্দেশ করুন। এটি চালু থাকলে তারা এই সার্ভারের মাধ্যমে কাজ করে এবং পর্দার প্রজেক্টে হাত দেয় না।",
"settings.aheadOfReleases": "এই বিল্ড, {0}, যেকোনো রিলিজের চেয়ে নতুন।",
"settings.amber": "অ্যাম্বার",
"settings.appearance": "চেহারা",
diff --git a/src/crates/concat/locales/de.json b/src/crates/concat/locales/de.json
index 555660a9..cbf2d34e 100644
--- a/src/crates/concat/locales/de.json
+++ b/src/crates/concat/locales/de.json
@@ -405,6 +405,7 @@
"settings.accent": "Akzent",
"settings.address": "Adresse",
"settings.addressHint": "Wo sich Skripte und Apps verbinden: eine Adresse und ein Port. 127.0.0.1 ist nur dieser Rechner.",
+ "settings.agentsConnectWithMcp": "KI-Agenten wie Claude verbinden sich über MCP: Richten Sie den Agenten mit --mcp auf diese App. Solange dies an ist, arbeiten sie über diesen Server und lassen das Projekt auf dem Bildschirm in Ruhe.",
"settings.aheadOfReleases": "Dieser Build, {0}, ist neuer als jede Veröffentlichung.",
"settings.amber": "Amber",
"settings.appearance": "Darstellung",
diff --git a/src/crates/concat/locales/en.json b/src/crates/concat/locales/en.json
index d5f7fb11..a9825cd1 100644
--- a/src/crates/concat/locales/en.json
+++ b/src/crates/concat/locales/en.json
@@ -405,6 +405,7 @@
"settings.accent": "Accent",
"settings.address": "Address",
"settings.addressHint": "Where scripts and apps connect: an address and a port. 127.0.0.1 is this computer only.",
+ "settings.agentsConnectWithMcp": "AI agents such as Claude connect over MCP: point the agent at this app with --mcp. While this is on, they work through this server and leave the project on screen alone.",
"settings.aheadOfReleases": "This build, {0}, is newer than any release.",
"settings.amber": "Amber",
"settings.appearance": "Appearance",
diff --git a/src/crates/concat/locales/es.json b/src/crates/concat/locales/es.json
index 2a530565..ce007cca 100644
--- a/src/crates/concat/locales/es.json
+++ b/src/crates/concat/locales/es.json
@@ -405,6 +405,7 @@
"settings.accent": "Acento",
"settings.address": "Dirección",
"settings.addressHint": "Donde se conectan los scripts y las apps: una dirección y un puerto. 127.0.0.1 es solo este equipo.",
+ "settings.agentsConnectWithMcp": "Los agentes de IA como Claude se conectan por MCP: apunta el agente a esta app con --mcp. Mientras esto esté activado, trabajan a través de este servidor y no tocan el proyecto que tienes en pantalla.",
"settings.aheadOfReleases": "Esta compilación, {0}, es más reciente que cualquier versión publicada.",
"settings.amber": "Ámbar",
"settings.appearance": "Apariencia",
diff --git a/src/crates/concat/locales/fa.json b/src/crates/concat/locales/fa.json
index 0c9c80d2..048ec368 100644
--- a/src/crates/concat/locales/fa.json
+++ b/src/crates/concat/locales/fa.json
@@ -405,6 +405,7 @@
"settings.accent": "رنگ تأکید",
"settings.address": "آدرس",
"settings.addressHint": "جایی که اسکریپت‌ها و برنامه‌ها وصل می‌شوند: یک آدرس و یک پورت. 127.0.0.1 فقط همین دستگاه است.",
+ "settings.agentsConnectWithMcp": "عامل‌های هوش مصنوعی مانند Claude از راه MCP وصل می‌شوند: عامل را با ‎--mcp به این برنامه نشانی دهید. تا وقتی این روشن است، از راه این سرور کار می‌کنند و به پروژه‌ی روی صفحه دست نمی‌زنند.",
"settings.aheadOfReleases": "این ساخت، {0}، از هر نسخهٔ منتشرشده جدیدتر است.",
"settings.amber": "کهربایی",
"settings.appearance": "ظاهر",
diff --git a/src/crates/concat/locales/fr.json b/src/crates/concat/locales/fr.json
index 9ce68cbc..922ff7c8 100644
--- a/src/crates/concat/locales/fr.json
+++ b/src/crates/concat/locales/fr.json
@@ -405,6 +405,7 @@
"settings.accent": "Accent",
"settings.address": "Adresse",
"settings.addressHint": "Là où se connectent les scripts et les applications : une adresse et un port. 127.0.0.1, c'est cette machine seulement.",
+ "settings.agentsConnectWithMcp": "Les agents d’IA comme Claude se connectent par MCP : pointez l’agent vers cette app avec --mcp. Tant que ceci est activé, ils passent par ce serveur et ne touchent pas au projet à l’écran.",
"settings.aheadOfReleases": "Cette compilation, {0}, est plus récente que toute version publiée.",
"settings.amber": "Ambre",
"settings.appearance": "Apparence",
diff --git a/src/crates/concat/locales/he.json b/src/crates/concat/locales/he.json
index 4c9f44f7..fb90b6f4 100644
--- a/src/crates/concat/locales/he.json
+++ b/src/crates/concat/locales/he.json
@@ -405,6 +405,7 @@
"settings.accent": "צבע הדגשה",
"settings.address": "כתובת",
"settings.addressHint": "לאן סקריפטים ואפליקציות מתחברים: כתובת ופורט. 127.0.0.1 הוא המחשב הזה בלבד.",
+ "settings.agentsConnectWithMcp": "סוכני בינה מלאכותית כמו Claude מתחברים דרך MCP: הפנו את הסוכן לאפליקציה הזו עם ‎--mcp. כל עוד זה מופעל, הם עובדים דרך השרת הזה ולא נוגעים בפרויקט שעל המסך.",
"settings.aheadOfReleases": "גרסת הבנייה הזו, {0}, חדשה מכל גרסה שפורסמה.",
"settings.amber": "ענבר",
"settings.appearance": "מראה",
diff --git a/src/crates/concat/locales/hi.json b/src/crates/concat/locales/hi.json
index 0dce4cf8..8ba05724 100644
--- a/src/crates/concat/locales/hi.json
+++ b/src/crates/concat/locales/hi.json
@@ -405,6 +405,7 @@
"settings.accent": "एक्सेंट रंग",
"settings.address": "पता",
"settings.addressHint": "स्क्रिप्ट और ऐप जहां जुड़ते हैं: एक पता और एक पोर्ट। 127.0.0.1 का मतलब सिर्फ़ यही कंप्यूटर है।",
+ "settings.agentsConnectWithMcp": "Claude जैसे AI एजेंट MCP से जुड़ते हैं: --mcp के साथ एजेंट को इस ऐप की ओर इंगित करें। जब तक यह चालू है, वे इसी सर्वर के ज़रिए काम करते हैं और स्क्रीन पर खुले प्रोजेक्ट को नहीं छूते।",
"settings.aheadOfReleases": "यह बिल्ड, {0}, किसी भी रिलीज़ से नया है।",
"settings.amber": "एम्बर",
"settings.appearance": "रूप-रंग",
diff --git a/src/crates/concat/locales/hr.json b/src/crates/concat/locales/hr.json
index 1f468ce0..a24ada74 100644
--- a/src/crates/concat/locales/hr.json
+++ b/src/crates/concat/locales/hr.json
@@ -405,6 +405,7 @@
"settings.accent": "Naglasak",
"settings.address": "Adresa",
"settings.addressHint": "Gdje se spajaju skripte i aplikacije: adresa i port. 127.0.0.1 je samo ovo računalo.",
+ "settings.agentsConnectWithMcp": "AI agenti poput Claudea spajaju se preko MCP-a: usmjerite agenta na ovu aplikaciju s --mcp. Dok je ovo uključeno, rade preko ovog poslužitelja i ne diraju projekt na zaslonu.",
"settings.aheadOfReleases": "Ova je gradnja, {0}, novija od bilo kojeg izdanja.",
"settings.amber": "Jantar",
"settings.appearance": "Izgled",
diff --git a/src/crates/concat/locales/id.json b/src/crates/concat/locales/id.json
index 1c200dd7..aa07fa40 100644
--- a/src/crates/concat/locales/id.json
+++ b/src/crates/concat/locales/id.json
@@ -405,6 +405,7 @@
"settings.accent": "Aksen",
"settings.address": "Alamat",
"settings.addressHint": "Tempat skrip dan aplikasi terhubung: alamat dan port. 127.0.0.1 hanya untuk komputer ini.",
+ "settings.agentsConnectWithMcp": "Agen AI seperti Claude terhubung lewat MCP: arahkan agen ke aplikasi ini dengan --mcp. Selama ini aktif, mereka bekerja lewat server ini dan tidak menyentuh proyek yang ada di layar.",
"settings.aheadOfReleases": "Build ini, {0}, lebih baru dari rilis mana pun.",
"settings.amber": "Ambar",
"settings.appearance": "Tampilan",
diff --git a/src/crates/concat/locales/it.json b/src/crates/concat/locales/it.json
index a3f53b18..ea503570 100644
--- a/src/crates/concat/locales/it.json
+++ b/src/crates/concat/locales/it.json
@@ -405,6 +405,7 @@
"settings.accent": "Accento",
"settings.address": "Indirizzo",
"settings.addressHint": "Dove si collegano script e app: un indirizzo e una porta. 127.0.0.1 è solo questo computer.",
+ "settings.agentsConnectWithMcp": "Gli agenti di IA come Claude si collegano tramite MCP: indica all’agente questa app con --mcp. Finché questo è attivo, lavorano attraverso questo server e non toccano il progetto sullo schermo.",
"settings.aheadOfReleases": "Questa build, {0}, è più recente di qualsiasi versione pubblicata.",
"settings.amber": "Ambra",
"settings.appearance": "Aspetto",
diff --git a/src/crates/concat/locales/ja.json b/src/crates/concat/locales/ja.json
index 56c39ab1..bc3e0da3 100644
--- a/src/crates/concat/locales/ja.json
+++ b/src/crates/concat/locales/ja.json
@@ -405,6 +405,7 @@
"settings.accent": "アクセント",
"settings.address": "アドレス",
"settings.addressHint": "スクリプトやアプリの接続先: アドレスとポートです。127.0.0.1 はこのコンピューターだけです。",
+ "settings.agentsConnectWithMcp": "Claude などの AI エージェントは MCP で接続します:エージェントにこのアプリを --mcp 付きで指定してください。これがオンの間は、このサーバーを通して作業し、画面上のプロジェクトには触れません。",
"settings.aheadOfReleases": "このビルド {0} は、どのリリースよりも新しいものです。",
"settings.amber": "アンバー",
"settings.appearance": "外観",
diff --git a/src/crates/concat/locales/ko.json b/src/crates/concat/locales/ko.json
index d80ec5c5..08dcd5fa 100644
--- a/src/crates/concat/locales/ko.json
+++ b/src/crates/concat/locales/ko.json
@@ -405,6 +405,7 @@
"settings.accent": "강조색",
"settings.address": "주소",
"settings.addressHint": "스크립트와 앱이 연결하는 곳: 주소와 포트입니다. 127.0.0.1은 이 컴퓨터만입니다.",
+ "settings.agentsConnectWithMcp": "Claude 같은 AI 에이전트는 MCP로 연결합니다: 에이전트가 이 앱을 --mcp로 실행하도록 지정하세요. 이 설정이 켜져 있는 동안 에이전트는 이 서버를 통해 작업하며 화면에 열린 프로젝트는 건드리지 않습니다.",
"settings.aheadOfReleases": "이 빌드 {0}은(는) 어떤 릴리스보다 새롭습니다.",
"settings.amber": "앰버",
"settings.appearance": "화면",
diff --git a/src/crates/concat/locales/nl.json b/src/crates/concat/locales/nl.json
index 198dd514..00dc80cc 100644
--- a/src/crates/concat/locales/nl.json
+++ b/src/crates/concat/locales/nl.json
@@ -405,6 +405,7 @@
"settings.accent": "Accentkleur",
"settings.address": "Adres",
"settings.addressHint": "Waar scripts en apps verbinding mee maken: een adres en een poort. 127.0.0.1 is alleen deze computer.",
+ "settings.agentsConnectWithMcp": "AI-agents zoals Claude verbinden via MCP: wijs de agent naar deze app met --mcp. Zolang dit aan staat, werken ze via deze server en blijven ze van het project op het scherm af.",
"settings.aheadOfReleases": "Deze build, {0}, is nieuwer dan elke release.",
"settings.amber": "Amber",
"settings.appearance": "Weergave",
diff --git a/src/crates/concat/locales/pl.json b/src/crates/concat/locales/pl.json
index bac536c0..15bd2e4c 100644
--- a/src/crates/concat/locales/pl.json
+++ b/src/crates/concat/locales/pl.json
@@ -405,6 +405,7 @@
"settings.accent": "Kolor akcentu",
"settings.address": "Adres",
"settings.addressHint": "Gdzie łączą się skrypty i aplikacje: adres i port. 127.0.0.1 oznacza tylko ten komputer.",
+ "settings.agentsConnectWithMcp": "Agenci AI, tacy jak Claude, łączą się przez MCP: wskaż agentowi tę aplikację z --mcp. Dopóki to jest włączone, pracują przez ten serwer i nie ruszają projektu na ekranie.",
"settings.aheadOfReleases": "Ta kompilacja, {0}, jest nowsza niż jakiekolwiek wydanie.",
"settings.amber": "Bursztyn",
"settings.appearance": "Wygląd",
diff --git a/src/crates/concat/locales/pt-BR.json b/src/crates/concat/locales/pt-BR.json
index c1261737..54370d3a 100644
--- a/src/crates/concat/locales/pt-BR.json
+++ b/src/crates/concat/locales/pt-BR.json
@@ -405,6 +405,7 @@
"settings.accent": "Destaque",
"settings.address": "Endereço",
"settings.addressHint": "Onde scripts e apps se conectam: um endereço e uma porta. 127.0.0.1 é só este computador.",
+ "settings.agentsConnectWithMcp": "Agentes de IA como o Claude se conectam por MCP: aponte o agente para este app com --mcp. Enquanto isto estiver ativado, eles trabalham por este servidor e não mexem no projeto que está na tela.",
"settings.aheadOfReleases": "Esta compilação, {0}, é mais nova que qualquer versão publicada.",
"settings.amber": "Âmbar",
"settings.appearance": "Aparência",
diff --git a/src/crates/concat/locales/ru.json b/src/crates/concat/locales/ru.json
index fd4458fb..340a3760 100644
--- a/src/crates/concat/locales/ru.json
+++ b/src/crates/concat/locales/ru.json
@@ -405,6 +405,7 @@
"settings.accent": "Акцент",
"settings.address": "Адрес",
"settings.addressHint": "Куда подключаются скрипты и приложения: адрес и порт. 127.0.0.1 — только этот компьютер.",
+ "settings.agentsConnectWithMcp": "ИИ-агенты, такие как Claude, подключаются по MCP: укажите агенту это приложение с --mcp. Пока это включено, они работают через этот сервер и не трогают проект, открытый на экране.",
"settings.aheadOfReleases": "Эта сборка, {0}, новее любого выпуска.",
"settings.amber": "Янтарь",
"settings.appearance": "Оформление",
diff --git a/src/crates/concat/locales/th.json b/src/crates/concat/locales/th.json
index 7f3a56a0..cdcda4cf 100644
--- a/src/crates/concat/locales/th.json
+++ b/src/crates/concat/locales/th.json
@@ -405,6 +405,7 @@
"settings.accent": "สีเน้น",
"settings.address": "ที่อยู่",
"settings.addressHint": "ที่ที่สคริปต์และแอปเชื่อมต่อ: ที่อยู่และพอร์ต 127.0.0.1 คือคอมพิวเตอร์เครื่องนี้เท่านั้น",
+ "settings.agentsConnectWithMcp": "เอเจนต์ AI อย่าง Claude เชื่อมต่อผ่าน MCP: ชี้เอเจนต์มาที่แอปนี้พร้อม --mcp ระหว่างที่เปิดสิ่งนี้ไว้ เอเจนต์จะทำงานผ่านเซิร์ฟเวอร์นี้และไม่แตะโปรเจกต์ที่เปิดอยู่บนหน้าจอ",
"settings.aheadOfReleases": "บิลด์นี้ ({0}) ใหม่กว่าทุกรุ่นที่เผยแพร่",
"settings.amber": "อำพัน",
"settings.appearance": "ลักษณะที่ปรากฏ",
diff --git a/src/crates/concat/locales/tr.json b/src/crates/concat/locales/tr.json
index 29ffe4ef..a42e7c7e 100644
--- a/src/crates/concat/locales/tr.json
+++ b/src/crates/concat/locales/tr.json
@@ -405,6 +405,7 @@
"settings.accent": "Vurgu",
"settings.address": "Adres",
"settings.addressHint": "Betiklerin ve uygulamaların bağlandığı yer: bir adres ve bir bağlantı noktası. 127.0.0.1 yalnızca bu bilgisayardır.",
+ "settings.agentsConnectWithMcp": "Claude gibi yapay zekâ ajanları MCP üzerinden bağlanır: ajanı --mcp ile bu uygulamaya yönlendirin. Bu açıkken bu sunucu üzerinden çalışırlar ve ekrandaki projeye dokunmazlar.",
"settings.aheadOfReleases": "Bu yapı ({0}) yayımlanmış her sürümden daha yeni.",
"settings.amber": "Amber",
"settings.appearance": "Görünüm",
diff --git a/src/crates/concat/locales/uk.json b/src/crates/concat/locales/uk.json
index 3ef28902..bce34558 100644
--- a/src/crates/concat/locales/uk.json
+++ b/src/crates/concat/locales/uk.json
@@ -405,6 +405,7 @@
"settings.accent": "Акцент",
"settings.address": "Адреса",
"settings.addressHint": "Куди підключаються скрипти й застосунки: адреса і порт. 127.0.0.1 — лише цей комп’ютер.",
+ "settings.agentsConnectWithMcp": "ШІ-агенти, як-от Claude, під’єднуються через MCP: вкажіть агентові цей застосунок із --mcp. Поки це ввімкнено, вони працюють через цей сервер і не чіпають проєкт, відкритий на екрані.",
"settings.aheadOfReleases": "Ця збірка, {0}, новіша за будь-який випуск.",
"settings.amber": "Бурштин",
"settings.appearance": "Вигляд",
diff --git a/src/crates/concat/locales/ur.json b/src/crates/concat/locales/ur.json
index c34db21b..175e3d63 100644
--- a/src/crates/concat/locales/ur.json
+++ b/src/crates/concat/locales/ur.json
@@ -405,6 +405,7 @@
"settings.accent": "نمایاں رنگ",
"settings.address": "پتہ",
"settings.addressHint": "جہاں اسکرپٹس اور ایپس جڑتی ہیں: ایک پتہ اور ایک پورٹ۔ 127.0.0.1 صرف یہی کمپیوٹر ہے۔",
+ "settings.agentsConnectWithMcp": "Claude جیسے AI ایجنٹ MCP کے ذریعے جڑتے ہیں: ایجنٹ کو ‎--mcp کے ساتھ اس ایپ کی طرف اشارہ کریں۔ جب تک یہ آن ہے، وہ اسی سرور کے ذریعے کام کرتے ہیں اور اسکرین پر کھلے پروجیکٹ کو نہیں چھیڑتے۔",
"settings.aheadOfReleases": "یہ بلڈ، {0}، کسی بھی جاری شدہ ورژن سے نیا ہے۔",
"settings.amber": "کہربائی",
"settings.appearance": "ظاہری شکل",
diff --git a/src/crates/concat/locales/vi.json b/src/crates/concat/locales/vi.json
index cd23a933..9aaa42fc 100644
--- a/src/crates/concat/locales/vi.json
+++ b/src/crates/concat/locales/vi.json
@@ -405,6 +405,7 @@
"settings.accent": "Màu nhấn",
"settings.address": "Địa chỉ",
"settings.addressHint": "Nơi script và ứng dụng kết nối: một địa chỉ và một cổng. 127.0.0.1 chỉ là máy này.",
+ "settings.agentsConnectWithMcp": "Các tác tử AI như Claude kết nối qua MCP: trỏ tác tử tới ứng dụng này kèm --mcp. Khi mục này bật, chúng làm việc qua máy chủ này và không đụng tới dự án đang mở trên màn hình.",
"settings.aheadOfReleases": "Bản dựng này ({0}) mới hơn mọi bản phát hành hiện có.",
"settings.amber": "Hổ phách",
"settings.appearance": "Giao diện",
diff --git a/src/crates/concat/locales/zh-Hans.json b/src/crates/concat/locales/zh-Hans.json
index 5dc61488..4364f25b 100644
--- a/src/crates/concat/locales/zh-Hans.json
+++ b/src/crates/concat/locales/zh-Hans.json
@@ -405,6 +405,7 @@
"settings.accent": "强调色",
"settings.address": "地址",
"settings.addressHint": "脚本和应用的连接位置:一个地址和一个端口。127.0.0.1 仅限本机。",
+ "settings.agentsConnectWithMcp": "Claude 等 AI 智能体通过 MCP 连接:让智能体以 --mcp 启动本应用。此项开启时,它们经由这个服务器工作,不会动屏幕上打开的项目。",
"settings.aheadOfReleases": "此构建 {0} 比任何已发布版本都新。",
"settings.amber": "琥珀",
"settings.appearance": "外观",
diff --git a/src/crates/concat/locales/zh-TW.json b/src/crates/concat/locales/zh-TW.json
index c775dd25..9a2d5beb 100644
--- a/src/crates/concat/locales/zh-TW.json
+++ b/src/crates/concat/locales/zh-TW.json
@@ -405,6 +405,7 @@
"settings.accent": "強調色",
"settings.address": "位址",
"settings.addressHint": "指令碼與應用程式的連線位置:一個位址和一個連接埠。127.0.0.1 僅限本機。",
+ "settings.agentsConnectWithMcp": "Claude 等 AI 代理透過 MCP 連線:讓代理以 --mcp 啟動本應用程式。此項開啟時,它們經由這個伺服器工作,不會動到螢幕上開啟的專案。",
"settings.aheadOfReleases": "此建置 {0} 比任何已發布版本都新。",
"settings.amber": "琥珀",
"settings.appearance": "外觀",
diff --git a/src/crates/concat/src/launch.rs b/src/crates/concat/src/launch.rs
index 229ebe4c..a2ee7f16 100644
--- a/src/crates/concat/src/launch.rs
+++ b/src/crates/concat/src/launch.rs
@@ -6,14 +6,19 @@
use std::ffi::OsString;
use std::path::PathBuf;
-const USAGE: &str =
- "usage: concat [--project <PROJECT_DIRECTORY> | --version | --smoke | --whisper-cpu]";
+const USAGE: &str = "usage: concat [--project <PROJECT_DIRECTORY> | --mcp [auto|window|headless] | --version | --smoke | --whisper-cpu]";
/// What one run of the binary was asked to do.
#[derive(Debug, PartialEq, Eq)]
pub enum Launch {
/// The window, on the launch screen or on the project it names.
Normal(Option<PathBuf>),
+ /// Serve the Concat API to an AI agent as an MCP server on standard
+ /// input and output, with no window: what an agent's configuration
+ /// names (docs/MCP.md). The mode, when given: through the window's
+ /// server, on its own, or whichever is there; `CONCAT_MCP_MODE`
+ /// otherwise, and `auto` without that.
+ Mcp(Option<concat_mcp::Mode>),
/// Print the version and exit, before logging, the GPU or a window: a
/// run that gets this far has proved the executable and every library
/// it links were found and loaded, which on Windows fails before `main`.
@@ -44,6 +49,15 @@ pub fn parse(args: impl IntoIterator<Item = OsString>) -> Result<Launch, String>
Launch::Smoke
} else if option == "--whisper-cpu" {
Launch::WhisperCpu
+ } else if option == "--mcp" {
+ match args.next() {
+ None => Launch::Mcp(None),
+ Some(word) => Launch::Mcp(Some(
+ word.to_str()
+ .and_then(concat_mcp::Mode::parse)
+ .ok_or_else(|| format!("--mcp takes auto, window or headless\n{USAGE}"))?,
+ )),
+ }
} else if option == "--project" {
let path = args
.next()
@@ -96,6 +110,31 @@ mod tests {
}
}
+ #[test]
+ fn mcp_takes_an_optional_mode_and_nothing_else() {
+ use concat_mcp::Mode;
+ assert_eq!(parse_strs(&["--mcp"]).unwrap(), Launch::Mcp(None));
+ assert_eq!(
+ parse_strs(&["--mcp", "headless"]).unwrap(),
+ Launch::Mcp(Some(Mode::Headless))
+ );
+ assert_eq!(
+ parse_strs(&["--mcp", "window"]).unwrap(),
+ Launch::Mcp(Some(Mode::Window))
+ );
+ assert_eq!(
+ parse_strs(&["--mcp", "auto"]).unwrap(),
+ Launch::Mcp(Some(Mode::Auto))
+ );
+ for args in [
+ vec!["--mcp", "sometimes"],
+ vec!["--mcp", "headless", "extra"],
+ vec!["--mcp", "--project"],
+ ] {
+ assert!(parse_strs(&args).is_err(), "{args:?}");
+ }
+ }
+
#[test]
fn rejects_missing_empty_duplicate_and_unknown_arguments() {
for args in [
diff --git a/src/crates/concat/src/main.rs b/src/crates/concat/src/main.rs
index 8fec20c9..f700494c 100644
--- a/src/crates/concat/src/main.rs
+++ b/src/crates/concat/src/main.rs
@@ -35,6 +35,24 @@ fn main() -> Result<(), slint::PlatformError> {
let _ = writeln!(std::io::stdout(), "whisper runs on {cpu}");
return Ok(());
}
+ // An agent's MCP server: no window, no GPU, and standard output kept
+ // for the protocol alone. The engine's log goes to standard error,
+ // which the agent's client shows; not to a file, where every agent
+ // session would push one of the window's own logs out of the folder.
+ if let Ok(Launch::Mcp(mode)) = launch {
+ let mode = mode
+ .or_else(|| {
+ std::env::var("CONCAT_MCP_MODE")
+ .ok()
+ .and_then(|word| concat_mcp::Mode::parse(&word))
+ })
+ .unwrap_or_default();
+ let _ =concat_host::logs::open_console(None);
+ return concat_mcp::run(mode).map_err(|error| {
+ log::error!("mcp: {error}");
+ slint::PlatformError::Other(error)
+ });
+ }
// A desktop's console is its standard error, which a packaged build
// has wired to nowhere; hence the file underneath it.
concat::open_logging(None);
@@ -55,6 +73,6 @@ fn main() -> Result<(), slint::PlatformError> {
log::error!("smoke: could not start: {error}");
}),
// Answered above, before the log was opened.
- Launch::Version | Launch::WhisperCpu => Ok(()),
+ Launch::Version | Launch::WhisperCpu | Launch::Mcp(_) => Ok(()),
}
}
diff --git a/src/crates/concat/src/panes/settings.rs b/src/crates/concat/src/panes/settings.rs
index c6491d1e..e9dd57e1 100644
--- a/src/crates/concat/src/panes/settings.rs
+++ b/src/crates/concat/src/panes/settings.rs
@@ -623,6 +623,7 @@ impl SettingsPane {
self.server_error.clear();
let exporter = studio.host.exporter.clone();
let open_projects = studio.host.open_projects.clone();
+ let dirs = studio.host.dirs.clone();
let prefs = &studio.prefs.server;
if !prefs.enabled {
return;
@@ -646,6 +647,9 @@ impl SettingsPane {
let config = concat_server::Config {
json: Some(address),
token: Some(prefs.token.clone()).filter(|token| !token.is_empty()),
+ // Where `concat --mcp`, started by an agent, finds this
+ // server rather than opening projects behind its back.
+ discovery: Some(concat_server::discovery::path_in(&dirs.config)),
..concat_server::Config::default()
};
// The window's export slot and its register of open
diff --git a/src/crates/concat/ui/dialogs/settings.slint b/src/crates/concat/ui/dialogs/settings.slint
index 1f79c9ca..0ecba27c 100644
--- a/src/crates/concat/ui/dialogs/settings.slint
+++ b/src/crates/concat/ui/dialogs/settings.slint
@@ -1273,6 +1273,13 @@ export component SettingsDialog inherits Modal {
wrap: word-wrap;
}
}
+
+ Text {
+ text: I18n.t("settings.agentsConnectWithMcp");
+ color: Theme.fg-muted;
+ font-size: Theme.fs-sm;
+ wrap: word-wrap;
+ }
}
DialogSection {