MCP Config Dialog

Drop-in shadcn dialog that lists MCP connectors and custom servers, with inline OAuth/bearer auth controls and an add form.

McpConfigDialog is a shadcn template that wraps the @assistant-ui/react-mcp primitives. Render it anywhere inside an McpManagerResource-mounted client and your users get a styled MCP server panel — no manual primitive composition.

Getting Started

Install the package and the component

npm install @assistant-ui/react-mcp
npx shadcn@latest add https://r.assistant-ui.com/mcp-config.json

Mount the manager

app/providers.tsx
"use client";

import { AuiProvider, useAui } from "@assistant-ui/react";
import { McpManagerResource, defineConnector } from "@assistant-ui/react-mcp";

const connectors = [
  defineConnector({
    id: "linear",
    name: "Linear",
    url: "https://mcp.linear.app",
    auth: { type: "oauth", scopes: ["read"] },
  }),
];

export function Providers({ children }: { children: React.ReactNode }) {
  const aui = useAui({ mcp: McpManagerResource({ connectors }) });
  return <AuiProvider value={aui}>{children}</AuiProvider>;
}

Drop the dialog in

app/page.tsx
import { McpConfigDialog } from "@/components/assistant-ui/mcp-config";

export default function Page() {
  return (
    <header className="flex items-center justify-between">
      <h1>My app</h1>
      <McpConfigDialog />
    </header>
  );
}

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.

Override the trigger (optional)

Pass children to swap the default button for your own:

<McpConfigDialog>
  <Button variant="ghost">Servers</Button>
</McpConfigDialog>

Wire up the OAuth callback

Required for any OAuth-enabled connector or custom server. See the OAuth callback section in the react-mcp guide for the route handler.