@assistant-ui/mcp-docs-server 0.1.31 → 0.1.33

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 (281) hide show
  1. package/.docs/organized/code-examples/waterfall.md +23 -25
  2. package/.docs/organized/code-examples/with-a2a.md +28 -28
  3. package/.docs/organized/code-examples/with-ag-ui.md +35 -30
  4. package/.docs/organized/code-examples/with-ai-sdk-v6.md +16 -14
  5. package/.docs/organized/code-examples/with-artifacts.md +44 -38
  6. package/.docs/organized/code-examples/with-assistant-transport.md +68 -56
  7. package/.docs/organized/code-examples/with-browser-extension.md +357 -0
  8. package/.docs/organized/code-examples/with-chain-of-thought.md +425 -90
  9. package/.docs/organized/code-examples/with-cloud-standalone.md +30 -29
  10. package/.docs/organized/code-examples/with-cloud.md +16 -14
  11. package/.docs/organized/code-examples/with-custom-thread-list.md +19 -17
  12. package/.docs/organized/code-examples/with-elevenlabs-conversational.md +29 -26
  13. package/.docs/organized/code-examples/with-elevenlabs-scribe.md +20 -18
  14. package/.docs/organized/code-examples/with-expo.md +37 -31
  15. package/.docs/organized/code-examples/with-external-store.md +13 -11
  16. package/.docs/organized/code-examples/with-ffmpeg.md +327 -290
  17. package/.docs/organized/code-examples/with-generative-ui.md +1195 -194
  18. package/.docs/organized/code-examples/with-google-adk.md +13 -11
  19. package/.docs/organized/code-examples/with-heat-graph.md +16 -14
  20. package/.docs/organized/code-examples/with-image-generation.md +456 -0
  21. package/.docs/organized/code-examples/with-interactables.md +322 -244
  22. package/.docs/organized/code-examples/with-langchain.md +18 -16
  23. package/.docs/organized/code-examples/with-langgraph.md +95 -88
  24. package/.docs/organized/code-examples/with-livekit.md +30 -27
  25. package/.docs/organized/code-examples/with-mcp.md +754 -0
  26. package/.docs/organized/code-examples/with-opencode.md +70 -70
  27. package/.docs/organized/code-examples/with-react-hook-form.md +24 -22
  28. package/.docs/organized/code-examples/with-react-ink.md +4 -4
  29. package/.docs/organized/code-examples/with-react-router.md +20 -18
  30. package/.docs/organized/code-examples/with-resumable-stream.md +661 -0
  31. package/.docs/organized/code-examples/with-store.md +22 -20
  32. package/.docs/organized/code-examples/with-tanstack.md +18 -19
  33. package/.docs/organized/code-examples/with-tap-runtime.md +31 -28
  34. package/.docs/raw/docs/(docs)/architecture.mdx +43 -2
  35. package/.docs/raw/docs/(docs)/cli.mdx +2 -2
  36. package/.docs/raw/docs/(docs)/copilots/model-context.mdx +34 -26
  37. package/.docs/raw/docs/(docs)/copilots/motivation.mdx +32 -26
  38. package/.docs/raw/docs/(docs)/index.mdx +2 -2
  39. package/.docs/raw/docs/(docs)/installation.mdx +2 -2
  40. package/.docs/raw/docs/(reference)/api-reference/adapters/attachments.mdx +26 -24
  41. package/.docs/raw/docs/(reference)/api-reference/adapters/feedback.mdx +20 -0
  42. package/.docs/raw/docs/(reference)/api-reference/adapters/index.mdx +20 -12
  43. package/.docs/raw/docs/(reference)/api-reference/adapters/model.mdx +44 -0
  44. package/.docs/raw/docs/(reference)/api-reference/adapters/persistence.mdx +41 -16
  45. package/.docs/raw/docs/(reference)/api-reference/adapters/runtime.mdx +12 -23
  46. package/.docs/raw/docs/(reference)/api-reference/adapters/suggestions.mdx +20 -0
  47. package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +37 -8
  48. package/.docs/raw/docs/(reference)/api-reference/context-providers/index.mdx +11 -9
  49. package/.docs/raw/docs/(reference)/api-reference/context-providers/scoped-providers.mdx +64 -0
  50. package/.docs/raw/docs/(reference)/api-reference/external-store/index.mdx +22 -0
  51. package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +52 -0
  52. package/.docs/raw/docs/(reference)/api-reference/external-store/runtime.mdx +46 -0
  53. package/.docs/raw/docs/(reference)/api-reference/generative-ui/index.mdx +18 -0
  54. package/.docs/raw/docs/(reference)/api-reference/generative-ui/rendering.mdx +33 -0
  55. package/.docs/raw/docs/(reference)/api-reference/generative-ui/spec.mdx +45 -0
  56. package/.docs/raw/docs/(reference)/api-reference/hooks/composer-triggers.mdx +98 -0
  57. package/.docs/raw/docs/(reference)/api-reference/hooks/index.mdx +18 -13
  58. package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +31 -52
  59. package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +640 -0
  60. package/.docs/raw/docs/(reference)/api-reference/hooks/runtimes.mdx +15 -28
  61. package/.docs/raw/docs/(reference)/api-reference/hooks/state.mdx +64 -18
  62. package/.docs/raw/docs/(reference)/api-reference/hooks/utilities.mdx +434 -0
  63. package/.docs/raw/docs/(reference)/api-reference/integrations/cloud-ai-sdk.mdx +24 -0
  64. package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +11 -12
  65. package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +109 -0
  66. package/.docs/raw/docs/(reference)/api-reference/model-context/context.mdx +58 -0
  67. package/.docs/raw/docs/(reference)/api-reference/model-context/index.mdx +22 -0
  68. package/.docs/raw/docs/(reference)/api-reference/model-context/registry.mdx +20 -0
  69. package/.docs/raw/docs/(reference)/api-reference/overview.mdx +109 -132
  70. package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +78 -221
  71. package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +127 -242
  72. package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +39 -20
  73. package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-modal.mdx +66 -87
  74. package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +50 -58
  75. package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +80 -48
  76. package/.docs/raw/docs/(reference)/api-reference/primitives/chain-of-thought.mdx +67 -0
  77. package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +323 -461
  78. package/.docs/raw/docs/(reference)/api-reference/primitives/error.mdx +36 -43
  79. package/.docs/raw/docs/(reference)/api-reference/primitives/index.mdx +29 -24
  80. package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +63 -245
  81. package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +202 -588
  82. package/.docs/raw/docs/(reference)/api-reference/primitives/queue-item.mdx +65 -0
  83. package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +35 -22
  84. package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +57 -140
  85. package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item-more.mdx +70 -161
  86. package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item.mdx +84 -108
  87. package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +77 -96
  88. package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +173 -349
  89. package/.docs/raw/docs/(reference)/api-reference/runtimes/assistant-runtime.mdx +9 -21
  90. package/.docs/raw/docs/(reference)/api-reference/runtimes/attachment-runtime.mdx +10 -21
  91. package/.docs/raw/docs/(reference)/api-reference/runtimes/composer-runtime.mdx +15 -70
  92. package/.docs/raw/docs/(reference)/api-reference/runtimes/index.mdx +18 -13
  93. package/.docs/raw/docs/(reference)/api-reference/runtimes/message-part-runtime.mdx +25 -28
  94. package/.docs/raw/docs/(reference)/api-reference/runtimes/message-runtime.mdx +11 -63
  95. package/.docs/raw/docs/(reference)/api-reference/runtimes/queue-state.mdx +20 -0
  96. package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-item-runtime.mdx +11 -48
  97. package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +10 -47
  98. package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-runtime.mdx +18 -30
  99. package/.docs/raw/docs/(reference)/api-reference/tools/component-tools.mdx +85 -0
  100. package/.docs/raw/docs/(reference)/api-reference/tools/index.mdx +39 -0
  101. package/.docs/raw/docs/(reference)/api-reference/tools/rendering.mdx +127 -0
  102. package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +42 -0
  103. package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +91 -0
  104. package/.docs/raw/docs/(reference)/api-reference/transport/assistant-transport.mdx +48 -0
  105. package/.docs/raw/docs/(reference)/api-reference/transport/frame.mdx +62 -0
  106. package/.docs/raw/docs/(reference)/api-reference/transport/index.mdx +22 -0
  107. package/.docs/raw/docs/(reference)/api-reference/utilities/index.mdx +19 -0
  108. package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +143 -0
  109. package/.docs/raw/docs/(reference)/api-reference/voice/index.mdx +22 -0
  110. package/.docs/raw/docs/(reference)/api-reference/voice/session.mdx +54 -0
  111. package/.docs/raw/docs/(reference)/api-reference/voice/speech-dictation.mdx +36 -0
  112. package/.docs/raw/docs/cloud/ai-sdk.mdx +1 -3
  113. package/.docs/raw/docs/cloud/index.mdx +2 -2
  114. package/.docs/raw/docs/guides/attachments.mdx +4 -4
  115. package/.docs/raw/docs/guides/branching.mdx +1 -1
  116. package/.docs/raw/docs/guides/chain-of-thought.mdx +12 -14
  117. package/.docs/raw/docs/guides/context-api.mdx +6 -5
  118. package/.docs/raw/docs/guides/dictation.mdx +2 -2
  119. package/.docs/raw/docs/guides/editing.mdx +1 -1
  120. package/.docs/raw/docs/guides/image-generation.mdx +74 -0
  121. package/.docs/raw/docs/guides/index.mdx +5 -14
  122. package/.docs/raw/docs/guides/latex.mdx +2 -2
  123. package/.docs/raw/docs/guides/mentions.mdx +6 -6
  124. package/.docs/raw/docs/guides/message-timing.mdx +38 -5
  125. package/.docs/raw/docs/guides/quoting.mdx +1 -1
  126. package/.docs/raw/docs/guides/resumable-stream-deployment.mdx +212 -0
  127. package/.docs/raw/docs/guides/resumable-stream-stores.mdx +152 -0
  128. package/.docs/raw/docs/guides/resumable-streams.mdx +210 -0
  129. package/.docs/raw/docs/guides/slash-commands.mdx +2 -2
  130. package/.docs/raw/docs/guides/speech.mdx +2 -2
  131. package/.docs/raw/docs/guides/suggestions.mdx +89 -5
  132. package/.docs/raw/docs/guides/voice.mdx +2 -2
  133. package/.docs/raw/docs/ink/adapters.mdx +37 -1
  134. package/.docs/raw/docs/ink/custom-backend.mdx +59 -8
  135. package/.docs/raw/docs/ink/hooks.mdx +98 -85
  136. package/.docs/raw/docs/ink/index.mdx +10 -11
  137. package/.docs/raw/docs/ink/migration.mdx +1 -1
  138. package/.docs/raw/docs/ink/primitives.mdx +350 -9
  139. package/.docs/raw/docs/integrations/auth/better-auth.mdx +1 -1
  140. package/.docs/raw/docs/integrations/auth/clerk.mdx +1 -1
  141. package/.docs/raw/docs/integrations/auth/next-auth.mdx +1 -1
  142. package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +3 -3
  143. package/.docs/raw/docs/integrations/frameworks/cloudflare-agents/overview.mdx +282 -0
  144. package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +2 -2
  145. package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +1 -1
  146. package/.docs/raw/docs/integrations/gateways/index.mdx +9 -4
  147. package/.docs/raw/docs/integrations/index.mdx +17 -5
  148. package/.docs/raw/docs/integrations/observability/langfuse.mdx +8 -1
  149. package/.docs/raw/docs/integrations/observability/langsmith.mdx +8 -4
  150. package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +17 -2
  151. package/.docs/raw/docs/migrations/toolkit-tools.mdx +226 -0
  152. package/.docs/raw/docs/primitives/chain-of-thought.mdx +10 -16
  153. package/.docs/raw/docs/primitives/composer.mdx +53 -0
  154. package/.docs/raw/docs/primitives/index.mdx +2 -2
  155. package/.docs/raw/docs/primitives/message.mdx +9 -10
  156. package/.docs/raw/docs/primitives/suggestion.mdx +9 -0
  157. package/.docs/raw/docs/react-native/hooks.mdx +57 -82
  158. package/.docs/raw/docs/react-native/index.mdx +4 -4
  159. package/.docs/raw/docs/react-native/migration.mdx +1 -1
  160. package/.docs/raw/docs/react-native/primitives.mdx +2 -2
  161. package/.docs/raw/docs/runtimes/a2a/client-and-hooks.mdx +7 -4
  162. package/.docs/raw/docs/runtimes/a2a/overview.mdx +2 -2
  163. package/.docs/raw/docs/runtimes/ag-ui/overview.mdx +2 -2
  164. package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +32 -1
  165. package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +2 -2
  166. package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +7 -2
  167. package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +1 -1
  168. package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +129 -1
  169. package/.docs/raw/docs/runtimes/concepts/threads.mdx +7 -1
  170. package/.docs/raw/docs/runtimes/custom/data-stream.mdx +27 -2
  171. package/.docs/raw/docs/runtimes/custom/external-store.mdx +9 -1
  172. package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +18 -7
  173. package/.docs/raw/docs/runtimes/custom/overview.mdx +2 -2
  174. package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +108 -38
  175. package/.docs/raw/docs/runtimes/google-adk/overview.mdx +2 -2
  176. package/.docs/raw/docs/runtimes/langchain.mdx +2 -2
  177. package/.docs/raw/docs/runtimes/langgraph/generative-ui.mdx +2 -2
  178. package/.docs/raw/docs/runtimes/langgraph/overview.mdx +2 -2
  179. package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +1 -1
  180. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +64 -50
  181. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +98 -86
  182. package/.docs/raw/docs/runtimes/opencode/overview.mdx +2 -2
  183. package/.docs/raw/docs/runtimes/opencode/quickstart.mdx +1 -1
  184. package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +12 -5
  185. package/.docs/raw/docs/tools/backend.mdx +136 -0
  186. package/.docs/raw/docs/tools/defining-tools.mdx +413 -0
  187. package/.docs/raw/docs/tools/dynamic-tools.mdx +110 -0
  188. package/.docs/raw/docs/tools/generative-ui.mdx +214 -0
  189. package/.docs/raw/docs/tools/index.mdx +76 -0
  190. package/.docs/raw/docs/{guides → tools}/interactables.mdx +3 -3
  191. package/.docs/raw/docs/tools/mcp-apps.mdx +231 -0
  192. package/.docs/raw/docs/{integrations/tools → tools}/mcp.mdx +77 -50
  193. package/.docs/raw/docs/{guides → tools}/multi-agent.mdx +19 -21
  194. package/.docs/raw/docs/tools/tool-ui.mdx +967 -0
  195. package/.docs/raw/docs/tools/user-managed-mcp.mdx +337 -0
  196. package/.docs/raw/docs/ui/composer-trigger-popover.mdx +11 -1
  197. package/.docs/raw/docs/ui/directive-text.mdx +3 -3
  198. package/.docs/raw/docs/ui/mcp-config.mdx +102 -0
  199. package/.docs/raw/docs/ui/model-selector.mdx +8 -8
  200. package/.docs/raw/docs/ui/part-grouping.mdx +84 -50
  201. package/.docs/raw/docs/ui/reasoning.mdx +4 -5
  202. package/.docs/raw/docs/ui/sources.mdx +17 -0
  203. package/.docs/raw/docs/ui/streamdown.mdx +34 -2
  204. package/.docs/raw/docs/ui/thread-list.mdx +2 -2
  205. package/.docs/raw/docs/ui/thread.mdx +2 -2
  206. package/.docs/raw/docs/ui/tool-group.mdx +5 -6
  207. package/.docs/raw/docs/utilities/heat-graph.mdx +1 -1
  208. package/README.md +14 -72
  209. package/dist/constants.d.ts +12 -9
  210. package/dist/constants.d.ts.map +1 -1
  211. package/dist/constants.js +13 -9
  212. package/dist/constants.js.map +1 -1
  213. package/dist/index.d.ts +7 -3
  214. package/dist/index.d.ts.map +1 -1
  215. package/dist/index.js +25 -24
  216. package/dist/index.js.map +1 -1
  217. package/dist/prepare-docs/code-examples.d.ts +4 -1
  218. package/dist/prepare-docs/code-examples.d.ts.map +1 -1
  219. package/dist/prepare-docs/code-examples.js +109 -121
  220. package/dist/prepare-docs/code-examples.js.map +1 -1
  221. package/dist/prepare-docs/copy-raw.d.ts +4 -1
  222. package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
  223. package/dist/prepare-docs/copy-raw.js +45 -42
  224. package/dist/prepare-docs/copy-raw.js.map +1 -1
  225. package/dist/prepare-docs/prepare.d.ts +1 -2
  226. package/dist/prepare-docs/prepare.js +17 -17
  227. package/dist/prepare-docs/prepare.js.map +1 -1
  228. package/dist/stdio.d.ts +1 -3
  229. package/dist/stdio.js +6 -3
  230. package/dist/stdio.js.map +1 -1
  231. package/dist/tools/docs.d.ts +20 -15
  232. package/dist/tools/docs.d.ts.map +1 -1
  233. package/dist/tools/docs.js +140 -161
  234. package/dist/tools/docs.js.map +1 -1
  235. package/dist/tools/examples.d.ts +20 -15
  236. package/dist/tools/examples.d.ts.map +1 -1
  237. package/dist/tools/examples.js +74 -86
  238. package/dist/tools/examples.js.map +1 -1
  239. package/dist/tools/tests/test-setup.d.ts +5 -2
  240. package/dist/tools/tests/test-setup.d.ts.map +1 -1
  241. package/dist/tools/tests/test-setup.js +21 -28
  242. package/dist/tools/tests/test-setup.js.map +1 -1
  243. package/dist/utils/logger.d.ts +8 -5
  244. package/dist/utils/logger.d.ts.map +1 -1
  245. package/dist/utils/logger.js +17 -17
  246. package/dist/utils/logger.js.map +1 -1
  247. package/dist/utils/mcp-format.d.ts +8 -5
  248. package/dist/utils/mcp-format.d.ts.map +1 -1
  249. package/dist/utils/mcp-format.js +9 -9
  250. package/dist/utils/mcp-format.js.map +1 -1
  251. package/dist/utils/mdx.d.ts +8 -6
  252. package/dist/utils/mdx.d.ts.map +1 -1
  253. package/dist/utils/mdx.js +22 -22
  254. package/dist/utils/mdx.js.map +1 -1
  255. package/dist/utils/paths.d.ts +9 -6
  256. package/dist/utils/paths.d.ts.map +1 -1
  257. package/dist/utils/paths.js +66 -76
  258. package/dist/utils/paths.js.map +1 -1
  259. package/dist/utils/security.d.ts +4 -1
  260. package/dist/utils/security.d.ts.map +1 -1
  261. package/dist/utils/security.js +19 -40
  262. package/dist/utils/security.js.map +1 -1
  263. package/package.json +5 -5
  264. package/.docs/organized/code-examples/with-parent-id-grouping.md +0 -596
  265. package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +0 -151
  266. package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +0 -230
  267. package/.docs/raw/docs/(reference)/api-reference/adapters/feedback-speech.mdx +0 -41
  268. package/.docs/raw/docs/(reference)/api-reference/context-providers/text-message-part-provider.mdx +0 -40
  269. package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +0 -260
  270. package/.docs/raw/docs/(reference)/api-reference/integrations/react-hook-form.mdx +0 -103
  271. package/.docs/raw/docs/(reference)/api-reference/integrations/vercel-ai-sdk.mdx +0 -254
  272. package/.docs/raw/docs/guides/tool-ui.mdx +0 -858
  273. package/.docs/raw/docs/guides/tools.mdx +0 -675
  274. package/dist/prepare-docs/prepare.d.ts.map +0 -1
  275. package/dist/stdio.d.ts.map +0 -1
  276. /package/.docs/raw/docs/{(reference)/migrations → migrations}/deprecation-policy.mdx +0 -0
  277. /package/.docs/raw/docs/{(reference) → migrations}/react-compatibility.mdx +0 -0
  278. /package/.docs/raw/docs/{(reference)/migrations → migrations}/react-langgraph-v0-7.mdx +0 -0
  279. /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-11.mdx +0 -0
  280. /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-12.mdx +0 -0
  281. /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-14.mdx +0 -0
@@ -0,0 +1,337 @@
1
+ ---
2
+ title: User-managed MCP servers
3
+ description: Let end users add and authenticate MCP servers from the browser with @assistant-ui/react-mcp.
4
+ ---
5
+
6
+ [`@assistant-ui/react-mcp`](https://npmjs.com/package/@assistant-ui/react-mcp) is the user-facing layer for MCP. Where the [server-side MCP guide](/docs/tools/mcp) wires a single fixed set of MCP servers into your API route, this package lets *end users* see a list of connectors, sign in via OAuth, paste a custom server URL, and have the resulting tool catalog flow into the chat — automatically.
7
+
8
+ Two ways a server reaches the user:
9
+
10
+ - **Connector** — a preset declared by the app developer with `defineConnector(...)`. The user just clicks Connect (and completes auth).
11
+ - **Custom server** — the user supplies the URL, name, and auth in `<McpAddFormPrimitive>`. Hide the add UI to disable.
12
+
13
+ Both flow through one connection lifecycle, one persisted state surface, and one tool registration path.
14
+
15
+ ## How it works
16
+
17
+ ```
18
+ useAui({ mcp: McpManagerResource({ connectors }) })
19
+ │
20
+ ├─ Tap resource — connection lifecycle, server lookup, OAuth/bearer auth
21
+ ├─ Auto-mounts the modelContext scope when no chat runtime provides one
22
+ └─ Registers connected tools as frontend tools — your chat sees them automatically
23
+ ```
24
+
25
+ The manager is a single tap resource. Mount it with `useAui` like any other scope. OAuth (PKCE + RFC 7591 dynamic client registration), bearer, and "no auth" are first-class. Token refresh runs inside the MCP SDK on 401; this package mediates persistence and the redirect step.
26
+
27
+ ## Setup
28
+
29
+ <Steps>
30
+ <Step>
31
+
32
+ ### Install
33
+
34
+ <InstallCommand npm={["@assistant-ui/react-mcp"]} />
35
+
36
+ </Step>
37
+ <Step>
38
+
39
+ ### Mount the manager
40
+
41
+ Declare your connectors and provide the `mcp` scope on `useAui`. No provider wrapper, no imperative hooks:
42
+
43
+ ```tsx title="app/providers.tsx"
44
+ "use client";
45
+
46
+ import { AuiProvider, useAui } from "@assistant-ui/react";
47
+ import { McpManagerResource, defineConnector } from "@assistant-ui/react-mcp";
48
+
49
+ const connectors = [
50
+ defineConnector({
51
+ id: "linear",
52
+ name: "Linear",
53
+ url: "https://mcp.linear.app",
54
+ auth: { type: "oauth", scopes: ["read"] },
55
+ icon: "/icons/linear.svg",
56
+ }),
57
+ defineConnector({
58
+ id: "weather",
59
+ name: "Weather",
60
+ url: "https://mcp.example.com/weather",
61
+ auth: { type: "none" },
62
+ }),
63
+ ];
64
+
65
+ export function Providers({ children }: { children: React.ReactNode }) {
66
+ const aui = useAui({ mcp: McpManagerResource({ connectors }) });
67
+ return <AuiProvider value={aui}>{children}</AuiProvider>;
68
+ }
69
+ ```
70
+
71
+ Defaults baked in:
72
+
73
+ - `storage` — `McpLocalStorage()` (override for production; see [Storage](#storage))
74
+ - `oauthRedirectUri` — `${window.location.origin}/mcp/callback`
75
+ - `autoConnect` — `true` (connect on mount when usable auth is persisted)
76
+
77
+ </Step>
78
+ <Step>
79
+
80
+ ### Pick your UI
81
+
82
+ You have two options:
83
+
84
+ **Drop-in shadcn dialog** (recommended for most apps) — install the `mcp-config` component via the assistant-ui registry, then render `<McpConfigDialog />` anywhere inside the provider. You get a styled trigger, server cards, status badges, error banners, and the add form for free:
85
+
86
+ <InstallCommand shadcn={["mcp-config"]} />
87
+
88
+ ```tsx title="app/page.tsx"
89
+ import { McpConfigDialog } from "@/components/assistant-ui/mcp-config";
90
+
91
+ export default function Page() {
92
+ return (
93
+ <header className="flex items-center justify-between">
94
+ <h1>My app</h1>
95
+ <McpConfigDialog />
96
+ </header>
97
+ );
98
+ }
99
+ ```
100
+
101
+ Pass children to override the trigger:
102
+
103
+ ```tsx
104
+ <McpConfigDialog>
105
+ <Button variant="ghost">Servers</Button>
106
+ </McpConfigDialog>
107
+ ```
108
+
109
+ **Compose your own from primitives** — three namespaces, all unstyled and `data-*`-driven. The iteration primitives take a **render function** so the body re-runs per server with the right scope:
110
+
111
+ ```tsx title="app/mcp/page.tsx"
112
+ "use client";
113
+
114
+ import {
115
+ McpManagerPrimitive,
116
+ McpServerPrimitive,
117
+ } from "@assistant-ui/react-mcp";
118
+
119
+ const ServerCard = () => (
120
+ <McpServerPrimitive.Root>
121
+ <McpServerPrimitive.Icon />
122
+ <McpServerPrimitive.Name />
123
+ <McpServerPrimitive.Status />
124
+ <McpServerPrimitive.ConnectButton>Connect</McpServerPrimitive.ConnectButton>
125
+ <McpServerPrimitive.DisconnectButton>Disconnect</McpServerPrimitive.DisconnectButton>
126
+ <McpServerPrimitive.OAuthLink>Authorize ↗</McpServerPrimitive.OAuthLink>
127
+ <McpServerPrimitive.RemoveButton>Remove</McpServerPrimitive.RemoveButton>
128
+ <McpServerPrimitive.Error />
129
+ </McpServerPrimitive.Root>
130
+ );
131
+
132
+ export default function McpPage() {
133
+ return (
134
+ <McpManagerPrimitive.Root>
135
+ <h2>Connectors</h2>
136
+ <McpManagerPrimitive.Connectors>
137
+ {() => <ServerCard />}
138
+ </McpManagerPrimitive.Connectors>
139
+
140
+ <h2>Your servers</h2>
141
+ <McpManagerPrimitive.CustomServers>
142
+ {() => <ServerCard />}
143
+ </McpManagerPrimitive.CustomServers>
144
+
145
+ <McpManagerPrimitive.AddCustomTrigger>
146
+ Add custom server
147
+ </McpManagerPrimitive.AddCustomTrigger>
148
+ </McpManagerPrimitive.Root>
149
+ );
150
+ }
151
+ ```
152
+
153
+ To disable custom servers entirely, just don't render `AddCustomTrigger` and `CustomServers`.
154
+
155
+ The iteration primitives wrap each item in an `McpServerByIdProvider`, so the nested `<McpServerPrimitive.*>` automatically reads the right scope. `<ConnectButton>`, `<DisconnectButton>`, `<OAuthLink>` and `<RemoveButton>` only render when the relevant state matches — no manual gating. `<RemoveButton>` is also hidden on connector items (which the user can't remove).
156
+
157
+ </Step>
158
+ <Step>
159
+
160
+ ### Add the custom-server form
161
+
162
+ ```tsx
163
+ <McpAddFormPrimitive.Root onSubmitted={() => closeDialog()}>
164
+ <McpAddFormPrimitive.NameField />
165
+ <McpAddFormPrimitive.UrlField />
166
+ <McpAddFormPrimitive.AuthSelect /> {/* none | bearer | oauth */}
167
+ <McpAddFormPrimitive.AuthFields /> {/* token or scope input depending on selection */}
168
+ <McpAddFormPrimitive.Error />
169
+ <McpAddFormPrimitive.Submit>Add</McpAddFormPrimitive.Submit>
170
+ <McpAddFormPrimitive.Cancel>Cancel</McpAddFormPrimitive.Cancel>
171
+ </McpAddFormPrimitive.Root>
172
+ ```
173
+
174
+ The form owns its own draft state and submits via `aui.mcp().addCustomServer(...)`. Pass a render function to `AuthFields` to fully customize it.
175
+
176
+ </Step>
177
+ <Step>
178
+
179
+ ### Handle the OAuth callback
180
+
181
+ Add a route at `/mcp/callback` (or whatever you set `oauthRedirectUri` to):
182
+
183
+ ```tsx title="app/mcp/callback/page.tsx"
184
+ "use client";
185
+
186
+ import { McpOAuthCallback } from "@assistant-ui/react-mcp";
187
+ import { useRouter } from "next/navigation";
188
+ import { Providers } from "../../providers";
189
+
190
+ export default function Callback() {
191
+ const router = useRouter();
192
+ return (
193
+ <Providers>
194
+ <McpOAuthCallback onComplete={() => router.replace("/mcp")} />
195
+ </Providers>
196
+ );
197
+ }
198
+ ```
199
+
200
+ The callback reads `?state=...&code=...` from the URL, derives the target server id (encoded in the OAuth `state` parameter automatically), and calls `completeAuth` on the right server.
201
+
202
+ </Step>
203
+ <Step>
204
+
205
+ ### That's it — the chat sees your tools
206
+
207
+ `McpManagerResource` registers connected tools as **frontend tools** with the `modelContext` scope. Any chat runtime mounted in the same store (e.g. `@assistant-ui/react-ai-sdk`'s `useChatRuntime`) sees them and exposes them to the model — no `useMcpTools` hook, no adapter call.
208
+
209
+ ```tsx
210
+ "use client";
211
+ import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
212
+
213
+ export function Chat() {
214
+ const runtime = useChatRuntime({ api: "/api/chat" });
215
+ /* … */
216
+ }
217
+ ```
218
+
219
+ Tool names are prefixed `serverId__toolName` to avoid collisions across connected servers. The toolkit re-registers whenever a server connects / disconnects or its tool list changes.
220
+
221
+ If no chat runtime is mounted, `McpManagerResource` brings its own minimal `modelContext` along. Tools are still callable directly:
222
+
223
+ ```ts
224
+ // In an event handler — never in render. See the tap conventions.
225
+ const aui = useAui();
226
+ const out = await aui.mcp().server({ id: "linear" }).callTool("search", { q });
227
+ ```
228
+
229
+ </Step>
230
+ </Steps>
231
+
232
+ ## Storage
233
+
234
+ All persisted state — custom server records, OAuth tokens, PKCE verifiers, DCR client info — goes through a single `MCPStorage` resource. Three built-ins:
235
+
236
+ - `McpLocalStorage()` — default. Stores under the `aui-mcp:` prefix in `window.localStorage`.
237
+ - `McpMemoryStorage()` — in-process Map. Use for SSR/tests where localStorage is absent.
238
+ - `McpCustomStorage({...})` — bring your own load/save. Use for app-controlled backends (e.g. POST to your API).
239
+
240
+ ```tsx
241
+ import { McpManagerResource, McpCustomStorage } from "@assistant-ui/react-mcp";
242
+
243
+ const aui = useAui({
244
+ mcp: McpManagerResource({
245
+ connectors,
246
+ storage: McpCustomStorage({
247
+ loadCustomServers: async () => fetch("/api/mcp/servers").then((r) => r.json()),
248
+ saveCustomServers: async (records) =>
249
+ fetch("/api/mcp/servers", { method: "PUT", body: JSON.stringify(records) }),
250
+ loadAuthState: async (id) =>
251
+ fetch(`/api/mcp/auth/${id}`).then((r) => (r.ok ? r.json() : null)),
252
+ saveAuthState: async (id, state) =>
253
+ fetch(`/api/mcp/auth/${id}`, { method: "PUT", body: JSON.stringify(state) }),
254
+ clearAuthState: async (id) =>
255
+ fetch(`/api/mcp/auth/${id}`, { method: "DELETE" }),
256
+ }),
257
+ }),
258
+ });
259
+ ```
260
+
261
+ <Callout type="warn">
262
+ `McpLocalStorage` stores tokens in plain text and is XSS-exposed. For anything beyond local prototyping, use `McpCustomStorage` against an HTTP-only-cookie-backed endpoint, or wrap localStorage with your own encrypted serializer.
263
+ </Callout>
264
+
265
+ ## Auth
266
+
267
+ Three modes, declared per-connector or per-custom-record:
268
+
269
+ ```ts
270
+ { type: "none" } // no auth header
271
+ { type: "bearer", token?: "…" } // Authorization: Bearer …
272
+ { type: "oauth", // PKCE + DCR + refresh
273
+ scopes?: ["read"],
274
+ authorizationEndpoint?: "…", // overrides RFC 8414 discovery
275
+ tokenEndpoint?: "…",
276
+ registrationEndpoint?: "…",
277
+ clientId?: "…", // skip DCR with a static client
278
+ clientSecret?: "…",
279
+ }
280
+ ```
281
+
282
+ The OAuth provider implements the MCP SDK's `OAuthClientProvider`. The SDK handles discovery (RFC 8414), DCR (RFC 7591), PKCE, token exchange, and refresh; this package mediates `MCPStorage` reads/writes and the redirect step. The server id is embedded in the OAuth `state` parameter so a single `/mcp/callback` route knows which server to complete.
283
+
284
+ ## State & methods
285
+
286
+ Render-time state — `useAuiState`:
287
+
288
+ ```ts
289
+ import { useAuiState } from "@assistant-ui/store";
290
+
291
+ const isHydrated = useAuiState((s) => s.mcp.isHydrated);
292
+ const connectionState = useAuiState((s) => s.mcpServer.connectionState);
293
+ // ^ requires McpServerByIdProvider
294
+ ```
295
+
296
+ Imperative methods — `useAui` + resolve in a callback (never during render — see the [tap skill](https://github.com/assistant-ui/assistant-ui/blob/main/.claude/skills/tap/SKILL.md) for why):
297
+
298
+ ```ts
299
+ const aui = useAui();
300
+
301
+ // inside an event handler:
302
+ await aui.mcp().addCustomServer({ name, url, auth: { type: "bearer", token } });
303
+ await aui.mcp().server({ id }).connect();
304
+ await aui.mcp().server({ id }).callTool("echo", { text: "hi" });
305
+ ```
306
+
307
+ ## v1 scope
308
+
309
+ What ships:
310
+
311
+ - Tool listing and invocation, auto-registered as frontend tools
312
+ - OAuth (PKCE + DCR), bearer, none
313
+ - StreamableHTTP transport
314
+ - Manual connect/disconnect
315
+
316
+ What's deferred:
317
+
318
+ - Resources, prompts, sampling
319
+ - Auto-reconnect with backoff
320
+ - Per-tool enable/disable persistence
321
+ - Per-tool consent prompts
322
+ - Out-of-the-box token encryption (use `McpCustomStorage` against a server endpoint)
323
+
324
+ ## Related
325
+
326
+ <Cards>
327
+ <Card
328
+ title="Server-side MCP"
329
+ description="App-developer-controlled MCP servers wired into the API route."
330
+ href="/docs/tools/mcp"
331
+ />
332
+ <Card
333
+ title="Tools and tool UI"
334
+ description="Build custom renderers for tool calls and approvals."
335
+ href="/docs/tools/defining-tools"
336
+ />
337
+ </Cards>
@@ -158,10 +158,20 @@ const commandHandlers: Record<string, () => void> = {
158
158
  | --- | --- |
159
159
  | <Kbd>ArrowDown</Kbd> | Highlight next item |
160
160
  | <Kbd>ArrowUp</Kbd> | Highlight previous item |
161
- | <Kbd>Enter</Kbd> | Select highlighted item / drill into category |
161
+ | <Kbd>Enter</Kbd> / <Kbd>Tab</Kbd> | Select highlighted item / drill into category |
162
+ | <Kbd>Shift + Enter</Kbd> | Insert newline (popover stays open) |
163
+ | <Kbd>Shift + Tab</Kbd> | Pass through (native focus traversal) |
162
164
  | <Kbd>Escape</Kbd> | Close popover |
163
165
  | <Kbd>Backspace</Kbd> | Go back to categories (when query is empty) |
164
166
 
167
+ ## Accessibility
168
+
169
+ The popover implements the WAI-ARIA editable combobox pattern.
170
+
171
+ - The listbox container has `role="listbox"` and each item has `role="option"` plus `aria-selected`.
172
+ - When a popover is open, `ComposerPrimitive.Input` (the underlying `<textarea>`) automatically receives `aria-controls`, `aria-expanded="true"`, `aria-haspopup="listbox"`, and `aria-activedescendant` pointing at the highlighted option. Attributes are removed when the popover closes.
173
+ - When `ComposerPrimitive.Input` is rendered outside a `TriggerPopoverRoot`, no ARIA attributes are added.
174
+
165
175
  ## API Reference
166
176
 
167
177
  | Prop | Type | Default | Description |
@@ -49,7 +49,7 @@ Keep your markdown renderer (e.g. `MarkdownText`) for assistant messages — ass
49
49
 
50
50
  ```tsx
51
51
  import { createDirectiveText } from "@/components/assistant-ui/directive-text";
52
- import { unstable_defaultDirectiveFormatter } from "@assistant-ui/core";
52
+ import { unstable_defaultDirectiveFormatter } from "@assistant-ui/react";
53
53
  import { FileTextIcon, SparklesIcon, UserIcon, WrenchIcon } from "lucide-react";
54
54
 
55
55
  const DirectiveTextWithIcons = createDirectiveText(
@@ -74,7 +74,7 @@ A matching `iconMap` / `fallbackIcon` option is accepted by [`ComposerTriggerPop
74
74
  The default format is `:type[label]{name=id}`. For a different format, build a custom `Unstable_DirectiveFormatter` and wrap it with `createDirectiveText`:
75
75
 
76
76
  ```tsx
77
- import type { Unstable_DirectiveFormatter } from "@assistant-ui/core";
77
+ import type { Unstable_DirectiveFormatter } from "@assistant-ui/react";
78
78
  import { createDirectiveText } from "@/components/assistant-ui/directive-text";
79
79
 
80
80
  const slashFormatter: Unstable_DirectiveFormatter = {
@@ -97,7 +97,7 @@ Because `directive-text.tsx` is copied into your project, you can also edit it d
97
97
 
98
98
  ### `DirectiveText`
99
99
 
100
- A `TextMessagePartComponent` that parses `:type[label]{name=id}` directives and renders them as inline chips. Uses the default formatter from `@assistant-ui/core` and renders chips without icons. For per-type icons, build a component with `createDirectiveText(formatter, { iconMap })`.
100
+ A `TextMessagePartComponent` that parses `:type[label]{name=id}` directives and renders them as inline chips. Uses the default formatter from `@assistant-ui/react` and renders chips without icons. For per-type icons, build a component with `createDirectiveText(formatter, { iconMap })`.
101
101
 
102
102
  ### `createDirectiveText(formatter, options?)`
103
103
 
@@ -0,0 +1,102 @@
1
+ ---
2
+ title: MCP Config Dialog
3
+ description: Drop-in shadcn dialog that lists MCP connectors and custom servers, with inline OAuth/bearer auth controls and an add form.
4
+ platforms: ["react"]
5
+ ---
6
+
7
+ `McpConfigDialog` is a shadcn template that wraps the [`@assistant-ui/react-mcp`](/docs/tools/user-managed-mcp) primitives. Render it anywhere inside an `McpManagerResource`-mounted client and your users get a styled MCP server panel — no manual primitive composition.
8
+
9
+ ## Getting Started
10
+
11
+ <Steps>
12
+ <Step>
13
+
14
+ ### Install the package and the component
15
+
16
+ <InstallCommand npm={["@assistant-ui/react-mcp"]} />
17
+
18
+ <InstallCommand shadcn={["mcp-config"]} />
19
+
20
+ </Step>
21
+ <Step>
22
+
23
+ ### Mount the manager
24
+
25
+ ```tsx title="app/providers.tsx"
26
+ "use client";
27
+
28
+ import { AuiProvider, useAui } from "@assistant-ui/react";
29
+ import { McpManagerResource, defineConnector } from "@assistant-ui/react-mcp";
30
+
31
+ const connectors = [
32
+ defineConnector({
33
+ id: "linear",
34
+ name: "Linear",
35
+ url: "https://mcp.linear.app",
36
+ auth: { type: "oauth", scopes: ["read"] },
37
+ }),
38
+ ];
39
+
40
+ export function Providers({ children }: { children: React.ReactNode }) {
41
+ const aui = useAui({ mcp: McpManagerResource({ connectors }) });
42
+ return <AuiProvider value={aui}>{children}</AuiProvider>;
43
+ }
44
+ ```
45
+
46
+ </Step>
47
+ <Step>
48
+
49
+ ### Drop the dialog in
50
+
51
+ ```tsx title="app/page.tsx"
52
+ import { McpConfigDialog } from "@/components/assistant-ui/mcp-config";
53
+
54
+ export default function Page() {
55
+ return (
56
+ <header className="flex items-center justify-between">
57
+ <h1>My app</h1>
58
+ <McpConfigDialog />
59
+ </header>
60
+ );
61
+ }
62
+ ```
63
+
64
+ That's it. The default trigger is an outline `"🔌 MCP servers"` button. Click it to open the dialog, which renders a **Connectors** list (your app-defined presets with connect/authorize/disconnect controls), a **Custom servers** list (user-added entries with the same controls plus a remove button), and an inline **Add server** form for URL + name + auth selection.
65
+
66
+ </Step>
67
+ <Step>
68
+
69
+ ### Override the trigger (optional)
70
+
71
+ Pass children to swap the default button for your own:
72
+
73
+ ```tsx
74
+ <McpConfigDialog>
75
+ <Button variant="ghost">Servers</Button>
76
+ </McpConfigDialog>
77
+ ```
78
+
79
+ </Step>
80
+ <Step>
81
+
82
+ ### Wire up the OAuth callback
83
+
84
+ Required for any OAuth-enabled connector or custom server. See the [OAuth callback section in the react-mcp guide](/docs/tools/user-managed-mcp#handle-the-oauth-callback) for the route handler.
85
+
86
+ </Step>
87
+ </Steps>
88
+
89
+ ## Related
90
+
91
+ <Cards>
92
+ <Card
93
+ title="User-managed MCP servers"
94
+ description="Full @assistant-ui/react-mcp guide — connectors, custom servers, OAuth, storage, custom primitives."
95
+ href="/docs/tools/user-managed-mcp"
96
+ />
97
+ <Card
98
+ title="Server-side MCP"
99
+ description="App-developer-controlled MCP servers wired into the API route."
100
+ href="/docs/tools/mcp"
101
+ />
102
+ </Cards>
@@ -34,11 +34,11 @@ const ComposerAction: FC = () => {
34
34
  <div className="flex items-center gap-1">
35
35
  <ModelSelector
36
36
  models={[
37
- { id: "gpt-4o-mini", name: "GPT-4o Mini", description: "Fast and efficient" },
38
- { id: "gpt-4o", name: "GPT-4o", description: "Balanced performance" },
39
- { id: "o3", name: "o3", description: "Most capable" },
37
+ { id: "gpt-5.4-nano", name: "GPT-5.4 Nano", description: "Fast and efficient" },
38
+ { id: "gpt-5.4-mini", name: "GPT-5.4 Mini", description: "Balanced performance" },
39
+ { id: "gpt-5.5", name: "GPT-5.5", description: "Most capable" },
40
40
  ]}
41
- defaultValue="gpt-4o-mini"
41
+ defaultValue="gpt-5.4-nano"
42
42
  size="sm"
43
43
  />
44
44
  </div>
@@ -58,7 +58,7 @@ export async function POST(req: Request) {
58
58
  const { messages, config } = await req.json();
59
59
 
60
60
  const result = streamText({
61
- model: openai(config?.modelName ?? "gpt-4o"),
61
+ model: openai(config?.modelName ?? "gpt-5.4-nano"),
62
62
  messages: await convertToModelMessages(messages),
63
63
  });
64
64
 
@@ -102,9 +102,9 @@ Each model in the `models` array supports:
102
102
  ```tsx
103
103
  const models = [
104
104
  {
105
- id: "gpt-4o", // Sent to backend as config.modelName
106
- name: "GPT-4o", // Display name in trigger and items
107
- description: "Most capable", // Optional subtitle in items only
105
+ id: "gpt-5.4-nano", // Sent to backend as config.modelName
106
+ name: "GPT-5.4 Nano", // Display name in trigger and items
107
+ description: "Fast and efficient", // Optional subtitle in items only
108
108
  icon: <SparklesIcon />, // Optional icon (any ReactNode)
109
109
  },
110
110
  ];