---
title: "How to Create One-Click MCP Installation Deep Links for Cursor and VS Code"
date: "2026-04-02"
slug: "create-one-click-mcp-installation-links-cursor-vscode"
author: "Dany Paredes"
canonical: "https://danywalls.com/create-one-click-mcp-installation-links-cursor-vscode"
description: "Stop making users manually edit JSON files to install your MCP server. Learn how to automate one-click installation deep links for Cursor and VS Code."
---


A few weeks ago, I built the **[unsplashx](https://www.npmjs.com/package/unsplashx)** MCP. But to make it easier for my friends to use it, I decided to simplify the installation process. Today, I want to explain why using deep links is critical for reducing friction in the MCP ecosystem.

Manual installation is a chore. Instead of asking users to hunt for JSON settings, fix syntax errors, and restart their IDE, we can use one-click deep links to make it invisible.

## Why Deep Links?

Think of this as a "mailto:" link for your coding agent. If a user has Cursor or VS Code open, they click a link, and the editor handles the configuration automatically.

Both **Cursor** and **VS Code** support these links, but they use different encoding formats. Manually creating these links every time you update your package is exactly the kind of task we should automate.

## The Goal: From JSON to One-Click

Let’s see how to transform a standard MCP configuration into a link that works in a real project. We'll use the config for my **unsplashx** server:

```json
{
  "unsplashx": {
    "type": "stdio",
    "command": "npx",
    "args": ["-y", "unsplashx"],
    "env": {
      "UNSPLASH_ACCESS_KEY": "YOUR_KEY_HERE"
    }
  }
}
```

### Step 1: Cursor Protocol (Base64)

**Cursor** requires the JSON configuration to be **Base64 encoded**. 

Format:
`cursor://anysphere.cursor-deeplink/mcp/install?name=$NAME&config=$BASE64_CONFIG`

Base64 encoding keeps the URL valid while preserving the entire JSON structure.

### Step 2: VS Code Protocol (URL Encoded)

**VS Code** expects a **URL-encoded JSON string** (usually via the official MCP extension).

Format:
`vscode://mcp/install?${JSON_STRING_URL_ENCODED}`

Since each editor has its own preference, our automation needs to handle both.

## The Solution: A Reusable Script

Here is a simple TypeScript snippet to generate both links for any MCP server:

```typescript
/**
 * Automate MCP Installation Links
 */
function generateMcpLinks(name: string, config: any) {
  const configString = JSON.stringify(config);

  // 1. Cursor (Base64)
  const cursorBase64 = Buffer.from(configString).toString('base64');
  const cursorLink = `cursor://anysphere.cursor-deeplink/mcp/install?name=${name}&config=${cursorBase64}`;

  // 2. VS Code (URL Encoded)
  const vscodeEncoded = encodeURIComponent(configString);
  const vscodeLink = `vscode://mcp/install?${vscodeEncoded}`;

  return { cursorLink, vscodeLink };
}

// Example for unsplashx
const myConfig = {
  type: "stdio",
  command: "npx",
  args: ["-y", "unsplashx"],
  env: { UNSPLASH_ACCESS_KEY: "" }
};

const links = generateMcpLinks("unsplashx", myConfig);

console.log("Cursor:", links.cursorLink);
console.log("VS Code:", links.vscodeLink);
```

## Try it: One-Click unsplashx Installation

See it in action. These buttons will install the **unsplashx** MCP directly into your editor (you'll just need to provide your API key in the prompt):

[<img src="https://img.shields.io/badge/Add_to_Cursor-black?style=for-the-badge&logo=cursor&logoColor=white" alt="Add to Cursor" />](cursor://anysphere.cursor-deeplink/mcp/install?name=unsplashx&config=eyJ0eXBlIjoic3RkaW8iLCJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInVuc3BsYXNoeCJdLCJlbnYiOnsiVU5TUExBU0hfQUNDRVNTX0tFWSI6IiJ9fQ==)
[<img src="https://img.shields.io/badge/Add_to_VS_Code-007ACC?style=for-the-badge&logo=visual-studio-code&logoColor=white" alt="Add to VS Code" />](https://vscode.dev/redirect/mcp/install?name=unsplashx&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22unsplashx%22%5D%2C%22env%22%3A%7B%22UNSPLASH_ACCESS_KEY%22%3A%22%22%7D%7D)

## Takeaway

**Friction kills adoption.** Most people love new tools but hate configuration. By automating these links, you remove the barrier to entry.

If you build an MCP server, don't just ship the code—**ship the installation experience.**

---

_Photo by [Sven](https://unsplash.com/@shauste?utm_source=unsplashx&utm_medium=referral) on [Unsplash](https://unsplash.com/?utm_source=unsplashx&utm_medium=referral)_

