---
title: "Connect MCP clients"
description: "Connect AI assistants to your MCP server and add install buttons to your documentation."
canonical_url: "https://mcp-toolkit.nuxt.dev/getting-started/connection"
---
# Connect MCP clients

> Connect AI assistants to your MCP server and add install buttons to your documentation.

## Overview

Once your MCP server is running, you can connect AI assistants like Cursor, VS Code, and ChatGPT to use your tools, resources, and prompts.

The module also provides components and routes to help your users install your MCP server in one click.

## add-mcp

The [add-mcp](https://npmx.dev/package/add-mcp) CLI can register a **remote** (streamable HTTP) MCP server with Cursor, Claude Code, VS Code, Codex, and [several other coding agents](https://npmx.dev/package/add-mcp) in one step.

Use the URL that matches where the app runs: **http://… for local dev**, **https://… in production** (public MCP endpoints should use HTTPS). If you changed `mcp.route` in `nuxt.config`, append that path instead of `/mcp`.

<code-group>

```bash [Local dev]
npx add-mcp http://localhost:3000/mcp
```

```bash [Production]
npx add-mcp https://your-app.example.com/mcp
```

</code-group>

Run the command from any directory; it updates agent config files (e.g. project `.cursor/mcp.json`). Options such as `-a cursor`, `-y`, or `--header` for authenticated endpoints are described in the [add-mcp package docs](https://npmx.dev/package/add-mcp).

## Share your MCP with users (production)

When your Nuxt app is deployed, you give **your users** a stable MCP URL. They will plug the same shape of URL into their assistant as for localhost—only the host and scheme change.

### What to publish

<table>
<thead>
  <tr>
    <th>
      You share
    </th>
    
    <th>
      Example
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Public MCP endpoint
    </td>
    
    <td>
      <code>
        https://your-product.com/mcp
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Custom route
    </td>
    
    <td>
      <code>
        https://your-product.com/api/mcp
      </code>
      
       if <code>
        mcp.route
      </code>
      
       is <code>
        /api/mcp
      </code>
    </td>
  </tr>
</tbody>
</table>

Prefer **HTTPS** on the public internet. Your hosting provider’s assigned URL (e.g. `https://my-app.vercel.app/mcp`) is fine until you add a custom domain.

### One-liner for users ([add-mcp](https://npmx.dev/package/add-mcp))

Document this in your README or docs so people can register your server quickly:

```bash
npx add-mcp https://your-product.com/mcp
```

If your MCP is behind auth, document the required headers and point people to `add-mcp --header 'Authorization: Bearer …'` (or your provider’s pattern).

### Buttons and badges for docs / README

Give non-CLI users a single click:

- **InstallButton** in Vue or MDC — set `url` to your **production** MCP URL (see examples with `https://my-app.com/mcp` below).
- **README badges** — Markdown badges that open the IDE installer and work in GitHub or any site.

Example for your landing or documentation:

<install-button name="your-product-mcp" url="https://your-product.com/mcp">



</install-button>

<install-button name="your-product-mcp" url="https://your-product.com/mcp" ide="vscode">



</install-button>

### Manual config you can copy for users

Same JSON as in the [IDE sections below](#connect-your-ide), but with your live URL:

```json
{
  "url": "https://your-product.com/mcp"
}
```

Cursor and VS Code expect this inside their respective `mcpServers` / `servers` shapes — mirror the full examples under [Cursor](#cursor) and [VS Code](#vs-code) and replace the localhost URL.

## Connect Your IDE

The steps below use **localhost** while you develop. To publish instructions for your audience, reuse the same patterns with your **production** `https://…` URL — see [Share your MCP with users (production)](#share-your-mcp-with-users-production).

### Cursor

Click the button below to add your local MCP server to Cursor:

<install-button name="local-mcp" url="http://localhost:3000/mcp" ide="cursor">



</install-button>

Or manually add it to your Cursor settings (`~/.cursor/mcp.json`):

```json [~/.cursor/mcp.json]
{
  "mcpServers": {
    "my-nuxt-app": {
      "url": "http://localhost:3000/mcp"
    }
  }
}
```

### VS Code

Click the button below to add your local MCP server to VS Code:

<install-button name="local-mcp" url="http://localhost:3000/mcp" ide="vscode">



</install-button>

Or manually add the server to your VS Code MCP configuration (`.vscode/mcp.json`):

```json [.vscode/mcp.json]
{
  "servers": {
    "my-nuxt-app": {
      "type": "http",
      "url": "http://localhost:3000/mcp"
    }
  }
}
```

<callout color="info" icon="i-lucide-info">

Replace `my-nuxt-app` with your project name and update the URL if you're using a custom route or port.

</callout>

## Limit available tools

Clients can send the `X-MCP-Tools` HTTP header with a comma-separated list of tool names to expose only those tools. Names must match what `tools/list` returns (including filename-generated kebab-case). Unknown names return HTTP 400. Omit the header to keep the full catalog.

This is applied automatically — no `server/mcp/index.ts` required.

```json [~/.cursor/mcp.json]
{
  "mcpServers": {
    "my-nuxt-app": {
      "url": "http://localhost:3000/mcp",
      "headers": {
        "X-MCP-Tools": "search-icons, get-component"
      }
    }
  }
}
```

```json [.vscode/mcp.json]
{
  "servers": {
    "my-nuxt-app": {
      "type": "http",
      "url": "http://localhost:3000/mcp",
      "headers": {
        "X-MCP-Tools": "search-icons, get-component"
      }
    }
  }
}
```

## InstallButton Component

The module provides an `InstallButton` component that you can use in your documentation to let users install your MCP server in one click.

### Supported IDEs

<table>
<thead>
  <tr>
    <th>
      IDE
    </th>
    
    <th>
      Value
    </th>
    
    <th>
      Status
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Cursor
    </td>
    
    <td>
      <code>
        cursor
      </code>
    </td>
    
    <td>
      Supported
    </td>
  </tr>
  
  <tr>
    <td>
      VS Code
    </td>
    
    <td>
      <code>
        vscode
      </code>
    </td>
    
    <td>
      Supported
    </td>
  </tr>
</tbody>
</table>

### In Vue Templates

```vue
<template>
  <!-- Cursor (default) -->
  <InstallButton url="https://my-app.com/mcp" />

  <!-- VS Code -->
  <InstallButton url="https://my-app.com/mcp" ide="vscode" />

  <!-- Custom label -->
  <InstallButton url="https://my-app.com/mcp" label="Add to Cursor" />
</template>
```

### In Markdown (MDC Syntax)

If you're using [Nuxt Content](https://content.nuxt.com), use the MDC syntax:

```md
<!-- Cursor (default) -->
::install-button
---
url: "https://my-app.com/mcp"
---
::

<!-- VS Code -->
::install-button
---
url: "https://my-app.com/mcp"
ide: "vscode"
---
::

<!-- With custom label -->
::install-button
---
url: "https://my-app.com/mcp"
label: "Add to Cursor"
---
::
```

### Props Reference

<table>
<thead>
  <tr>
    <th>
      Prop
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        url
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      required
    </td>
    
    <td>
      URL of the MCP server endpoint
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        ide
      </code>
    </td>
    
    <td>
      <code>
        'cursor' | 'vscode'
      </code>
    </td>
    
    <td>
      <code>
        'cursor'
      </code>
    </td>
    
    <td>
      Target IDE
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        label
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Auto-generated
    </td>
    
    <td>
      Button label
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        showIcon
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <code>
        true
      </code>
    </td>
    
    <td>
      Show the IDE icon
    </td>
  </tr>
</tbody>
</table>

### Customization

The component uses CSS classes that you can override:

```css
/* Override default styles */
.mcp-install-button {
  background-color: #your-brand-color;
  border-radius: 9999px;
}
```

Or use the slot for completely custom content:

```vue
<InstallButton url="https://my-app.com/mcp">
  Add to Cursor
</InstallButton>
```

## README Badge

For README files and documentation outside of Vue/Nuxt, the module provides server routes to generate badges.

### Badge Routes

The module exposes two routes:

<table>
<thead>
  <tr>
    <th>
      Route
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        /mcp/deeplink
      </code>
    </td>
    
    <td>
      Redirects to the IDE deeplink
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        /mcp/badge.svg
      </code>
    </td>
    
    <td>
      Returns a customizable SVG badge image
    </td>
  </tr>
</tbody>
</table>

### Basic Usage

Add this to your README:

```md
[![Install in Cursor](https://your-app.com/mcp/badge.svg)](https://your-app.com/mcp/deeplink)
```

This will display a badge that, when clicked, opens the IDE and installs your MCP server.

### VS Code Badge

```md
[![Install in VS Code](https://your-app.com/mcp/badge.svg?ide=vscode)](https://your-app.com/mcp/deeplink?ide=vscode)
```

### Both IDEs

```md
[![Install in Cursor](https://your-app.com/mcp/badge.svg)](https://your-app.com/mcp/deeplink)
[![Install in VS Code](https://your-app.com/mcp/badge.svg?ide=vscode)](https://your-app.com/mcp/deeplink?ide=vscode)
```

### Customization Options

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ide
      </code>
    </td>
    
    <td>
      <code>
        cursor
      </code>
    </td>
    
    <td>
      Target IDE (<code>
        cursor
      </code>
      
       or <code>
        vscode
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        label
      </code>
    </td>
    
    <td>
      Auto-generated
    </td>
    
    <td>
      Badge text
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        color
      </code>
    </td>
    
    <td>
      <code>
        171717
      </code>
    </td>
    
    <td>
      Background color (hex without #)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        textColor
      </code>
    </td>
    
    <td>
      <code>
        ffffff
      </code>
    </td>
    
    <td>
      Text color (hex without #)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        borderColor
      </code>
    </td>
    
    <td>
      <code>
        404040
      </code>
    </td>
    
    <td>
      Border color (hex without #)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        icon
      </code>
    </td>
    
    <td>
      <code>
        true
      </code>
    </td>
    
    <td>
      Show IDE icon (<code>
        true
      </code>
      
       or <code>
        false
      </code>
      
      )
    </td>
  </tr>
</tbody>
</table>

### Custom Badge Examples

**Custom label:**

```md
[![Add to Cursor](https://your-app.com/mcp/badge.svg?label=Add%20to%20Cursor)](https://your-app.com/mcp/deeplink)
```

**Custom colors:**

```md
[![Install](https://your-app.com/mcp/badge.svg?color=0ea5e9&borderColor=0284c7)](https://your-app.com/mcp/deeplink)
```

**Without icon:**

```md
[![Install](https://your-app.com/mcp/badge.svg?icon=false)](https://your-app.com/mcp/deeplink)
```

<callout color="info" icon="i-lucide-info">

Replace `https://your-app.com` with your actual domain. The badge route uses the server name from your `mcp.name` config.

</callout>

## Deeplink Formats

For reference, here are the deeplink formats used by each IDE:

### Cursor

```text
cursor://anysphere.cursor-deeplink/mcp/install?name=SERVER_NAME&config=BASE64_CONFIG
```

The config is Base64-encoded JSON containing `{ type: 'http', url: 'MCP_URL' }`.

### VS Code

```text
vscode:mcp/install?URL_ENCODED_JSON
```

The config is URL-encoded JSON containing `{ name: 'SERVER_NAME', type: 'http', url: 'MCP_URL' }`.

## Next Steps

- [Tools](https://mcp-toolkit.nuxt.dev/tools/overview) - Create your first tool
- [Resources](https://mcp-toolkit.nuxt.dev/resources/overview) - Expose data to AI assistants
- [Prompts](https://mcp-toolkit.nuxt.dev/prompts/overview) - Create reusable message templates


## Sitemap

See the full [sitemap](https://mcp-toolkit.nuxt.dev/sitemap.md) for all pages.
