@bastani/atomic 0.10.14-alpha.1 → 0.10.15-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/_shared/dist-KOELCESV.js +2 -2
  3. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  4. package/dist/_shared/lib-4PES5P4V.js +2 -2
  5. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +3 -3
  6. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +3 -3
  7. package/dist/_shared/mode-shared-2QJSCUM6.js +3 -3
  8. package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
  9. package/dist/_shared/runtime-O4KCSG4C.js +2 -2
  10. package/dist/_shared/{sdk-B5LEWGGI.js → sdk-OHKMDJ74.js} +27 -5
  11. package/dist/_shared/{sdk-B5LEWGGI.js.map → sdk-OHKMDJ74.js.map} +1 -1
  12. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  13. package/dist/_shared/startup-0-0-Q3MWKUK4.js +2 -2
  14. package/dist/_shared/startup-0-1-M6OWAYHH.js +2 -2
  15. package/dist/_shared/{startup-0-2-5QHPCEON.js → startup-0-2-2HUMCPKX.js} +14 -16
  16. package/dist/_shared/startup-0-2-2HUMCPKX.js.map +1 -0
  17. package/dist/_shared/startup-0-3-4ZYBYQNM.js +3 -3
  18. package/dist/_shared/startup-0-4-ZMJV547D.js +3 -3
  19. package/dist/_shared/startup-0-5-YDW47QX6.js +3 -3
  20. package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
  21. package/dist/_shared/startup-14-0-MLX36RBG.js +1 -1
  22. package/dist/_shared/startup-15-0-YUKGAC63.js +1 -1
  23. package/dist/_shared/startup-15-1-4S7FLMNG.js +6 -30
  24. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  25. package/dist/_shared/startup-8-0-34CBHPZH.js +3 -3
  26. package/dist/_shared/startup-8-1-LZFXSD3Z.js +3 -3
  27. package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
  28. package/dist/_shared/storage-status-K7PX2RXA.js +3 -3
  29. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  30. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  31. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  32. package/dist/builtin/intercom/package.json +1 -1
  33. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  34. package/dist/builtin/mcp/package.json +1 -1
  35. package/dist/builtin/subagents/package.json +1 -1
  36. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
  37. package/dist/builtin/web-access/index.bundle.mjs +1 -1
  38. package/dist/builtin/web-access/package.json +1 -1
  39. package/dist/cli/auth-cli.code.js +1 -1
  40. package/dist/cli/auth-cli.impl.js +3 -3
  41. package/dist/cli/auth-cli.js +3 -3
  42. package/dist/cli/blueprint-command.impl.js +3 -3
  43. package/dist/cli/blueprint-command.js +3 -3
  44. package/dist/cli/intercom-command.code.js +3 -3
  45. package/dist/cli/intercom-command.impl.js +3 -3
  46. package/dist/cli/intercom-command.js +3 -3
  47. package/dist/cli/list-models.impl.js +3 -3
  48. package/dist/cli/list-models.js +3 -3
  49. package/dist/cli/session-picker.code.js +1 -1
  50. package/dist/cli/session-picker.impl.js +3 -3
  51. package/dist/cli/session-picker.js +3 -3
  52. package/dist/cli/startup-ui.code.js +1 -1
  53. package/dist/cli/startup-ui.impl.js +3 -3
  54. package/dist/cli/startup-ui.js +3 -3
  55. package/dist/cli/storage-command.impl.js +3 -3
  56. package/dist/cli/storage-command.js +3 -3
  57. package/dist/cli/storage-search-session.code.js +1 -1
  58. package/dist/cli/storage-search-session.impl.js +3 -3
  59. package/dist/cli/storage-search-session.js +3 -3
  60. package/dist/cli/team-command.code.js +1 -1
  61. package/dist/cli/team-command.impl.js +3 -3
  62. package/dist/cli/team-command.js +3 -3
  63. package/dist/cli.js +2 -2
  64. package/dist/core/compaction/compactor.d.ts +0 -8
  65. package/dist/core/debug.impl.js +3 -3
  66. package/dist/core/debug.js +3 -3
  67. package/dist/core/export-html/card-projection.impl.js +3 -3
  68. package/dist/core/export-html/card-projection.js +3 -3
  69. package/dist/core/export-html/index.code.js +2 -2
  70. package/dist/core/export-html/index.impl.js +3 -3
  71. package/dist/core/export-html/index.js +3 -3
  72. package/dist/core/export-html/json-spans.impl.js +3 -3
  73. package/dist/core/export-html/json-spans.js +3 -3
  74. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  75. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  76. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  77. package/dist/core/export-html/tool-renderer.js +3 -3
  78. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  79. package/dist/core/extensions/jiti-loader.js +3 -3
  80. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  81. package/dist/core/extensions/jiti-static-loader.js +3 -3
  82. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  83. package/dist/core/extensions/loader-host-modules.js +3 -3
  84. package/dist/core/intercom-broker-control-host.code.js +1 -1
  85. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  86. package/dist/core/intercom-broker-control-host.js +3 -3
  87. package/dist/core/intercom-broker-control.code.js +2 -2
  88. package/dist/core/intercom-broker-control.impl.js +3 -3
  89. package/dist/core/intercom-broker-control.js +3 -3
  90. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  91. package/dist/core/package-manager-storage-adapters.js +3 -3
  92. package/dist/core/sdk.code.js +1 -1
  93. package/dist/core/sdk.impl.js +3 -3
  94. package/dist/core/sdk.js +3 -3
  95. package/dist/core/session-manager-core.js +3 -3
  96. package/dist/core/session-manager-list.impl.js +3 -3
  97. package/dist/core/session-manager-list.js +3 -3
  98. package/dist/core/session-manager.impl.js +3 -3
  99. package/dist/core/session-manager.js +3 -3
  100. package/dist/core/session-storage.impl.js +3 -3
  101. package/dist/core/session-storage.js +3 -3
  102. package/dist/core/storage/index.js +2 -2
  103. package/dist/core/storage/node-sqlite-thread.js +2 -2
  104. package/dist/core/storage/node-sqlite.js +2 -2
  105. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  106. package/dist/core/storage/offline-snapshot-file.js +3 -3
  107. package/dist/core/storage/provider.js +2 -2
  108. package/dist/core/storage/selection.js +2 -2
  109. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  110. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  111. package/dist/core/storage/session/branch-fork-source.js +3 -3
  112. package/dist/core/storage/session/card-view.impl.js +3 -3
  113. package/dist/core/storage/session/card-view.js +3 -3
  114. package/dist/core/storage/session/child-reader.code.js +2 -2
  115. package/dist/core/storage/session/child-reader.impl.js +3 -3
  116. package/dist/core/storage/session/child-reader.js +3 -3
  117. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  118. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  119. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  120. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  121. package/dist/core/storage/session/expanded-child-details.js +3 -3
  122. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  123. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  124. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  125. package/dist/core/storage/session/fork-row-index.js +3 -3
  126. package/dist/core/storage/session/fork-staging.code.js +1 -1
  127. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  128. package/dist/core/storage/session/fork-staging.js +3 -3
  129. package/dist/core/storage/session/fork-window.code.js +2 -2
  130. package/dist/core/storage/session/fork-window.impl.js +3 -3
  131. package/dist/core/storage/session/fork-window.js +3 -3
  132. package/dist/core/storage/session/history-pages.impl.js +3 -3
  133. package/dist/core/storage/session/history-pages.js +3 -3
  134. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  135. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  136. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  137. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  138. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  139. package/dist/core/storage/session/memory-session-store.js +3 -3
  140. package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
  141. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  142. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  143. package/dist/core/storage/session/released-history-files.code.js +1 -1
  144. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  145. package/dist/core/storage/session/released-history-files.js +3 -3
  146. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  147. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  148. package/dist/core/storage/session/session-resume.impl.js +3 -3
  149. package/dist/core/storage/session/session-resume.js +3 -3
  150. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  151. package/dist/core/storage/session/snapshot-cut.js +3 -3
  152. package/dist/core/storage/session/snapshot-history.code.js +2 -2
  153. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  154. package/dist/core/storage/session/snapshot-history.js +3 -3
  155. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  156. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  157. package/dist/core/storage/session/sql-session-store.js +3 -3
  158. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  159. package/dist/core/storage/session/tree-outline.js +3 -3
  160. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  161. package/dist/core/storage/session/tree-presentation.js +3 -3
  162. package/dist/core/storage/storage-status.impl.js +3 -3
  163. package/dist/core/storage/storage-status.js +3 -3
  164. package/dist/core/storage/team.impl.js +3 -3
  165. package/dist/core/storage/team.js +3 -3
  166. package/dist/core/structured-output/index.code.js +1 -1
  167. package/dist/core/structured-output/index.impl.js +3 -3
  168. package/dist/core/structured-output/index.js +3 -3
  169. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  170. package/dist/core/tasks/task-completion-entry.js +3 -3
  171. package/dist/core/tasks/task-file-history.code.js +2 -2
  172. package/dist/core/tasks/task-file-history.impl.js +3 -3
  173. package/dist/core/tasks/task-file-history.js +3 -3
  174. package/dist/core/tasks/task-reference-archive.code.js +2 -2
  175. package/dist/core/tasks/task-reference-archive.js +3 -3
  176. package/dist/core/tasks/task-reference-identity.js +3 -3
  177. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  178. package/dist/core/tasks/task-reference-stream.js +3 -3
  179. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  180. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  181. package/dist/core/tasks/task-view-source.impl.js +3 -3
  182. package/dist/core/tasks/task-view-source.js +3 -3
  183. package/dist/core/tools/read-url.impl.js +3 -3
  184. package/dist/core/tools/read-url.js +3 -3
  185. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  186. package/dist/core/worktree-snapshot/errors.code.js +1 -1
  187. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  188. package/dist/core/worktree-snapshot/errors.js +3 -3
  189. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  190. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  191. package/dist/extensions/codemode/execute.impl.js +3 -3
  192. package/dist/extensions/codemode/execute.js +3 -3
  193. package/dist/extensions/codemode/renderer.impl.js +3 -3
  194. package/dist/extensions/codemode/renderer.js +3 -3
  195. package/dist/extensions/mcp/cli.code.js +1 -1
  196. package/dist/extensions/mcp/cli.impl.js +3 -3
  197. package/dist/extensions/mcp/cli.js +3 -3
  198. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  199. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  200. package/dist/extensions/mcp/cli.lazy.js +3 -3
  201. package/dist/extensions/mcp/runtime.code.js +1 -1
  202. package/dist/extensions/mcp/runtime.impl.js +3 -3
  203. package/dist/extensions/mcp/runtime.js +3 -3
  204. package/dist/index.d.ts +21 -1
  205. package/dist/index.js +2 -2
  206. package/dist/main-first-time-setup.code.js +1 -1
  207. package/dist/main-first-time-setup.impl.js +3 -3
  208. package/dist/main-first-time-setup.js +3 -3
  209. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  210. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  211. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  212. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  213. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  214. package/dist/modes/print-mode.js +1 -1
  215. package/dist/package-manager-cli.code.js +2 -2
  216. package/dist/package-manager-cli.impl.js +3 -3
  217. package/dist/package-manager-cli.js +3 -3
  218. package/dist/startup-files.json +1 -1
  219. package/dist/startup-stages/6.js +1 -1
  220. package/dist/utils/startup-database-spare.code.js +1 -1
  221. package/dist/utils/startup-database-spare.impl.js +3 -3
  222. package/dist/utils/startup-database-spare.js +3 -3
  223. package/dist/utils/tools-manager.impl.js +3 -3
  224. package/dist/utils/tools-manager.js +3 -3
  225. package/docs/background-tasks/reference.md +182 -0
  226. package/docs/background-tasks.md +98 -405
  227. package/docs/build.md +67 -27
  228. package/docs/changelog.mdx +9 -0
  229. package/docs/codemode.md +108 -39
  230. package/docs/compaction/branch-summaries.md +54 -0
  231. package/docs/compaction/custom-compactors.md +161 -0
  232. package/docs/compaction/memory-compaction.md +77 -0
  233. package/docs/compaction/reference.md +86 -38
  234. package/docs/compaction.md +51 -252
  235. package/docs/computer-use.md +169 -321
  236. package/docs/containerization.md +71 -57
  237. package/docs/custom-provider/api-reference.md +119 -25
  238. package/docs/custom-provider/oauth.md +114 -132
  239. package/docs/custom-provider/override.md +37 -27
  240. package/docs/custom-provider/registration.md +107 -83
  241. package/docs/custom-provider/streaming.md +85 -71
  242. package/docs/custom-provider.md +85 -52
  243. package/docs/development.md +39 -29
  244. package/docs/docs.json +76 -63
  245. package/docs/environment-variables.md +94 -44
  246. package/docs/extensions/api-reference.md +86 -43
  247. package/docs/extensions/authoring.md +162 -154
  248. package/docs/extensions/events.md +80 -25
  249. package/docs/extensions/examples.md +90 -85
  250. package/docs/extensions/ui.md +206 -82
  251. package/docs/extensions.md +79 -108
  252. package/docs/getting-started/authentication.md +67 -36
  253. package/docs/getting-started/first-session.md +53 -43
  254. package/docs/getting-started/installation.md +116 -89
  255. package/docs/getting-started/project-instructions.md +48 -34
  256. package/docs/guides/configuration.md +82 -20
  257. package/docs/guides/non-interactive.md +66 -24
  258. package/docs/guides/resume-on-any-machine.md +135 -82
  259. package/docs/guides/team-setup.md +114 -105
  260. package/docs/guides.md +76 -32
  261. package/docs/herdr.md +15 -16
  262. package/docs/how-atomic-works.md +140 -0
  263. package/docs/index.md +58 -44
  264. package/docs/intercom/operations.md +141 -151
  265. package/docs/intercom/reference.md +85 -108
  266. package/docs/intercom.md +84 -145
  267. package/docs/json.md +120 -67
  268. package/docs/keybindings.md +85 -49
  269. package/docs/libraries/agent-core.md +137 -275
  270. package/docs/libraries/ai.md +100 -84
  271. package/docs/libraries/codemode.md +210 -300
  272. package/docs/libraries/schema.md +59 -53
  273. package/docs/libraries/storage-postgres.md +49 -35
  274. package/docs/libraries/telemetry.md +153 -354
  275. package/docs/libraries/tui.md +265 -393
  276. package/docs/libraries.md +42 -26
  277. package/docs/llama-cpp.md +171 -161
  278. package/docs/mcp-servers.md +90 -51
  279. package/docs/models/choose-a-model.md +188 -0
  280. package/docs/models/reference.md +74 -30
  281. package/docs/models.md +153 -88
  282. package/docs/orchestration/migrating-workflows.md +23 -16
  283. package/docs/orchestration/patterns.md +39 -44
  284. package/docs/orchestration.md +65 -26
  285. package/docs/packages/authoring.md +51 -29
  286. package/docs/packages/reference.md +42 -21
  287. package/docs/packages.md +69 -58
  288. package/docs/programmatic.md +118 -24
  289. package/docs/prompt-templates.md +84 -83
  290. package/docs/providers/reference.md +43 -48
  291. package/docs/providers.md +219 -451
  292. package/docs/quickstart.md +140 -120
  293. package/docs/reference/cli.md +135 -97
  294. package/docs/reference.md +20 -18
  295. package/docs/rpc/examples.md +76 -20
  296. package/docs/rpc/extension-ui.md +64 -38
  297. package/docs/rpc/protocol.md +361 -110
  298. package/docs/rpc.md +57 -17
  299. package/docs/sdk/reference.md +409 -534
  300. package/docs/sdk/storage.md +53 -13
  301. package/docs/sdk/structured-decisions.md +82 -56
  302. package/docs/sdk/web-server.md +57 -43
  303. package/docs/sdk.md +106 -84
  304. package/docs/security.md +42 -64
  305. package/docs/session-format.md +62 -38
  306. package/docs/sessions.md +99 -214
  307. package/docs/settings.md +165 -195
  308. package/docs/shell-aliases.md +9 -6
  309. package/docs/skills/authoring.md +69 -48
  310. package/docs/skills/reference.md +51 -20
  311. package/docs/skills.md +99 -148
  312. package/docs/slash-commands.md +129 -0
  313. package/docs/storage/custom-adapters.md +160 -85
  314. package/docs/storage/jsonl.md +81 -66
  315. package/docs/storage/postgres/pgbouncer.md +120 -126
  316. package/docs/storage/postgres/tuning.md +120 -143
  317. package/docs/storage/postgres.md +314 -330
  318. package/docs/storage/sqlite.md +71 -42
  319. package/docs/storage.md +298 -302
  320. package/docs/subagents/authoring.md +55 -38
  321. package/docs/subagents/reference.md +73 -33
  322. package/docs/subagents.md +119 -187
  323. package/docs/terminal-setup.md +50 -38
  324. package/docs/termux.md +67 -41
  325. package/docs/themes/reference.md +23 -19
  326. package/docs/themes.md +142 -127
  327. package/docs/tmux.md +47 -55
  328. package/docs/tools.md +147 -109
  329. package/docs/tui/reference.md +166 -214
  330. package/docs/tui.md +196 -341
  331. package/docs/usage.md +118 -138
  332. package/docs/verification.md +79 -51
  333. package/docs/web-access.md +121 -101
  334. package/docs/windows.md +26 -27
  335. package/docs/worktree-snapshots/reference.md +245 -0
  336. package/docs/worktree-snapshots.md +71 -259
  337. package/package.json +8 -8
  338. package/dist/_shared/startup-0-2-5QHPCEON.js.map +0 -1
  339. package/docs/guides/intercom.md +0 -32
  340. package/docs/guides/orchestration.md +0 -28
  341. package/docs/guides/subagents.md +0 -37
@@ -4,7 +4,7 @@ sidebarTitle: "MCP servers"
4
4
  description: "Configure stdio and streamable HTTP MCP servers, control tool exposure, read resources, and authenticate with OAuth or provider logins."
5
5
  ---
6
6
 
7
- Atomic includes built-in [Model Context Protocol](https://modelcontextprotocol.io) support in both npm and standalone binary installations. It connects to MCP servers over stdio or streamable HTTP with no separate extension install required.
7
+ Atomic includes built-in [Model Context Protocol](https://modelcontextprotocol.io) support in both npm and standalone binary installations. Connect to MCP servers over stdio or streamable HTTP with no separate extension install.
8
8
 
9
9
  ## Quick setup
10
10
 
@@ -22,15 +22,21 @@ Add a remote streamable HTTP server:
22
22
  atomic mcp add docs --url https://example.com/mcp --bearer-token-env-var DOCS_TOKEN
23
23
  ```
24
24
 
25
- CLI commands write user-level configuration by default. Pass `--local` or `-l` to write `.atomic/mcp.json` in the current project instead, then start Atomic and grant project trust before using project servers.
25
+ CLI commands write user-level configuration by default. Pass `--local` or `-l` to write `.atomic/mcp.json` in the current project instead, then start Atomic and grant [project trust](/security) before using project servers.
26
26
 
27
- Run `/mcp` inside Atomic to inspect connections and manage servers. After editing configuration outside a session, run `/reload` or restart Atomic.
27
+ Run `/mcp` inside Atomic to inspect connections and manage servers. After editing configuration files outside a session, run `/reload` or restart Atomic.
28
28
 
29
29
  ## Configure servers
30
30
 
31
31
  Atomic reads user-level servers from `~/.atomic/agent/mcp.json` (relocated by `ATOMIC_CODING_AGENT_DIR`) and project servers from `.atomic/mcp.json`. Project configuration loads only after [project trust](/security) is granted. Both files use a top-level `mcpServers` object. Keep personal servers and credentials in the user-level file.
32
32
 
33
- A full project entry replaces a user-level entry with the exact same key name. A project entry without `command`, `url`, or `type` acts as a lightweight override that can set **only** `enabled`, `exposure`, and `toolExposure` on a user-level server with the exact same key name while keeping the rest (`env`, `headers`, `auth`, and `oauth`). Adding any other field (such as `timeout` or `description`) or referencing a server not present in user-level `mcp.json` reports a configuration error and skips the entry.
33
+ ### Server names and overrides
34
+
35
+ Server names may contain letters, digits, `_`, and `-` (avoid reserved JavaScript property names such as `__proto__`, `constructor`, and `prototype`, which `/mcp` rejects when updating settings). Names that differ only in `-` versus `_` share the same tool namespace, while project overrides look up user-level servers by **exact key name**:
36
+
37
+ - A full project entry replaces a user-level entry with the exact same key name.
38
+ - A project entry without `command`, `url`, or `type` acts as a lightweight override that can set **only** `enabled`, `exposure`, and `toolExposure` on a user-level server with the exact same key name while keeping the rest (`env`, `headers`, `auth`, and `oauth`). Adding any other field (such as `timeout` or `description`) or referencing a server absent from user-level `mcp.json` reports a configuration error and skips the entry.
39
+ - If user-level config defines `my-server`, a project entry named `my_server` does not match as an override and is rejected as a namespace conflict if defined as a full server. Invalid entries are reported and skipped without blocking other servers.
34
40
 
35
41
  For example, to turn off a user-level server in one project:
36
42
 
@@ -42,11 +48,13 @@ For example, to turn off a user-level server in one project:
42
48
  }
43
49
  ```
44
50
 
45
- **Server names and namespace collisions.** Server names may contain letters, digits, `_`, and `-`. Reserved JavaScript property names (`__proto__`, `constructor`, and `prototype`) are rejected. Names that differ only in `-` versus `_` share the same tool namespace, while project overrides look up user-level servers by exact key name. If user-level config defines `my-server`, a project entry named `my_server` does not match as an override and is rejected as a namespace conflict if defined as a full server. Always use the exact same key name to override or replace a user-level server. Invalid entries are reported and skipped without blocking other servers.
51
+ ### Stdio servers
46
52
 
47
- **Stdio servers.** Configure `command`, `args`, `env`, and `cwd`. `command` must be one executable, not a shell command string. A `command` with a path runs as written; a bare command name is searched in the absolute directories on `PATH` from `env` (and on Windows first in `cwd` when `cwd` is outside the project folder; the project folder counts only if `PATH` lists it). On Windows, variables in `env` (such as `PATH`) replace inherited variables case-insensitively both when locating `command` and inside the spawned server. A missing executable fails with `spawn <command> ENOENT`. Relative `cwd` values resolve against the session directory.
53
+ Configure `command`, `args`, `env`, and `cwd`. `command` must be one executable, not a shell command string. A `command` with a path runs as written; a bare command name is searched in the absolute directories on `PATH` from `env` (and on Windows first in `cwd` when `cwd` is outside the project folder; the project folder counts only if `PATH` lists it). On Windows, variables in `env` (such as `PATH`) replace inherited variables case-insensitively both when locating `command` and inside the spawned server. A missing executable fails with `spawn <command> ENOENT`. Relative `cwd` values resolve against the session directory.
48
54
 
49
- **Streamable HTTP servers.** Configure `url`, optional `headers`, and optional `oauth` or `auth`:
55
+ ### Streamable HTTP servers
56
+
57
+ Configure `url`, optional `headers`, and optional `oauth` or `auth`:
50
58
 
51
59
  ```json
52
60
  {
@@ -60,22 +68,28 @@ For example, to turn off a user-level server in one project:
60
68
  }
61
69
  ```
62
70
 
63
- **Variable, command, and home-directory expansion.** Interpolation rules differ by field:
71
+ ### Variable and command expansion
72
+
73
+ Interpolation rules differ by field:
64
74
 
65
75
  | Fields | Supported syntax | Escaping and caveats |
66
76
  | --- | --- | --- |
67
77
  | `url` | `${NAME}`, `$env:NAME` | Resolved in memory before URL validation without rewriting config files. Does **not** support unbraced `$NAME`, `!command`, or `$$` escaping. |
68
- | `env`, `headers`, `oauth.clientSecret` | `${NAME}`, unbraced `$NAME`, whole-value `!command` (such as `"!echo Bearer $(gh auth token)"`) | **Escape literal `$` as `$$` and literal leading `!` as `$!`.** Because unbraced `$NAME` is interpolated automatically, secrets containing `$word` expand or fail unless escaped as `$$word`. Only use `!command` in configuration you trust. On failure, Atomic never echoes `!command` text; `${NAME}` reports the unset variable name, while unbraced `$NAME` reports the name only when it looks like a POSIX variable name so literal secret fragments do not leak. |
78
+ | `env`, `headers`, `oauth.clientSecret` | `${NAME}`, unbraced `$NAME`, whole-value `!command` (such as `"!echo Bearer $(gh auth token)"`) | **Escape literal `$` as `$$` and literal leading `!` as `$!`.** Because unbraced `$NAME` interpolates automatically, secrets containing `$word` expand or fail unless escaped as `$$word`. On failure, Atomic never echoes `!command` text; `${NAME}` reports the unset variable name, while unbraced `$NAME` reports the name only when it looks like a POSIX variable name so literal secret fragments do not leak. |
69
79
  | `command`, `args`, `cwd` | Leading `~`, `~/`, and (on Windows) `~\` | Expands to your home directory. Does not interpolate environment variables or `!command`. |
70
80
  | `oauth.clientId`, `oauth.scope`, `oauth.callbackUrl`, `oauth.authServerMetadataUrl` | Literal strings only | No environment variable, `!command`, or `~` expansion. |
71
81
 
72
- **Fields shared by both transports:**
82
+ <Warning>
83
+ Only use `!command` in MCP configuration you trust. Each `!command` runs uncached on every connect or refresh with a **10-second timeout**, a **1 MiB stdout cap**, and stderr discarded.
84
+ </Warning>
85
+
86
+ ### Shared transport fields
73
87
 
74
88
  - `timeout`: per-request inactivity timeout in seconds (default `60`). Server progress notifications reset this timer; it is not a total execution deadline.
75
89
  - `enabled: false`: keep a server configured without connecting to it.
76
90
  - `exposure` and `toolExposure`: control how tools reach the model.
77
91
  - `description`: a short summary for the model's system prompt, tool search, and `describeNamespace()`. If omitted, Atomic uses the first line of the server's instructions once connected.
78
- - `type`: optional (`command` selects stdio and `url` selects streamable HTTP). When present, must be `stdio`, `http`, or `streamable-http`. SSE endpoints are not supported; point to the server's streamable HTTP endpoint (typically `/mcp` rather than `/sse`).
92
+ - `type`: optional (`command` selects stdio and `url` selects streamable HTTP). When present, must be `stdio`, `http`, or `streamable-http`. Legacy SSE endpoints are not supported; point to the server's streamable HTTP endpoint (typically `/mcp` rather than `/sse`).
79
93
 
80
94
  ### Servers from packages and extensions
81
95
 
@@ -87,7 +101,7 @@ Installed [packages](/packages/authoring#mcp-servers) and [extensions](/extensio
87
101
 
88
102
  Run `/mcp` to open the interactive server manager showing connection state, tool count, exposure, and source, even while startup connections are still pending.
89
103
 
90
- Select a server to inspect tools and details, sign in or out, reconnect, enable or disable it, or change exposure. Servers needing attention appear first. Enable, disable, and reconnect run in the background while the manager updates live, so you can keep navigating or close it. Use `↑` and `↓` to select, `Enter` to open, `Esc` to go back, and type to filter lists longer than one screen.
104
+ Select a server to inspect tools and details, sign in or out, reconnect, enable or disable it, or change exposure (the `/mcp` exposure picker offers `codemode`, `deferred`, and `direct`; set `hidden` in `mcp.json`). Servers needing attention appear first. Enable, disable, and reconnect run in the background while the manager updates live. Use `↑` and `↓` to select, `Enter` to open, `Esc` to go back, and type to filter long lists.
91
105
 
92
106
  | Command | Action |
93
107
  | --- | --- |
@@ -98,9 +112,11 @@ Select a server to inspect tools and details, sign in or out, reconnect, enable
98
112
 
99
113
  Tab completion suggests subcommands and eligible server names. When you omit a server name, Atomic selects the only eligible server automatically or prompts you to choose. `/mcp login` requires an interactive UI; run `atomic mcp login` in your shell before unattended runs.
100
114
 
101
- Enabled servers connect in the background at startup. The first prompt waits up to 10 seconds for servers with `direct` tools, while codemode, `tool_search`, and resource calls wait for the servers they need. Dropped connections reconnect on the next call, and server-announced tool list changes apply automatically.
115
+ ### Connection lifecycle, retries, and resume
102
116
 
103
- When you resume a session, its previously used MCP tools remain available and keep their summaries while servers reconnect, as long as the server stays defined in the same scope with the same command and `cwd` (or the same URL scheme, host, port, and path; argument and query changes do not invalidate it). Calls wait for reconnect and run only if the tool still exists. Tools from servers that fail to reconnect, require sign-in, or removed them update on the next turn.
117
+ - **Background startup.** Enabled servers connect in the background at startup. The first prompt waits up to 10 seconds for servers with `direct` tools, while codemode, `tool_search`, and resource calls wait for the servers they need.
118
+ - **Automatic retries and session recovery.** Streamable HTTP connections automatically retry transient failures (`408`, `429`, `5xx` except `501`, network errors, and transient OAuth failures) twice after 250 ms and 1,000 ms. Read-only resource calls retry once after 250 ms; tool calls are never retried automatically. Dropped connections reconnect on the next call, expired HTTP sessions re-initialize once automatically, and server-announced tool list changes apply automatically.
119
+ - **Session resume.** Previously used MCP tools stay available and keep their summaries while servers reconnect, as long as the server stays defined in the same scope with the same command and `cwd` (or the same URL scheme, host, port, and path; argument and query changes do not invalidate it). Calls wait for reconnect and run only if the tool still exists. Tools from servers that fail to reconnect, require sign-in, or removed them update on the next turn.
104
120
 
105
121
  ### Shell commands
106
122
 
@@ -117,9 +133,9 @@ atomic mcp logout <server> [-l]
117
133
 
118
134
  `add` replaces an existing entry with the same name. `add` and `remove` accept `--local` (`-l`) to write `.atomic/mcp.json`; `login` and `logout` accept `-l` to require a project-defined server (otherwise they search both files).
119
135
 
120
- For stdio servers, pass repeatable `--env KEY=VALUE` and `--cwd`. For HTTP servers, pass repeatable `--header KEY=VALUE`, `--bearer-token-env-var NAME`, and `--oauth-client-id`, `--oauth-client-secret`, `--oauth-callback-port`, or `--oauth-client-name`. Both transports accept `--exposure` and `--description`. Advanced options without CLI flags (`timeout`, `enabled`, `auth.provider`, `oauth.callbackUrl`, `oauth.scope`, and `oauth.authServerMetadataUrl`) can be edited directly in `mcp.json`. Passing `--help` or `-h` after `--` (for example `atomic mcp add srv -- cmd --help`) or as a flag value passes through instead of printing MCP help. Run `atomic mcp --help` for full usage.
136
+ For stdio servers, pass repeatable `--env KEY=VALUE` and `--cwd`. For HTTP servers, pass repeatable `--header KEY=VALUE`, `--bearer-token-env-var NAME`, and `--oauth-client-id`, `--oauth-client-secret`, `--oauth-callback-port`, or `--oauth-client-name`. Both transports accept `--exposure` and `--description`. Advanced options without CLI flags (`timeout`, `enabled`, `toolExposure`, `autoEnableCodemode`, `auth.provider`, `oauth.callbackUrl`, `oauth.scope`, and `oauth.authServerMetadataUrl`) can be edited directly in `mcp.json`. Passing `--help` or `-h` after `--` (for example `atomic mcp add srv -- cmd --help`) or as a flag value passes through instead of printing MCP help. Run `atomic mcp --help` for full usage.
121
137
 
122
- `list` connects to enabled servers and reports state, tools, and errors, exiting `1` on invalid config or any disconnected enabled server. Pass `--json` for machine-readable output. `login` times out after 300 seconds by default (`--timeout` caps the entire sign-in flow, including authorization-server requests, not MCP request timeouts). Running sessions pick up new credentials on their next turn.
138
+ `list` connects to enabled servers and reports state, tools, and errors, exiting `1` on invalid config or any disconnected enabled server. An untrusted `.atomic/mcp.json` is skipped with a note without causing `list` to exit nonzero. Pass `--json` for machine-readable output. `login` times out after 300 seconds by default (`--timeout` caps the entire sign-in flow, including authorization-server requests, not MCP request timeouts). Running sessions pick up new credentials on their next turn.
123
139
 
124
140
  Resource-capable servers show `offers resources` rather than counts (`resources: true` in `--json` output). Use the resource tools below to list resources on demand.
125
141
 
@@ -136,7 +152,7 @@ MCP tools register as `mcp__<server>__<tool>` with punctuation replaced by `_`.
136
152
  | `direct` | Declared like a built-in tool and also callable from codemode. |
137
153
  | `hidden` | Unreachable. |
138
154
 
139
- `codemode-deferred` is accepted as an alias for `codemode`. Atomic activates `codemode` for codemode servers and `tool_search` for deferred servers automatically. An explicit `-codemode` in `defaultTools` or `--tools` takes precedence so MCP leaves codemode off (merely omitting `codemode` from `defaultTools` does not block MCP activation). Set `"autoEnableCodemode": false` beside `mcpServers` to turn off automatic codemode activation without changing ordinary defaults; a project setting overrides the user-level setting.
155
+ `codemode-deferred` is accepted as an alias for `codemode`. Atomic activates `codemode` for codemode servers and `tool_search` for deferred servers automatically (in subagents, `autoEnableCodemode` is always `false`). An explicit `-codemode` in `defaultTools` or `--tools` takes precedence so MCP leaves codemode off (merely omitting `codemode` from `defaultTools` does not block MCP activation). Set `"autoEnableCodemode": false` beside `mcpServers` to turn off automatic codemode activation without changing ordinary defaults; a project setting overrides the user-level setting.
140
156
 
141
157
  `toolExposure` overrides exposure for individual tools. Keys match the **original server tool name** (case-sensitive) before `mcp__<server>__` prefixing. `*` is the only wildcard (`?`, `[...]`, and regex syntax match literally). Exact matches win first, followed by wildcard patterns in JSON key order (first match wins):
142
158
 
@@ -162,29 +178,41 @@ Both `codemode` and `deferred` tools can be reached through either discovery mec
162
178
 
163
179
  `--no-mcp` disables built-in MCP support for one run: no built-in servers connect, no MCP tools load, and `/mcp` does not register. A custom replacement extension is unaffected.
164
180
 
165
- **Output handling.** Codemode scripts receive the complete untruncated `CallToolResult` (`content`, `structuredContent`, and `isError`, with `_meta` stripped). For direct model calls, text over 20 KiB (`20,480` bytes) is middle-truncated (keeping the start and end) with the full text saved to a temporary file (`pi-mcp*.txt`) named in the result. Every MCP call passes through Atomic's tool pipeline, including permission hooks.
181
+ **Output handling.** Codemode scripts receive the complete untruncated MCP result (`content`, `structuredContent`, and `isError`, with `_meta` stripped). For direct model calls, text over **20 KiB** (`20,480` bytes) is middle-truncated (keeping the start and end) with the full text saved to a temporary file whose path is printed in the result. Every MCP call passes through Atomic's tool pipeline, including permission hooks.
166
182
 
167
183
  ## Use resources
168
184
 
169
185
  When a connected server offers resources, Atomic registers three tools:
170
186
 
171
- - `list_mcp_resources`: lists resources. Pass `server` to fetch one page from a single server (and `cursor` for the next page); omit `server` to paginate through every page of every server automatically.
187
+ - `list_mcp_resources`: lists resources. Pass `server` to fetch one page from a single server (and `cursor` for the next page); omit `server` to paginate through every page of every server automatically. Passing `cursor` without `server` fails with an error.
172
188
  - `list_mcp_resource_templates`: lists URI templates, using the same `server` and `cursor` pagination rules.
173
- - `read_mcp_resource`: reads a resource by `server` and `uri`. Text and images reach the model directly; other binary content is saved to a temporary file.
189
+ - `read_mcp_resource`: reads a resource by `server` and `uri`. Text, images, and binary blobs with text MIME types (`text/*`, `application/json`, `*+json`, `*+xml`) reach the model directly; other binary content is saved to a temporary file.
174
190
 
175
- These tools cover enabled, non-hidden resource servers. Their exposure equals the widest exposure among those servers, using the priority order `direct` > `codemode` > `deferred` > `hidden`. Resource links inside tool results identify the server and `read_mcp_resource`.
191
+ These tools cover enabled, non-hidden resource servers, apply the same 20 KiB direct-call text truncation, and inherit the widest exposure among those servers (`direct` > `codemode` > `deferred` > `hidden`). Resource links inside tool results identify the server and `read_mcp_resource`.
176
192
 
177
193
  MCP Apps resources (`ui://` URIs or `text/html;profile=mcp-app`) are omitted because Atomic does not render interactive web UIs inside the terminal.
178
194
 
179
195
  ## Authentication
180
196
 
181
- For a remote OAuth server, configure its `url` and run `/mcp login my-server`, or choose **Sign in** in `/mcp`. Atomic opens the authorization page and prints a clickable URL. If your browser runs on another machine, paste the full redirect URL into the waiting sign-in prompt. Press `Esc` to cancel at any step; authorization-server requests time out after 15 seconds. Treat authorization and redirect URLs as sensitive.
197
+ OAuth applies to HTTP servers that do not set an `Authorization` header or `auth.provider`.
198
+
199
+ <Steps>
200
+ <Step title="Configure the server URL">
201
+ Add the server's `url` (and optional `oauth` settings if using a pre-registered client) in `mcp.json` or with `atomic mcp add`.
202
+ </Step>
203
+ <Step title="Start sign-in">
204
+ Run `/mcp login my-server` inside Atomic (or choose **Sign in** in `/mcp`), or run `atomic mcp login my-server` in your shell before unattended runs. Atomic opens the authorization page and prints a clickable URL.
205
+ </Step>
206
+ <Step title="Complete browser or headless redirect">
207
+ Approve access in your browser. If your browser runs on another machine, paste the full redirected URL into the waiting sign-in prompt. Press `Esc` to cancel at any step.
208
+ </Step>
209
+ </Steps>
182
210
 
183
- Atomic registers OAuth clients as `atomic`, stores tokens in `~/.atomic/agent/mcp-auth.json`, and refreshes access tokens proactively 30 seconds before expiry (or when rejected). A successful sign-in reconnects the server. If a server requests extra scopes later, sign in again. Run `/mcp logout my-server` or `atomic mcp logout my-server` to delete stored credentials.
211
+ Atomic registers dynamic OAuth clients as `atomic`, stores tokens in `~/.atomic/agent/mcp-auth.json`, refreshes tokens proactively 30 seconds before expiry (with cross-process refresh locking), and reconnects the server after sign-in. Run `/mcp logout my-server` or `atomic mcp logout my-server` to remove stored credentials.
184
212
 
185
- Credentials are keyed by server name and URL. Two server entries with the same URL under different names (such as separate accounts) sign in independently; entries with the same name and URL across global and project `mcp.json` files share one sign-in.
213
+ Credentials are keyed by the **normalized** server name (`-` replaced with `_`) and normalized URL. Two entries for the same URL under different normalized names sign in independently; entries with the same normalized name and URL across global and project `mcp.json` files share one sign-in.
186
214
 
187
- OAuth applies to HTTP servers that do not set an `Authorization` header or `auth.provider`. For a pre-registered OAuth client:
215
+ For a pre-registered OAuth client:
188
216
 
189
217
  ```json
190
218
  {
@@ -203,14 +231,13 @@ OAuth applies to HTTP servers that do not set an `Authorization` header or `auth
203
231
  ```
204
232
 
205
233
  - `clientSecret` is optional and supports `${NAME}`, `$NAME`, and `!command` expansion (escape literal `$` as `$$`).
206
- - `callbackPort` must be between `1` and `65535` and uses `http://127.0.0.1:<port>/callback`.
207
- - `callbackUrl` lets you specify another registered redirect URI. It must use HTTP on `localhost`, `127.0.0.1`, or `[::1]` and must not include a query string (`?`) or fragment (`#`). If `callbackUrl` omits a port, Atomic adds `callbackPort` or picks a free port. If both `callbackUrl` (with an explicit port) and `callbackPort` are set, their ports must match or validation fails.
208
- - When pasting a redirect URL manually, keep its scheme, host, port, and path unchanged. Atomic rejects URLs that do not match the active sign-in's redirect URI, even when the authorization code and state are valid.
209
- - Use `oauth.clientName` when a server requires a specific client registration name (sign out before signing in again after changing it). Use `oauth.scope` for servers that do not advertise required scopes; later scope requests are merged with it.
234
+ - `callbackPort` must be `1`–`65535` and uses `http://127.0.0.1:<port>/callback`.
235
+ - `callbackUrl` specifies another registered redirect URI (HTTP on `localhost`, `127.0.0.1`, or `[::1]`, with no `?` query string or `#` fragment). If `callbackUrl` omits a port, Atomic adds `callbackPort` or picks a free port; if both specify ports, they must match.
236
+ - Use `oauth.clientName` when a server requires a specific dynamic client registration name (sign out before signing in again after changing it). Use `oauth.scope` when a server does not advertise required scopes; later scope requests merge with it.
210
237
 
211
238
  ### Override OAuth authorization server discovery
212
239
 
213
- If an MCP server advertises the wrong authorization server or none at all, set `oauth.authServerMetadataUrl` to a trusted RFC 8414 or OpenID Connect metadata document:
240
+ If an MCP server advertises the wrong authorization server or none at all, set `oauth.authServerMetadataUrl` to a trusted authorization server metadata document (OAuth 2.0 or OpenID Connect):
214
241
 
215
242
  ```json
216
243
  {
@@ -223,9 +250,14 @@ If an MCP server advertises the wrong authorization server or none at all, set `
223
250
  }
224
251
  ```
225
252
 
226
- Atomic uses that document instead of running authorization server discovery and trusts its configured issuer. Point it only at a metadata URL you trust. The URL must use HTTPS, except for HTTP on `localhost`, `127.0.0.1`, or `[::1]`.
253
+ Atomic uses that document instead of running discovery and trusts its configured issuer. Point it only at a metadata URL you trust; it must use HTTPS (except HTTP on `localhost`, `127.0.0.1`, or `[::1]`).
227
254
 
228
- Atomic rejects authorization responses whose `iss` names another issuer before exchanging the code. When a server advertises RFC 9207 issuer parameter support, the response must include `iss`. An empty refresh token does not overwrite a stored refresh token, and a missing or null `expires_in` value does not expire the access token immediately.
255
+ ### OAuth security and redirect rules
256
+
257
+ - Treat authorization and redirect URLs as sensitive. Authorization-server metadata and token requests time out after 15 seconds.
258
+ - When pasting a redirect URL manually, keep its scheme, host, port, and path unchanged—Atomic rejects URLs that do not match the active sign-in's redirect URI even when the authorization code and state are valid.
259
+ - Atomic rejects authorization responses whose `iss` parameter names another issuer before exchanging the code, and requires `iss` whenever the server advertises issuer-parameter support.
260
+ - An empty refresh token never overwrites a stored refresh token, and a missing or null `expires_in` does not expire the access token immediately.
229
261
 
230
262
  ### Authenticate with a provider login
231
263
 
@@ -242,19 +274,17 @@ An HTTP server can reuse an active Atomic provider login token instead of MCP OA
242
274
  }
243
275
  ```
244
276
 
245
- Atomic reads the current provider token on every request and never copies it into `mcp-auth.json`. If the token is missing or rejected, run `/login <provider>` and retry.
246
-
247
- `atomic mcp list` also sends the provider token, refreshes expired logins, and prompts with `/login <provider>` if sign-in is required. `atomic mcp login` and `atomic mcp logout` do not manage provider logins; use `atomic auth login <provider>` and `atomic auth logout <provider>` instead.
277
+ Atomic reads the current provider token on every request and never copies it into `mcp-auth.json`. If the token is missing or rejected, run `/login <provider>` and retry. `atomic mcp list` also sends and refreshes provider logins; use `atomic auth login <provider>` and `atomic auth logout <provider>` to manage them from the shell.
248
278
 
249
- Provider-token authentication enforces these restrictions:
279
+ Provider-token authentication enforces three safeguards:
250
280
 
251
- - Accepted only from user-level `~/.atomic/agent/mcp.json` and extension registrations, never from project `.atomic/mcp.json` or package manifests.
252
- - Requires HTTPS, except for HTTP on `localhost`, `127.0.0.1`, or `[::1]`.
253
- - Sends tokens only to the server's configured origin. Atomic follows same-origin `301`, `302`, `303`, `307`, and `308` redirects up to 10 hops (rewriting `POST` to `GET` on `301` and `302`, and non-`HEAD` requests to `GET` on `303`). Cross-origin redirects are rejected.
281
+ - Accepted only from user-level `~/.atomic/agent/mcp.json` and extension registrations—never from project `.atomic/mcp.json` or package manifests.
282
+ - Requires HTTPS, except HTTP on `localhost`, `127.0.0.1`, or `[::1]`.
283
+ - Sends tokens only to the configured origin (following up to 10 same-origin redirects and rejecting cross-origin redirects).
254
284
 
255
285
  ## Using MCP from the SDK
256
286
 
257
- `createAgentSession()` enables built-in MCP support by default and loads servers from `mcp.json`, installed packages, and extensions. Control MCP behavior programmatically from `@bastani/atomic`:
287
+ `createAgentSession()` enables built-in MCP support by default and loads servers from `mcp.json`, installed packages, and extensions:
258
288
 
259
289
  ```typescript
260
290
  import { createAgentSession, DefaultResourceLoader } from "@bastani/atomic";
@@ -288,17 +318,17 @@ const { session } = await createAgentSession({ resourceLoader: loader });
288
318
 
289
319
  - **Tool filtering.** When `tools` is a non-empty allowlist with no `mcp__*` entry, MCP tools stay registered for `codemode` and `tool_search`. Adding any `mcp__*` entry switches MCP tools to explicit allowlisting. See [SDK tools](/sdk/reference#tools).
290
320
  - **Dynamic registration.** Call [`atomic.registerMcpServer()`](/extensions/api-reference#atomic-registermcpserver-name-config) inside an inline extension factory when a server URL or port is computed at runtime.
291
- - **Custom resource loaders.** Implement `getMcpServerContributions()` on a custom `ResourceLoader` to supply `McpServerContribution[]` directly under your own trust policy. See [ResourceLoader](/sdk/reference#resourceloader).
321
+ - **Custom resource loaders.** Implement `getMcpServerContributions()` on a custom `ResourceLoader` to supply servers under your own trust policy. See [ResourceLoader](/sdk/reference#resourceloader).
292
322
 
293
- ## Supported configuration and limits
323
+ ## Supported capabilities and limits
294
324
 
295
- - Atomic reads only `~/.atomic/agent/mcp.json`, trusted `.atomic/mcp.json`, and package or extension contributions. External MCP client config files and third-party credential stores are not imported.
296
- - Supported transports are stdio and streamable HTTP. SSE endpoints and MCP Apps (`ui://`) rendering are not supported.
297
- - All enabled servers connect in the background, register tools under `mcp__<server>__<tool>`, and default to `codemode` exposure.
325
+ - **Configuration sources.** Atomic reads only `~/.atomic/agent/mcp.json`, trusted `.atomic/mcp.json`, and package or extension contributions. External MCP client config files and third-party credential stores are not imported.
326
+ - **Transports and message limit.** Supports stdio and streamable HTTP with a **16 MiB** maximum per MCP message or SSE event. Legacy SSE endpoints are not supported.
327
+ - **Protocol features.** Atomic advertises MCP `roots` (the session working directory) and handles server `ping`, `notifications/tools/list_changed`, `notifications/message`, and progress notifications. MCP **prompts**, **sampling**, **elicitation**, and MCP Apps (`ui://`) rendering are not supported.
298
328
 
299
329
  ## Troubleshooting
300
330
 
301
- - **Inspect logs and stderr.** Check `~/.atomic/agent/mcp.log` for full connection and protocol logs, or run `/mcp` to inspect connection errors, server tools, and the tail of a failed stdio server's stderr.
331
+ - **Inspect connection state and logs.** Run `/mcp` or `atomic mcp list` to view connection errors, available tools, and the tail of a failed stdio server's stderr. `~/.atomic/agent/mcp.log` records server-sent `notifications/message` log notifications (and CLI provider-token warnings), truncating entries at 64 KiB and rotating to `mcp.log.1` at 5 MiB—it does not log connection handshakes or raw JSON-RPC frames.
302
332
  - **Reload after config edits.** Run `/reload` or restart Atomic after editing `mcp.json`. Use `/mcp reconnect my-server` to reconnect and refresh tools.
303
333
  - **Missing tools.** Check both server-level `exposure` and per-tool `toolExposure`. `hidden` tools cannot be called; `codemode` and `deferred` tools need codemode or `tool_search` enabled.
304
334
  - **OAuth redirect failures.** Verify `callbackPort` and `callbackUrl` match the registered redirect URI with no query string or fragment. Over SSH, paste the complete redirected URL into the waiting sign-in prompt.
@@ -308,8 +338,17 @@ const { session } = await createAgentSession({ resourceLoader: loader });
308
338
 
309
339
  ## Related docs
310
340
 
311
- - [SDK tools](/sdk/reference#tools) and [ResourceLoader](/sdk/reference#resourceloader) cover `builtins.mcp`, `tools`, `excludedTools`, and `getMcpServerContributions()`.
312
- - [Extensions API reference](/extensions/api-reference#atomic-registermcpserver-name-config) documents `atomic.registerMcpServer()`.
313
- - [Codemode reference](/codemode) and [`tool_search`](/tools#tool_search) cover discovering and calling `codemode` and `deferred` MCP tools.
314
- - [Tool and MCP allowlists](/subagents/authoring#tool-and-mcp-allowlists) explains `mcp:<server>` and `mcp:<server>/<tool>` syntax in custom subagents.
315
- - [CLI reference](/reference/cli#mcp-commands) lists all `atomic mcp` subcommands and `--no-mcp`.
341
+ <Columns cols={2}>
342
+ <Card title="Codemode" href="/codemode">
343
+ Discover and call `codemode` and `deferred` MCP tools from JavaScript scripts.
344
+ </Card>
345
+ <Card title="CLI MCP commands" href="/reference/cli#mcp-commands">
346
+ Reference for `atomic mcp` subcommands and `--no-mcp`.
347
+ </Card>
348
+ <Card title="Extensions API" href="/extensions/api-reference#atomic-registermcpserver-name-config">
349
+ Register dynamic MCP servers at runtime with `atomic.registerMcpServer()`.
350
+ </Card>
351
+ <Card title="Subagent allowlists" href="/subagents/authoring#tool-and-mcp-allowlists">
352
+ Grant `mcp:<server>` and `mcp:<server>/<tool>` access in custom subagents.
353
+ </Card>
354
+ </Columns>
@@ -0,0 +1,188 @@
1
+ ---
2
+ title: "Choose a model"
3
+ sidebarTitle: "Choose a Model"
4
+ description: "Pick how to connect models, switch models and thinking levels during a session, scope and fall back across models, and troubleshoot model selection."
5
+ ---
6
+
7
+ Atomic ships built-in model catalogs for cloud subscriptions, API-key providers, and local inference servers, and lets you add custom endpoints without leaving your session. Use this guide to pick how to connect, switch models and thinking effort day to day, and configure scopes, fallbacks, and specialized models.
8
+
9
+ ## Pick how to connect
10
+
11
+ | What you want | Use this | Start here |
12
+ | --- | --- | --- |
13
+ | Use an existing Claude, ChatGPT/Codex, GitHub Copilot, Kimi Code, Meta, OpenRouter, or xAI account | Subscription or account sign-in (`/login`) | [Connect model providers](/providers#subscriptions) |
14
+ | Pay per token with an API key or cloud account (Anthropic, OpenAI, Google, Azure, Bedrock, Vertex, OpenRouter, Cloudflare, and more) | API key via `/login`, `~/.atomic/agent/auth.json`, or environment variable | [API keys](/providers#api-keys) |
15
+ | Run local GGUF models with GPU offloading, on-demand load/unload, and local classification | Local `llama.cpp` router (`/login llama.cpp`, `/llama`) | [Run local models with llama.cpp](/llama-cpp) |
16
+ | Connect Ollama, LM Studio, vLLM, or an OpenAI-, Anthropic-, or Google-compatible proxy | `~/.atomic/agent/models.json` | [Configure custom models](/models) |
17
+ | Implement a custom streaming protocol, OAuth flow, or dynamic model discovery | Custom provider extension (`atomic.registerProvider()`) | [Build custom providers](/custom-provider) |
18
+
19
+ ## Switch models and thinking levels
20
+
21
+ Once at least one provider is authenticated, switch models and reasoning effort interactively or from the command line. Every interactive model or thinking change saves automatically as your startup default in `~/.atomic/agent/settings.json`.
22
+
23
+ ### Interactive commands and shortcuts
24
+
25
+ | Action | Command or shortcut | What it does |
26
+ | --- | --- | --- |
27
+ | Pick a model | `/model` or `Ctrl+L` | Opens the searchable model picker. Press `←`/`→` on a reasoning model to pick its thinking level before confirming. Press `Tab` to toggle between scoped and all models. |
28
+ | Switch directly | `/model <provider/id>` | Switches immediately on an exact case-insensitive `provider/id` or bare `id` match (without a `:level` suffix), or opens the picker pre-filtered on a partial match. |
29
+ | Cycle models | `Ctrl+P` / `Shift+Ctrl+P` | Cycles forward and backward through available models (`Alt+P` for backward on Windows and WSL). Cycles only scoped models when `enabledModels` is active. |
30
+ | Set thinking level | `/thinking [level]` or `Shift+Tab` | Changes reasoning effort (`off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`), clamped to what the active model supports. |
31
+ | Collapse or expand thinking | `Ctrl+T` | Toggles thinking blocks in the viewed transcript. |
32
+
33
+ Atomic saves your active model under `defaultProvider` and `defaultModel`, and saves your reasoning level under both `modelThinkingLevels["<provider>/<id>"]` and `defaultThinkingLevel`. Open `/settings` and select **Default thinking level per model** to inspect saved per-model levels.
34
+
35
+ ### Fast and Ultrafast models
36
+
37
+ Fast and Ultrafast inference are selectable model IDs ending in `-fast` or `-ultrafast`, not a separate toggle. Select them anywhere you name a model, including `/model`, `--model`, `enabledModels`, `fallbackModels`, and subagents:
38
+
39
+ ```bash
40
+ atomic --model anthropic/claude-opus-5-fast:high
41
+ atomic --model openai-codex/gpt-6.2-sol-fast:medium
42
+ atomic --model openai/gpt-6.2-astra-ultrafast:high
43
+ atomic --model xai/grok-4.7-fast
44
+ ```
45
+
46
+ Derived `-fast` and `-ultrafast` variants are generated for eligible models on `openai`, `openai-api`, `openai-codex`, `anthropic`, `anthropic-api`, and `xai`. GitHub Copilot publishes its own account-advertised fast model IDs. See [Fast models](/providers#fast-models) and [Fast and Ultrafast tiers](/providers#fast-and-ultrafast-tiers).
47
+
48
+ ### Override for a single run from the shell
49
+
50
+ Inspect available models or start one session on a specific provider, model, and thinking level without changing your saved defaults:
51
+
52
+ ```bash
53
+ atomic --list-models
54
+ atomic --model anthropic/claude-opus-5:high
55
+ atomic --provider openai-codex --model gpt-6.2-sol:medium
56
+ ```
57
+
58
+ See [CLI model options](/reference/cli#model-options) for all model flags and fuzzy matching rules.
59
+
60
+ ## Scope models and set fallbacks
61
+
62
+ ### Limit active models with `/scoped-models` and `enabledModels`
63
+
64
+ If you have credentials for many providers, narrow your daily rotation so `Ctrl+P`, `/model`, and subagents stay on the models you approve.
65
+
66
+ Run `/scoped-models` in interactive mode to toggle and reorder models; every change saves immediately to global `~/.atomic/agent/settings.json` as explicit `provider/id` entries. For glob patterns, per-entry `:thinking` levels, or project-scoped lists, edit `enabledModels` directly in `settings.json` (or pass `--models` for one run):
67
+
68
+ ```json
69
+ {
70
+ "enabledModels": [
71
+ "anthropic/claude-opus-5:high",
72
+ "openai-codex/gpt-6.2-sol*",
73
+ "xai/grok-4.7"
74
+ ]
75
+ }
76
+ ```
77
+
78
+ When a scope is active:
79
+
80
+ - **Startup model:** A new session starts on your saved default if it is in scope, or on the first matched scoped model otherwise.
81
+ - **`Ctrl+P` and `/model`:** Cycling walks only scoped models in order. `/model` opens filtered to scoped models (press `Tab` to view all models).
82
+ - **Subagents:** Child subagents inherit the active scope and reject any model outside it. Because Fast and Ultrafast variants have their own IDs (`-fast`, `-ultrafast`), end a pattern with `*` (such as `"openai-codex/gpt-6.2-sol*"`) or list those IDs explicitly if you want subagents to use them.
83
+
84
+ <Tip>
85
+ Editing `enabledModels` through `/scoped-models` saves explicit `provider/id` strings to global `settings.json`, replacing hand-written globs and `:thinking` suffixes. Edit `settings.json` directly when you want to keep globs or per-model thinking suffixes. See [`enabledModels`](/settings#enabledmodels).
86
+ </Tip>
87
+
88
+ ### Recover from limits and outages with `fallbackModels`
89
+
90
+ Configure an ordered fallback chain in `settings.json` so main-chat turns switch automatically when a model hits rate limits, exhausted quota, content filters, auth errors, refused TLS certificates, or outages:
91
+
92
+ ```json
93
+ {
94
+ "defaultProvider": "openai-codex",
95
+ "defaultModel": "gpt-6.2-sol",
96
+ "defaultThinkingLevel": "high",
97
+ "fallbackModels": [
98
+ "anthropic/claude-opus-5:high",
99
+ "github-copilot/gpt-6.1-sol:high"
100
+ ]
101
+ }
102
+ ```
103
+
104
+ - **Main chat stays independent of `enabledModels`:** You can keep an out-of-scope emergency model in `fallbackModels`. Child subagent fallbacks still stay within the session's `enabledModels` scope.
105
+ - **Per-run overrides:** Pass `--fallback-models` to replace the chain for one run, or `--no-fallback` to disable fallbacks. Passing `--model` on the CLI runs strictly as named unless you also pass `--fallback-models`.
106
+ - **Skipped candidates:** Providers without configured credentials are skipped before any request, and a provider that rejects credentials mid-turn is skipped for the rest of that chain.
107
+
108
+ Because switching providers changes billing and data-handling terms, include only approved providers in `fallbackModels`. See [`fallbackModels`](/settings#fallbackmodels).
109
+
110
+ ## Use specialized models
111
+
112
+ In addition to chat models, Atomic supports three specialized model kinds. None of them appear in `/model` or run as your chat model.
113
+
114
+ | Model kind | Configured via | Built-in options | Learn more |
115
+ | --- | --- | --- | --- |
116
+ | **Chat** | `/model`, `defaultModel`, `enabledModels`, `fallbackModels` | All built-in, `models.json`, `llama.cpp`, and extension chat providers | [Connect providers](/providers) |
117
+ | **Classifier** | `decisionModel` (`/settings` → **Decision model**) or codemode | `openai-decisions/gpt-6-luna`, `typesafe/jev-latest`, Cloudflare Clef and Jev, GitHub Copilot, OpenRouter, Vercel AI Gateway, OpenCode Zen, local `llama.cpp` | [Classifier models](/models#use-classifier-models) |
118
+ | **Compactor** | `compactionModel` (`/settings` → **Compaction model**) | `"auto"` (built-in memory compaction) or `morph/morph-compactor`, plus custom compactors in `models.json` | [Custom compactors](/compaction/custom-compactors) |
119
+ | **Image** | Codemode (`models.generateImages()`) or extensions (`ctx.modelRegistry.generateImages()`) | `openai-images` (GPT Image 1 through GPT Image 2.6, including SVG and GIF) and `openrouter` image models | [Image models](/models#use-image-models) |
120
+
121
+ - **Decision models (`decisionModel`):** Leave `decisionModel` empty or `"auto"` to use your active chat model for structured decisions (`structured_output` and `decide()`), or pin a fast classifier such as `typesafe/jev-latest`, `openai-decisions/gpt-6-luna`, or a local `llama.cpp/<id>` model in `/settings`. Changes in `/settings` apply immediately without `/reload`. See [`decisionModel`](/settings#decisionmodel) and [Structured decisions](/sdk/structured-decisions).
122
+ - **Compaction models (`compactionModel`):** By default Atomic uses [memory compaction](/compaction/memory-compaction) (`"auto"`), which clears the window and lets the agent recover verbatim details from session history. To send context to a remote compactor such as `morph/morph-compactor` or your own endpoint, select it under `/settings` → **Compaction model**. See [Custom compaction models](/compaction/custom-compactors).
123
+ - **Image models (`openai-images` and `openrouter`):** Built-in `openai-images` models reuse your OpenAI API key (`openai-api`, `openai` API key, or `OPENAI_API_KEY`, skipping ChatGPT sign-in), while `openrouter` image models reuse your OpenRouter credential. See [Use image models](/models#use-image-models) and [Codemode image generation](/codemode#generate-images).
124
+
125
+ ## How Atomic picks your startup model
126
+
127
+ When Atomic starts, it resolves the initial chat model in this order:
128
+
129
+ <Steps>
130
+ <Step title="CLI flags">
131
+ Explicit `--model` (with optional `--provider`) on the command line wins for that run.
132
+ </Step>
133
+ <Step title="Resumed session model">
134
+ When you run `--continue`, `--resume`, or `/resume`, Atomic restores the model last used in that session (if still available and authenticated).
135
+ </Step>
136
+ <Step title="Saved defaults and model scope">
137
+ For a new session, Atomic uses `defaultProvider` and `defaultModel` from `settings.json` when authenticated and inside any active `enabledModels` / `--models` scope. If your saved default is outside an active scope, Atomic starts on the first matched scoped model instead.
138
+ </Step>
139
+ <Step title="Automatic preferred-provider selection">
140
+ When no saved default applies (for example on first run, or when the saved model lacks credentials), Atomic walks its built-in preferred provider order and picks the first authenticated provider's preferred default model. If none of those preferred IDs are available, it picks the first available authenticated model.
141
+ </Step>
142
+ </Steps>
143
+
144
+ <Note>
145
+ **Unsupported saved `defaultProvider`:** If `defaultProvider` names a removed or unregistered provider even after extensions load, Atomic does not switch providers silently. Interactive mode warns and leaves model selection open, print and JSON modes write an error to stderr and exit nonzero, and RPC rejects `prompt` until you select an available model.
146
+ </Note>
147
+
148
+ ### Startup provider selection order
149
+
150
+ When multiple providers are authenticated and no saved default applies, Atomic checks providers in this built-in priority order and picks each provider's preferred model first:
151
+
152
+ | Priority group | Providers checked in order (preferred default model) |
153
+ | --- | --- |
154
+ | Primary cloud & subscriptions | `amazon-bedrock` (`us.anthropic.claude-opus-5-5`), `anthropic` (`claude-opus-5-5`), `anthropic-api` (`claude-opus-5-5`), `openai` (`gpt-6.2-sol`), `openai-api` (`gpt-6.2-sol`), `azure` (`gpt-6.2-sol`), `openai-codex` (`gpt-6.2-sol`) |
155
+ | Major API & gateway providers | `nvidia` (`nvidia/nemotron-3.5-super-vl-120b-a12b`), `deepseek` (`deepseek-v4-pro`), `google` (`gemini-4-argon`), `google-vertex` (`gemini-4-argon`), `github-copilot` (`gpt-6.1-sol`), `openrouter` (`moonshotai/kimi-k2.7-code`), `vercel-ai-gateway` (`zai/glm-5.3`), `xai` (`grok-4.7`) |
156
+ | Additional built-in providers | `groq`, `cerebras`, `ant-ling`, `zai`, `zai-coding-cn`, `mistral`, `minimax`, `minimax-cn`, `moonshotai`, `moonshotai-cn`, `huggingface`, `fireworks`, `together`, `baseten`, `opencode`, `opencode-go`, `kimi-coding`, `meta`, `cloudflare-workers-ai`, `cloudflare-ai-gateway`, `qwen-token-plan*`, `xiaomi*` |
157
+
158
+ `/model` and `/scoped-models` display cached catalogs immediately while refreshing network-backed catalogs in the background for up to 15 seconds. Run `atomic update --models` from the shell to refresh cached catalogs ahead of time.
159
+
160
+ ## Troubleshooting
161
+
162
+ - **A model does not appear in `/model`:**
163
+ - Verify credentials for its provider with `atomic auth check --provider <provider>` (see [Verify credentials before a session](/providers#verify-readiness-before-a-session)).
164
+ - Check whether `enabledModels` is filtering the picker—press `Tab` inside `/model` to show all authenticated models.
165
+ - Remember that classifiers, image models, and compactors never appear in `/model`.
166
+ - On GitHub Copilot or OpenRouter, `/model` hides models your account or API key cannot access once an online refresh succeeds. Run `atomic update --models` or `/login` after plan changes.
167
+ - On `llama.cpp` started with `--no-models-autoload`, load the model in `/llama` first before opening `/model`.
168
+ - **Auth works in one terminal window only:** Environment variables (`export ANTHROPIC_API_KEY=...`) apply only to that shell. Run `/login` or `atomic auth login <provider>` to save credentials in `~/.atomic/agent/auth.json` for every session.
169
+ - **Browser callback fails over SSH or on a remote host:** Paste the final redirect URL or authorization code into the `/login` prompt, or run `atomic auth login <provider> --no-browser` for a device-code or copy-code flow.
170
+ - **An OpenAI-compatible or local endpoint rejects requests:** Servers such as Ollama, vLLM, and SGLang often reject the `developer` role or `reasoning_effort`. Add `compat` flags (such as `"supportsDeveloperRole": false` and `"supportsReasoningEffort": false`) in `~/.atomic/agent/models.json`, then open `/model` or run `/reload`. See [OpenAI compatibility](/models/reference#openai-compatibility).
171
+ - **A `-fast` or `-ultrafast` model is missing or blocked for a subagent:** Only eligible built-in models on `openai`, `openai-api`, `openai-codex`, `anthropic`, `anthropic-api`, and `xai` receive derived fast variants (plus account-advertised fast IDs on `github-copilot`). Custom entries under `models` in `models.json` never receive derived fast variants—use `modelOverrides` instead. If `enabledModels` is active, include the `-fast` or `-ultrafast` ID explicitly (for example `"openai-codex/gpt-6.2-sol*"`).
172
+
173
+ ## Next steps
174
+
175
+ <Columns cols={2}>
176
+ <Card title="Connect model providers" href="/providers">
177
+ Sign in with subscriptions, store API keys, and configure cloud or specialized providers.
178
+ </Card>
179
+ <Card title="Run local models with llama.cpp" href="/llama-cpp">
180
+ Discover, download, load, and run local GGUF chat models and classifiers.
181
+ </Card>
182
+ <Card title="Configure custom models" href="/models">
183
+ Add Ollama, LM Studio, vLLM, API proxies, image models, and remote compactors.
184
+ </Card>
185
+ <Card title="Models and thinking settings" href="/settings#models-and-thinking">
186
+ Complete reference for `enabledModels`, `fallbackModels`, `decisionModel`, and `thinkingBudgets`.
187
+ </Card>
188
+ </Columns>