diff --git a/mintlify/ar/cli/config.mdx b/mintlify/ar/cli/config.mdx index e622a41..d5796ae 100644 --- a/mintlify/ar/cli/config.mdx +++ b/mintlify/ar/cli/config.mdx @@ -1,6 +1,6 @@ --- title: "أوامر Config" -description: "المزوِّدون، والتكلفة، ولوحات المعلومات، والعلامة التجارية، والأطلس، والحزمة: config وcost وdash وbrand وatlas وstack — إضافةً إلى أمرَي report وtools في الإصدار v0.19+." +description: "المزوِّدون، والتكلفة، ولوحات المعلومات، والعلامة التجارية، والأطلس، والحزمة، وتكاملات MCP الاختيارية: config وcost وdash وbrand وatlas وstack وreport وtools وintegrations." --- تُغطّي مجموعة Config المزوِّدين، والملاحظة، ورسم الشيفرة، واكتشاف الحزمة. @@ -89,3 +89,73 @@ forge report ```bash forge tools ``` + +## `forge integrations` + +خوادم MCP طرف ثالث اختيارية (على سبيل المثال `context7`)، تُدار بلا إتلاف عبر كل +أداة يُصدر Forge إعدادًا لها — Claude Code، وCodex، وCursor، وGemini، وContinue، +وبقيّة الأدوات. + +خوادم MCP الطرف الثالث **غير** مثبّتة افتراضيًا. لا شيء يهبط على القرص إلى أن تُشغّل +`forge integrations add --yes`. + +```bash +forge integrations # list opt-in servers with package + purpose +forge integrations add # dry-run: prints package, network, files it would touch +forge integrations add --yes # apply — write MCP config for every tool +forge integrations add --yes --adopt # also claim a same-name entry you already configured +forge integrations remove # reverse the add — deletes only forge-owned entries +``` + +### ماذا يكتب `add` + +يكتب `add --yes` الخادمَ في إعداد MCP الأصلي لكل أداة من مواصفة قانونية واحدة: + +- `.mcp.json` (Claude Code) +- `.cursor/mcp.json` (Cursor) +- `.gemini/settings.json` (Gemini) +- `.codex/config.toml` — ككتلة `# forge:managed:`، تُحدَّث بمقارنة البايتات +- `.continue/mcpServers/.yaml` — ملف YAML واحد مُعلَّم بعلامة forge لكل خادم مُدار +- وبقيّة الأدوات التي يُصدر Forge إعدادًا لها + +تُسجَّل المجموعة المثبّتة في `.forge/forge.config.json` تحت `mcp.integrations`، فيُعيد +كلُّ `forge sync` لاحق إصدارَ الخوادم نفسها. تُقارن مزامنةُ خطّاف التوقف التلقائي +ملفَّ الإعداد كاملًا بالبايت، فيُكتشف أي تعديل يدوي على ذلك الملف ويُصلَح. + +### دلالات `--adopt` + +إذا كان هناك خادم بالاسم نفسه موجود سلفًا في أحد ملفات إعدادات الأدوات ولم يضعه +Forge هناك، فإن `add` **لا يستبدله**. بل يُبلّغ عن الملف مع تلميح `--adopt`. +أعِد التشغيل بـ `--adopt` للمطالبة بالملكية — يُسجّل Forge المدخل تحت +`mcp.adopted` في `.forge/forge.config.json` وسيُديره من ذلك الحين. + +استخدم `--adopt` عندما تكون قد أعددت خادمًا يدويًا سابقًا وتريد الآن أن يُبقيه Forge +متزامنًا عبر كل الأدوات. + +### `remove` + +يعكس `forge integrations remove ` عمليةَ الإضافة. يحذف فقط المدخلات والكتل +والملفات المملوكة لـ forge — أما الخادم الذي يحمل الاسم نفسه وأعدّه المستخدم (ولم +يُطبَّق عليه `--adopt`) فيُترك كما هو. تشغيل `remove` مرّتين لا أثر له. + +```bash +forge integrations remove context7 +``` + +### `.forge/forge.config.json` + +حالة Forge لكل مستودع — الإعداد الموحّد الذي يحمل أيضًا `primaryTool` و`tools` +و`profile` — تُسجّل التكاملات الاختيارية تحت مفتاحين: + +```json +{ + "mcp": { + "integrations": ["context7"], + "adopted": [] + } +} +``` + +المفاتيح غير المعروفة تعبر الكتابات دون تغيير. لا يُتجاهل الملف المُعطوب بصمت: +تُصدر عمليات القراءة تحذيرًا واحدًا لكل عملية على stderr، ويرفض الكاتبون استبدال +إعداد لا يمكن تحليله بدلًا من الكتابة فوقه بالقيم الافتراضية. diff --git a/mintlify/ar/introduction.mdx b/mintlify/ar/introduction.mdx index d3a2f14..4ea6686 100644 --- a/mintlify/ar/introduction.mdx +++ b/mintlify/ar/introduction.mdx @@ -1,5 +1,5 @@ --- -title: "مقدمة" +title: "Forge: الركيزة المعرفية لوكلاء البرمجة بالذكاء الاصطناعي" description: "Forge هو الركيزة المعرفية التي يفتقدها كل نموذج عديم الحالة — الذاكرة، والاستشراف، وحواجز الأمان — يُقدَّم كإعداد أصلي لكل وكيل برمجة يعتمد على الذكاء الاصطناعي." --- @@ -89,6 +89,10 @@ _قبل_ أن يعدّل النموذج الشيفرة، والتي تُوفّر Claude Code، وCodex، وCursor، وGemini، وAider، وCopilot، وWindsurf/Devin، وZed، وContinue. تقرأ كلٌّ منها القواعد نفسها من ملفها الأصلي. +خادم MCP الوحيد الموصول افتراضيًا هو خادم Forge نفسه (`src/cortex_mcp.js`) — فحوصات +الركيزة وقراءات الذاكرة. أما خوادم MCP الطرف الثالث مثل `context7` فهي **اختيارية** +ولا تهبط على القرص إلى أن تُشغّل [`forge integrations add --yes`](/cli/config#forge-integrations). + ## الحدود الصادقة يُعلن Forge سقفه في كل مكان. diff --git a/mintlify/cli/config.mdx b/mintlify/cli/config.mdx index 9fcfb7e..bfdc53e 100644 --- a/mintlify/cli/config.mdx +++ b/mintlify/cli/config.mdx @@ -1,6 +1,6 @@ --- title: "Config commands" -description: "Providers, cost, dashboards, brand, atlas, and stack: config, cost, dash, brand, atlas, stack — plus the v0.19+ report and tools commands." +description: "Providers, cost, dashboards, brand, atlas, stack, and opt-in MCP integrations: config, cost, dash, brand, atlas, stack, report, tools, integrations." --- The Config group covers providers, observability, the code graph, and stack detection. @@ -89,3 +89,75 @@ generated config and `.forge/` artifacts are ignored correctly for your setup. ```bash forge tools ``` + +## `forge integrations` + +Opt-in third-party MCP servers (for example `context7`), managed non-destructively across +every tool Forge emits config for — Claude Code, Codex, Cursor, Gemini, Continue, and the +rest. + +Third-party MCP servers are **not** installed by default. Nothing lands on disk until you +run `forge integrations add --yes`. + +```bash +forge integrations # list opt-in servers with package + purpose +forge integrations add # dry-run: prints package, network, files it would touch +forge integrations add --yes # apply — write MCP config for every tool +forge integrations add --yes --adopt # also claim a same-name entry you already configured +forge integrations remove # reverse the add — deletes only forge-owned entries +``` + +### What `add` writes + +`add --yes` writes the server into every tool's native MCP config from one canonical +spec: + +- `.mcp.json` (Claude Code) +- `.cursor/mcp.json` (Cursor) +- `.gemini/settings.json` (Gemini) +- `.codex/config.toml` — as a `# forge:managed:` block, refreshed by byte-compare +- `.continue/mcpServers/.yaml` — one forge-marked YAML per managed server +- and the rest of the tools Forge emits config for + +The installed set is recorded in `.forge/forge.config.json` under `mcp.integrations`, so +every subsequent `forge sync` re-emits the same servers. The stop-hook auto-sync +byte-compares the whole config file, so a hand-edit to that file is detected and +repaired. + +### `--adopt` semantics + +If a server with the same name already exists in one of the tool config files and Forge +did not put it there, `add` **does not overwrite it**. Instead it reports the file with an +`--adopt` hint. Re-run with `--adopt` to claim ownership — Forge records the entry under +`mcp.adopted` in `.forge/forge.config.json` and will manage it from then on. + +Use `--adopt` when you configured a server by hand earlier and now want Forge to keep it +in sync across every tool. + +### `remove` + +`forge integrations remove ` reverses an add. It deletes only forge-owned entries, +blocks, and files — a same-name server the user configured (and never `--adopt`ed) is +left alone. Running `remove` twice is a no-op. + +```bash +forge integrations remove context7 +``` + +### `.forge/forge.config.json` + +Per-repo Forge state — the unified config that also holds `primaryTool`, `tools`, and +`profile` — records opt-in integrations under two keys: + +```json +{ + "mcp": { + "integrations": ["context7"], + "adopted": [] + } +} +``` + +Unknown keys round-trip through writes. A malformed file is not silently discarded: +reads warn once per process on stderr, and writers refuse to overwrite an unparseable +config instead of replacing it with defaults. diff --git a/mintlify/cn/cli/config.mdx b/mintlify/cn/cli/config.mdx index cc7e419..de9653c 100644 --- a/mintlify/cn/cli/config.mdx +++ b/mintlify/cn/cli/config.mdx @@ -1,6 +1,6 @@ --- title: "Config 命令" -description: "提供方、成本、仪表盘、品牌、atlas 和技术栈:config、cost、dash、brand、atlas、stack —— 外加 v0.19+ 的 report 和 tools 命令。" +description: "提供方、成本、仪表盘、品牌、atlas、技术栈和可选 MCP 集成:config、cost、dash、brand、atlas、stack、report、tools、integrations。" --- Config 分组涵盖提供方、可观测性、代码图和技术栈探测。 @@ -89,3 +89,73 @@ forge report ```bash forge tools ``` + +## `forge integrations` + +按需接入(opt-in)的第三方 MCP 服务器(例如 `context7`),以非破坏性的方式管理, +覆盖 Forge 为之输出配置的每一个工具 —— Claude Code、Codex、Cursor、Gemini、Continue +以及其他所有工具。 + +第三方 MCP 服务器**默认不安装**。在你执行 `forge integrations add --yes` +之前,什么都不会落到磁盘上。 + +```bash +forge integrations # list opt-in servers with package + purpose +forge integrations add # dry-run: prints package, network, files it would touch +forge integrations add --yes # apply — write MCP config for every tool +forge integrations add --yes --adopt # also claim a same-name entry you already configured +forge integrations remove # reverse the add — deletes only forge-owned entries +``` + +### `add` 会写什么 + +`add --yes` 从一份规范的 spec 出发,把这个服务器写入每个工具原生的 MCP 配置: + +- `.mcp.json`(Claude Code) +- `.cursor/mcp.json`(Cursor) +- `.gemini/settings.json`(Gemini) +- `.codex/config.toml` —— 作为一个 `# forge:managed:` 代码块,通过逐字节比对 + 来刷新 +- `.continue/mcpServers/.yaml` —— 每个被管理的服务器一个带 forge 标记的 YAML +- 以及 Forge 为之输出配置的其他工具 + +已安装的集合记录在 `.forge/forge.config.json` 的 `mcp.integrations` 下,因此之后每一次 +`forge sync` 都会重新输出同一批服务器。stop-hook 的自动同步会对整份配置文件做逐字节 +比对,所以对该文件的手工编辑会被检测到并被修复。 + +### `--adopt` 的语义 + +如果一个同名的服务器已经存在于某个工具的配置文件里,而且不是 Forge 放进去的,`add` +**不会覆盖它**。它会报告是哪个文件,并给出一个 `--adopt` 提示。加上 `--adopt` 重新 +运行来接管所有权 —— Forge 会把这条记录写到 `.forge/forge.config.json` 的 +`mcp.adopted` 下,从此由 Forge 来管理它。 + +当你之前手工配了某个服务器,现在又想让 Forge 在每个工具之间把它同步保持一致时, +就用 `--adopt`。 + +### `remove` + +`forge integrations remove ` 反转一次 add。它只删除 forge 所拥有的条目、 +代码块和文件 —— 用户自己配的、并且从没 `--adopt` 过的同名服务器会被保留下来。 +连续跑两次 `remove` 是个无操作。 + +```bash +forge integrations remove context7 +``` + +### `.forge/forge.config.json` + +每个仓库的 Forge 状态 —— 这份统一配置里也存着 `primaryTool`、`tools` 和 +`profile` —— 在两个键下记录按需接入的集成: + +```json +{ + "mcp": { + "integrations": ["context7"], + "adopted": [] + } +} +``` + +未知的键在写入时会被原样保留。一个损坏的文件不会被静默丢弃:读取时每个进程会在 +stderr 上告警一次,而写入者会拒绝用默认值覆盖一份无法解析的配置。 diff --git a/mintlify/cn/introduction.mdx b/mintlify/cn/introduction.mdx index db31d9b..8983c4d 100644 --- a/mintlify/cn/introduction.mdx +++ b/mintlify/cn/introduction.mdx @@ -1,5 +1,5 @@ --- -title: "简介" +title: "Forge:面向 AI 编码代理的认知基底" description: "Forge 是每个无状态模型都缺失的认知基底 —— 记忆、预见和护栏 —— 以原生配置的形式交付到每一个 AI 编码代理。" --- @@ -91,6 +91,11 @@ Forge 为**九个工具**输出配置,加上给 Roo Code 和 VS Code 的一个 Claude Code、Codex、Cursor、Gemini、Aider、Copilot、Windsurf/Devin、Zed 和 Continue。 每个工具从它自己的原生文件里读同一份规则。 +默认接通的 MCP 服务器只有 Forge 自己的那一个(`src/cortex_mcp.js`)—— 负责基底 +检查和记忆读取。像 `context7` 这样的第三方 MCP 服务器是**按需接入**(opt-in)的, +在你执行 [`forge integrations add --yes`](/cli/config#forge-integrations) 之前, +它们绝不会落到磁盘上。 + ## 诚实的边界 Forge 到处都会声明它自己的天花板。 diff --git a/mintlify/hi/cli/config.mdx b/mintlify/hi/cli/config.mdx index c4a1422..0e9da36 100644 --- a/mintlify/hi/cli/config.mdx +++ b/mintlify/hi/cli/config.mdx @@ -1,6 +1,6 @@ --- title: "Config कमांड्स" -description: "प्रोवाइडर्स, लागत, डैशबोर्ड्स, ब्रांड, atlas, और स्टैक: config, cost, dash, brand, atlas, stack — साथ ही v0.19+ report और tools कमांड्स।" +description: "प्रोवाइडर्स, लागत, डैशबोर्ड्स, ब्रांड, atlas, स्टैक और ऑप्ट-इन MCP इंटीग्रेशन्स: config, cost, dash, brand, atlas, stack, report, tools, integrations।" --- Config समूह प्रोवाइडर्स, ऑब्ज़र्वेबिलिटी, कोड ग्राफ़, और स्टैक डिटेक्शन को कवर करता है। @@ -89,3 +89,75 @@ forge report ```bash forge tools ``` + +## `forge integrations` + +ऑप्ट-इन थर्ड-पार्टी MCP सर्वर (उदाहरण के लिए `context7`), हर उस टूल में गैर-विनाशकारी +ढंग से प्रबंधित जिसके लिए Forge कॉन्फ़िग निकालता है — Claude Code, Codex, Cursor, +Gemini, Continue, और बाकी सभी। + +थर्ड-पार्टी MCP सर्वर डिफ़ॉल्ट रूप से इंस्टॉल **नहीं** होते। जब तक आप +`forge integrations add --yes` नहीं चलाते तब तक डिस्क पर कुछ नहीं उतरता। + +```bash +forge integrations # list opt-in servers with package + purpose +forge integrations add # dry-run: prints package, network, files it would touch +forge integrations add --yes # apply — write MCP config for every tool +forge integrations add --yes --adopt # also claim a same-name entry you already configured +forge integrations remove # reverse the add — deletes only forge-owned entries +``` + +### `add` क्या लिखता है + +`add --yes` एक कैननिकल स्पेक से हर टूल की नेटिव MCP कॉन्फ़िग में सर्वर लिखता है: + +- `.mcp.json` (Claude Code) +- `.cursor/mcp.json` (Cursor) +- `.gemini/settings.json` (Gemini) +- `.codex/config.toml` — एक `# forge:managed:` ब्लॉक के रूप में, बाइट-तुलना द्वारा रीफ़्रेश +- `.continue/mcpServers/.yaml` — प्रति प्रबंधित सर्वर एक forge-चिह्नित YAML +- और बाकी वे टूल्स जिनके लिए Forge कॉन्फ़िग निकालता है + +इंस्टॉल किया गया सेट `.forge/forge.config.json` में `mcp.integrations` के तहत दर्ज होता है, +ताकि हर आगामी `forge sync` वही सर्वर पुनः निकाले। स्टॉप-हुक ऑटो-सिंक पूरी कॉन्फ़िग फ़ाइल की +बाइट-तुलना करता है, इसलिए उस फ़ाइल में हाथ से किया गया एडिट पहचाना जाता है और सुधार दिया जाता है। + +### `--adopt` सिमैंटिक्स + +अगर किसी टूल की कॉन्फ़िग फ़ाइल में उसी नाम का सर्वर पहले से मौजूद है और उसे Forge ने +वहाँ नहीं रखा, तो `add` उसे **ओवरराइट नहीं करता**। इसके बजाय वह फ़ाइल को `--adopt` संकेत +के साथ रिपोर्ट करता है। स्वामित्व लेने के लिए `--adopt` के साथ पुनः चलाएँ — Forge उस +प्रविष्टि को `.forge/forge.config.json` में `mcp.adopted` के तहत दर्ज करता है और उसके बाद +से उसे प्रबंधित करता है। + +`--adopt` का उपयोग तब करें जब आपने पहले हाथ से किसी सर्वर को कॉन्फ़िगर किया था और अब +चाहते हैं कि Forge उसे हर टूल में सिंक रखे। + +### `remove` + +`forge integrations remove ` एक add को उलट देता है। यह केवल forge-स्वामित्व वाली +प्रविष्टियाँ, ब्लॉक और फ़ाइलें हटाता है — उपयोगकर्ता द्वारा कॉन्फ़िगर किया गया (और कभी +`--adopt` न किया गया) उसी नाम का सर्वर अछूता छोड़ दिया जाता है। `remove` दो बार चलाना +नो-ऑप है। + +```bash +forge integrations remove context7 +``` + +### `.forge/forge.config.json` + +प्रति-रेपो Forge स्टेट — वही यूनिफ़ाइड कॉन्फ़िग जो `primaryTool`, `tools`, और `profile` +भी रखती है — ऑप्ट-इन इंटीग्रेशन को दो कुंजियों के तहत दर्ज करती है: + +```json +{ + "mcp": { + "integrations": ["context7"], + "adopted": [] + } +} +``` + +अज्ञात कुंजियाँ राइट्स के दौरान राउंड-ट्रिप करती हैं। खराब फ़ॉर्मैट वाली फ़ाइल चुपचाप +नहीं छोड़ी जाती: रीड्स प्रति प्रक्रिया एक बार stderr पर चेतावनी देते हैं, और राइटर्स +किसी अपार्सेबल कॉन्फ़िग को डिफ़ॉल्ट्स से बदलने के बजाय उस पर लिखने से इनकार कर देते हैं। diff --git a/mintlify/hi/introduction.mdx b/mintlify/hi/introduction.mdx index c27ec31..1333939 100644 --- a/mintlify/hi/introduction.mdx +++ b/mintlify/hi/introduction.mdx @@ -1,5 +1,5 @@ --- -title: "परिचय" +title: "Forge: AI कोडिंग एजेंट्स के लिए संज्ञानात्मक सब्सट्रेट" description: "Forge वह संज्ञानात्मक सब्सट्रेट है जो हर स्टेटलेस मॉडल में गायब है — मेमोरी, दूरदर्शिता और गार्डरेल्स — जो हर AI कोडिंग एजेंट को नेटिव कॉन्फ़िग के रूप में मिलता है।" --- @@ -95,6 +95,11 @@ Forge **नौ टूल्स** के लिए कॉन्फ़िग न एक MCP सर्वर: Claude Code, Codex, Cursor, Gemini, Aider, Copilot, Windsurf/Devin, Zed, और Continue। हर एक अपनी ही नेटिव फ़ाइल से वही नियम पढ़ता है। +डिफ़ॉल्ट रूप से केवल एक ही MCP सर्वर वायर होता है — Forge का अपना (`src/cortex_mcp.js`) — +सब्सट्रेट चेक्स और मेमोरी रीड्स के लिए। `context7` जैसे थर्ड-पार्टी MCP सर्वर **ऑप्ट-इन** +हैं और तब तक डिस्क पर नहीं उतरते जब तक आप [`forge integrations add --yes`](/cli/config#forge-integrations) +न चलाएँ। + ## ईमानदार सीमाएँ Forge हर जगह अपनी सीमा स्वयं बताता है। diff --git a/mintlify/introduction.mdx b/mintlify/introduction.mdx index acdcbd1..50cf6f2 100644 --- a/mintlify/introduction.mdx +++ b/mintlify/introduction.mdx @@ -1,6 +1,6 @@ --- -title: "Introduction" -description: "Forge is the cognitive substrate every stateless model is missing — memory, foresight, and guardrails — delivered as native config to every AI coding agent." +title: "Forge: the cognitive substrate for AI coding agents" +description: "Forge is the cognitive substrate stateless models are missing — memory, foresight, and guardrails — as native config for every AI coding agent." --- **One brain for every AI coding agent.** A large language model is stateless: one @@ -92,6 +92,10 @@ Forge emits config for **nine tools**, plus an MCP server for Roo Code and VS Co Claude Code, Codex, Cursor, Gemini, Aider, Copilot, Windsurf/Devin, Zed, and Continue. Each reads the same rules from its own native file. +The only MCP server wired by default is Forge's own (`src/cortex_mcp.js`) — the substrate +checks and memory reads. Third-party MCP servers such as `context7` are **opt-in** and +never land on disk until you run [`forge integrations add --yes`](/cli/config#forge-integrations). + ## Honest limits Forge states its own ceiling everywhere. diff --git a/mintlify/zh-CN/cli/config.mdx b/mintlify/zh-CN/cli/config.mdx index 9128661..9604e1b 100644 --- a/mintlify/zh-CN/cli/config.mdx +++ b/mintlify/zh-CN/cli/config.mdx @@ -1,6 +1,6 @@ --- title: "Config 命令" -description: "提供商、成本、看板、品牌、atlas 和技术栈:config、cost、dash、brand、atlas、stack —— 外加 v0.19+ 的 report 与 tools 命令。" +description: "提供商、成本、看板、品牌、atlas、技术栈与可选 MCP 集成:config、cost、dash、brand、atlas、stack、report、tools、integrations。" --- Config 组涵盖提供商、可观测性、代码图和技术栈检测。 @@ -84,3 +84,59 @@ forge report ```bash forge tools ``` + +## `forge integrations` + +选择性接入的第三方 MCP 服务器(例如 `context7`),在 Forge 生成配置的每一个工具中被非破坏性地统一管理 —— Claude Code、Codex、Cursor、Gemini、Continue 等。 + +第三方 MCP 服务器**默认不安装**。在你运行 `forge integrations add --yes` 之前,不会有任何东西落到磁盘上。 + +```bash +forge integrations # list opt-in servers with package + purpose +forge integrations add # dry-run: prints package, network, files it would touch +forge integrations add --yes # apply — write MCP config for every tool +forge integrations add --yes --adopt # also claim a same-name entry you already configured +forge integrations remove # reverse the add — deletes only forge-owned entries +``` + +### `add` 会写入什么 + +`add --yes` 会从同一份规范化的 spec 里把该服务器写入每个工具原生的 MCP 配置: + +- `.mcp.json`(Claude Code) +- `.cursor/mcp.json`(Cursor) +- `.gemini/settings.json`(Gemini) +- `.codex/config.toml` —— 作为一个 `# forge:managed:` 块,通过逐字节比较刷新 +- `.continue/mcpServers/.yaml` —— 每个被管理的服务器一个 forge 标记过的 YAML +- 以及 Forge 生成配置的其他工具 + +已安装的集合会记录在 `.forge/forge.config.json` 的 `mcp.integrations` 下,因此后续每次 `forge sync` 都会重新生成同样的服务器。stop-hook 的自动同步会对整个配置文件做逐字节比较,所以对该文件的手工编辑会被检测出来并修复。 + +### `--adopt` 的语义 + +如果某个工具的配置文件里已经存在同名服务器、而不是 Forge 放进去的,`add` **不会覆盖它**。它会报告该文件,并附上 `--adopt` 提示。加上 `--adopt` 重新运行以认领所有权 —— Forge 会把该条目记录在 `.forge/forge.config.json` 的 `mcp.adopted` 下,并从此接管它。 + +当你之前手工配置过某个服务器,现在想让 Forge 在每个工具间保持它同步时,就使用 `--adopt`。 + +### `remove` + +`forge integrations remove ` 是对 add 的反向操作。它只删除 forge 拥有的条目、块和文件 —— 用户自己配置过、且从未 `--adopt` 过的同名服务器不会被动。运行两次 `remove` 是无操作的。 + +```bash +forge integrations remove context7 +``` + +### `.forge/forge.config.json` + +单仓库的 Forge 状态 —— 同时也保存 `primaryTool`、`tools` 和 `profile` 的统一配置 —— 在两个键下记录选择性接入的集成: + +```json +{ + "mcp": { + "integrations": ["context7"], + "adopted": [] + } +} +``` + +未知的键会在写入时被原样保留。格式错误的文件不会被静默丢弃:读取时每个进程会在 stderr 上警告一次,写入方会拒绝覆盖一份无法解析的配置,而不是把它替换成默认值。 diff --git a/mintlify/zh-CN/introduction.mdx b/mintlify/zh-CN/introduction.mdx index 739bfa8..72d5163 100644 --- a/mintlify/zh-CN/introduction.mdx +++ b/mintlify/zh-CN/introduction.mdx @@ -1,5 +1,5 @@ --- -title: "简介" +title: "Forge:面向 AI 编码代理的认知基座" description: "Forge 是每个无状态模型都缺失的认知基座 —— 记忆、前瞻与护栏 —— 以原生配置的形式交付给每一个 AI 编码代理。" --- @@ -63,6 +63,8 @@ Forge 为**九个工具**生成配置,并提供一个用于 Roo Code 与 VS Code Claude Code、Codex、Cursor、Gemini、Aider、Copilot、Windsurf/Devin、Zed 和 Continue。 每一个都从自己的原生文件读取同样的规则。 +默认接线的 MCP 服务器只有 Forge 自己的那一个(`src/cortex_mcp.js`)—— 用于基座检查和记忆读取。诸如 `context7` 之类的第三方 MCP 服务器是**选择性接入**的,在你运行 [`forge integrations add --yes`](/cli/config#forge-integrations) 之前,不会有任何东西落到磁盘上。 + ## 诚实的边界 Forge 到处标明自己的天花板。 diff --git a/mintlify/zh-Hans/cli/config.mdx b/mintlify/zh-Hans/cli/config.mdx index 3e3d3ce..2aab63a 100644 --- a/mintlify/zh-Hans/cli/config.mdx +++ b/mintlify/zh-Hans/cli/config.mdx @@ -1,6 +1,6 @@ --- title: "Config 命令" -description: "提供方、成本、仪表盘、品牌、atlas、stack:config、cost、dash、brand、atlas、stack——外加 v0.19+ 的 report 与 tools 命令。" +description: "提供方、成本、仪表盘、品牌、atlas、stack 与可选 MCP 集成:config、cost、dash、brand、atlas、stack、report、tools、integrations。" --- Config 分组覆盖提供方、可观察性、代码图和技术栈检测。 @@ -84,3 +84,59 @@ forge report ```bash forge tools ``` + +## `forge integrations` + +按需接入的第三方 MCP 服务器(例如 `context7`),在 Forge 生成配置的每一个工具上以非破坏的方式统一管理——Claude Code、Codex、Cursor、Gemini、Continue,以及其余全部。 + +第三方 MCP 服务器**不会**默认安装。在你运行 `forge integrations add --yes` 之前,任何东西都不会落到磁盘上。 + +```bash +forge integrations # list opt-in servers with package + purpose +forge integrations add # dry-run: prints package, network, files it would touch +forge integrations add --yes # apply — write MCP config for every tool +forge integrations add --yes --adopt # also claim a same-name entry you already configured +forge integrations remove # reverse the add — deletes only forge-owned entries +``` + +### `add` 会写入什么 + +`add --yes` 会依据同一份规范化描述,把服务器写入每个工具的原生 MCP 配置: + +- `.mcp.json`(Claude Code) +- `.cursor/mcp.json`(Cursor) +- `.gemini/settings.json`(Gemini) +- `.codex/config.toml`——作为一个 `# forge:managed:` 块,通过逐字节比对刷新 +- `.continue/mcpServers/.yaml`——每个受管服务器一份带 forge 标记的 YAML +- 以及 Forge 生成配置的其余工具 + +已安装集合会记录在 `.forge/forge.config.json` 的 `mcp.integrations` 下,因此之后每次 `forge sync` 都会重新生成同一批服务器。stop-hook 的自动同步会对整份配置文件进行逐字节比对,所以对该文件的手工改动会被检测出来并被修复。 + +### `--adopt` 语义 + +如果某个同名服务器已经存在于某个工具的配置文件里,且不是 Forge 放进去的,`add` **不会覆盖它**。它会报告该文件并附上 `--adopt` 提示。带 `--adopt` 重新运行即可接管所有权——Forge 会把该条目记录在 `.forge/forge.config.json` 的 `mcp.adopted` 下,并从此开始管理它。 + +当你此前手工配置过某个服务器,现在希望 Forge 帮你在所有工具间保持一致时,就用 `--adopt`。 + +### `remove` + +`forge integrations remove ` 会撤销一次 add。它只删除 forge 拥有的条目、块和文件——由用户配置且从未 `--adopt` 过的同名服务器会被保留原样。连续运行两次 `remove` 是无操作。 + +```bash +forge integrations remove context7 +``` + +### `.forge/forge.config.json` + +每个仓库的 Forge 状态——这份统一配置同时保存 `primaryTool`、`tools` 和 `profile`——会在两个键下记录按需接入的集成: + +```json +{ + "mcp": { + "integrations": ["context7"], + "adopted": [] + } +} +``` + +未知键在写入时会原样往返保留。格式有误的文件不会被静默丢弃:读取时每个进程会在 stderr 上告警一次,写入方会拒绝覆盖一个无法解析的配置,而不是用默认值把它替换掉。 diff --git a/mintlify/zh-Hans/introduction.mdx b/mintlify/zh-Hans/introduction.mdx index 7f84f63..8882ce6 100644 --- a/mintlify/zh-Hans/introduction.mdx +++ b/mintlify/zh-Hans/introduction.mdx @@ -1,5 +1,5 @@ --- -title: "简介" +title: "Forge:面向 AI 编码代理的认知基座" description: "Forge 是每个无状态模型都缺少的认知基座——记忆、预见与护栏——以原生配置形式交付给每一个 AI 编码代理。" --- @@ -67,6 +67,8 @@ Forge 为**九个工具**生成配置,另外为 Roo Code 和 VS Code 提供一 Claude Code、Codex、Cursor、Gemini、Aider、Copilot、Windsurf/Devin、Zed 和 Continue。 每个工具都从各自的原生文件里读取同一份规则。 +默认接线的 MCP 服务器只有 Forge 自己的那一台(`src/cortex_mcp.js`)——负责基座检查与记忆读取。诸如 `context7` 之类的第三方 MCP 服务器均为**按需接入**,在你运行 [`forge integrations add --yes`](/cli/config#forge-integrations) 之前都不会落到磁盘上。 + ## 诚实的边界 Forge 到处都会声明自己的上限。