跳到正文
DEV Community· Theo·· 3 小時前AI 評分57

Cursor 與 VS Code 的一鍵 MCP 安裝連結中包含甚麼?

One-click MCP install links for Cursor and VS Code: what's actually in the URL

AI 導讀

Theo介紹如何為 MCP 伺服器建立 Cursor 和 VS Code 一鍵安裝連結,並比較兩者把設定放入 URL 的格式。Cursor 將不含 name 和 type 的伺服器設定 JSON 以 base64 編碼,並把名稱放在 name 參數;VS Code 則使用 URL 編碼 JSON,並在 JSON 內包含 name 和 type。

正文

I run VibeCodePicks, a directory of AI coding tools (disclosure: it's my site, and it's the example in this post). It has a free remote MCP server, and until today connecting it meant copying a JSON block into a config file. Now the setup page has two buttons, "Add to Cursor" and "Install in VS Code". Neither one is magic: each is a plain link with the server config packed into the URL. Here's what goes in them, so you can make the same buttons for your own server.

The config being installed

The server is remote over HTTP and needs no sign-in, so the whole config is one URL:

{ "url": "https://vibecodepicks.com/api/mcp" }

If your server runs locally instead, the config would have command and args the way it does in mcp.json. The link formats below take either shape.

Cursor: base64 JSON in a deeplink

Cursor's documented format is:

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

name is the server name that shows up in Cursor. config is the JSON above, base64-encoded:

echo -n '{"url":"https://vibecodepicks.com/api/mcp"}' | base64
# eyJ1cmwiOiJodHRwczovL3ZpYmVjb2RlcGlja3MuY29tL2FwaS9tY3AifQ==

So the button's href is:

cursor://anysphere.cursor-deeplink/mcp/install?name=vibecodepicks&config=eyJ1cmwiOiJodHRwczovL3ZpYmVjb2RlcGlja3MuY29tL2FwaS9tY3AifQ==

One thing to watch: the config object holds only the server settings. The name goes in the name parameter, not inside the JSON.

VS Code: URL-encoded JSON, name inside

VS Code's documented format is vscode:mcp/install?{json-configuration} (and vscode-insiders:mcp/install?... for Insiders). Here the JSON is URL-encoded rather than base64, and the name lives inside it, next to the transport type:

{ "name": "vibecodepicks", "type": "http", "url": "https://vibecodepicks.com/api/mcp" }

In JavaScript:

const cfg = { name: "vibecodepicks", type: "http", url: "https://vibecodepicks.com/api/mcp" };
const href = "vscode:mcp/install?" + encodeURIComponent(JSON.stringify(cfg));

which gives:

vscode:mcp/install?%7B%22name%22%3A%22vibecodepicks%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fvibecodepicks.com%2Fapi%2Fmcp%22%7D

The two formats side by side

Cursor VS Code
Scheme cursor://anysphere.cursor-deeplink/mcp/install vscode:mcp/install
Server name name= query parameter "name" inside the JSON
Config encoding base64 URL-encoded JSON
Transport implied by url "type": "http"

The mistake that's easy to make is reusing one config for both. The Cursor JSON has no name and no type; the VS Code JSON needs both.

Keep the copy-paste fallback

Both links only do something on a machine that has that editor installed, and other clients (Claude, Claude Code, Codex, Windsurf, ChatGPT) have their own setup steps. So the page keeps the plain config blocks under the buttons. The buttons are a shortcut, not the only way in.

What the server does, briefly

It searches the directory of 114 tools and exposes 13 MCP tools, including search, recommend_tools, compare_tools, list_alternatives and whats_new. Once it's connected you can ask your assistant something like "what's a free open-source coding agent for the terminal?" and it answers from the directory, with pricing and alternatives.

Setup page with both buttons and the config for every other client: https://vibecodepicks.com/mcp/?utm_source=devto&utm_medium=social&utm_campaign=mcp-install-links

Format references: Cursor MCP install links and VS Code MCP developer guide.

來源:DEV Community · dev.to