McpConnect
Install guide for an MCP server with per-client tabs for Claude Code, Claude Desktop, Cursor, VS Code and generic JSON, copyable snippets with a masked token, one-click deep links and a connection test.
Code
import { McpConnect } from "@fadymondy/nasaq/web";declare const token: string;export function Connect() { return <McpConnect serverUrl="https://mcp.example.com/mcp" serverName="example" token={token} onTest={async () => ({ ok: true, tools: 12 })} />;}Integrations · beta
Live examples and controls: McpConnect in the lab.
Install
npx shadcn@latest add https://docs.nasaqui.com/r/mcp-connect.jsonTell people how to connect their AI tool to your MCP server. One tab per client with the exact command or JSON, a copy button, a one-click install link where the client has one, the server URL and token, and a button that tests the connection.
When to use
- Next to the API keys of a product that ships an MCP server.
- Docs or onboarding pages that need copy-ready client config.
When not to use
Import
import { McpConnect } from "@fadymondy/nasaq/web";
// inside this monorepo: "@nasaq/web"Quick start
import { McpConnect } from "@fadymondy/nasaq/web";
declare const token: string;
export function Connect() {
return <McpConnect serverUrl="https://mcp.example.com/mcp" serverName="example" token={token} onTest={async () => ({ ok: true, tools: 12 })} />;
}Anatomy
McpConnect data-slot="mcp-connect" (Card)
├─ server URL CopyField (dir="ltr")
├─ token masked field: show/hide, copy
├─ Tabs one per client
│ ├─ numbered steps
│ ├─ snippet CodeBlock with target (file or Terminal) and copy
│ └─ deep link "Add to Cursor" / "Install in VS Code"
└─ Test connection Alert: success (latency, tools) or failureAPI
McpConnect: every div prop except children, plus:
| Prop | Type | Default | Description |
|---|---|---|---|
serverUrl | string | required | Streamable HTTP endpoint. |
serverName | string | "nasaq" | Key the server gets in each config. |
token | string | Put in the snippets. Shown masked; copying gives the real one. Omit for a YOUR_TOKEN placeholder. | |
tokenHeader | string | "Authorization" | Sent as Bearer <token>. Any other header carries the bare token. |
clients | McpClientId[] | all five | claude-code, claude-desktop, cursor, vscode, generic. |
defaultClient | McpClientId | first | Tab open first. |
onTest | () => Promise<{ ok, latencyMs?, tools?, error? }> | Shows Test connection. A rejection shows a generic failure. | |
labels | Partial<McpConnectLabels> | Override any string. |
Helpers (pure, tested): mcpSnippet(client, server, tokenOverride?) returns { target, language, code, deepLink? };
maskToken(token).
Examples
Only two clients
import { McpConnect } from "@fadymondy/nasaq/web";
export const Two = () => <McpConnect serverUrl="https://mcp.example.com/mcp" clients={["claude-code", "cursor"]} />;Build a snippet yourself
import { mcpSnippet } from "@fadymondy/nasaq/web";
export const cmd = mcpSnippet("claude-code", { name: "example", url: "https://mcp.example.com/mcp", token: "abc" }).code;Accessibility
- Tabs are Base UI
Tabs: arrow keys move, the panel is labelled by its tab. - The token field has a label and the show/hide button has a state-aware name. Test results are announced (
role="status"oralert).
RTL & i18n
- English and Arabic strings follow the Nasaq locale. URLs, commands, JSON and tokens are
dir="ltr".
Styling & tokens
- Built on
Card,Tabs,CodeBlock,CopyField,Alertand--nq-*tokens. - Target
[data-slot="mcp-connect"].
Do / Don't
- Do give a scoped, expiring token, not a master key.
- Do keep the token masked on screen; the copy button gives the real one.
- Don't put the token in a deep link you log or share.
- Client config formats change: check them against each client's docs when you upgrade.
Related
Lab
https://docs.nasaqui.com/?path=/docs/components-integrations-mcp-connect--docs
Steps layout and the connect sheet
<McpConnect layout="steps" /> drops the card and tabs: the client comes from a select and the setup is
numbered steps with the snippet inline. Use it inside a sheet or dialog.
<McpConnectSheet types={[...]} /> is "Connect to your project" as a side-over. A green ConnectButton
pill opens it, the connection types (MCP, API, SDK…) sit as tiles across the top, and the chosen type's
content fills the panel. Pass trigger={null} and open to drive it yourself, or your own trigger element.
App picker for non-technical people (McpConnectApps)
For people who have never heard of MCP: they pick the app they use by its logo, then follow two or three plain numbered steps with one big button each.
<McpConnectSheet
types={[{ value: "mcp", label: "MCP", content: (
<McpConnectApps
product="Mahaam"
server={{ name: "mahaam", url: "https://mahaam.app/api/mcp" }}
oauth // Claude, ChatGPT, Claude Code sign in; no key
renderKeyForm={(done) => <MintKey onMinted={done} />} // Cursor, VS Code, other
tryHint="“What are my tasks today?”"
/>
) }]}
/>oauth (default true) means the server supports MCP authorization discovery. Turn it off and every app asks for a key. Brand marks are exported as ClaudeLogo, ClaudeCodeLogo, OpenAILogo, CursorLogo, VSCodeLogo, McpLogo and the tile McpAppLogo.
IntegrationConnector
Connections page for OAuth services such as Google Analytics, Search Console, YouTube, GitHub and Slack, with cards, a scope consent dialog, account or property picker, status, reconnect and confirmed disconnect.
Placement Settings
Where a plugin or module appears in the app shell. Sidebar, header, side panel, floating widget or hidden, as radio cards with a small picture of the shell; its order; and whether the app opens on it. Keeps a draft, shows what is unsaved and saves only what changed.