# Installing SnapLinker MCP

These instructions are for AI agents setting up SnapLinker for a user. SnapLinker is a remote
Model Context Protocol (MCP) server that turns merchant URLs into the user's AvantLink affiliate
links and searches products across AvantLink merchants.

## Server

- URL: `https://mcp.snaplinker.com/mcp`
- Transport: Streamable HTTP
- Authentication: OAuth 2.1, discovered automatically from the server (dynamic client
  registration and client ID metadata documents are supported). When the app connects, it opens a
  SnapLinker page where the user signs in with their AvantLink Affiliate ID and Auth Key.

## Rules for the agent

- Do not ask the user for their AvantLink Affiliate ID or Auth Key, and do not put them in any
  config. The user enters them on the SnapLinker sign-in page.
- Do not add SnapLinker to a project file that is committed to a repository unless the user asks.
  Prefer user-level settings.
- If the app cannot do OAuth sign-in, use the connection-URL fallback at the end.

## Claude (Claude.ai, Claude Desktop, Claude mobile)

1. Open https://claude.ai/customize/connectors and choose **Add custom connector**.
2. Name: `SnapLinker`. URL: `https://mcp.snaplinker.com/mcp`.
3. Choose **Add**, then **Connect**. The user signs in on the SnapLinker page.
4. In a chat, turn SnapLinker on from the tools menu.

## Claude Code

```
claude mcp add --transport http --scope user snaplinker https://mcp.snaplinker.com/mcp
```

Then run `/mcp` inside Claude Code, select `snaplinker` and authenticate.

## ChatGPT

1. Settings → Security and login → turn on **Developer mode**.
2. Settings → Apps → **Create**. Name: `SnapLinker`. URL: `https://mcp.snaplinker.com/mcp`.
   Authentication: **OAuth**.
3. Choose **Create** and sign in. In a chat, enable SnapLinker from the **+** menu under
   Developer mode.

## Cursor

Open this link to install:
`cursor://anysphere.cursor-deeplink/mcp/install?name=snaplinker&config=eyJ1cmwiOiJodHRwczovL21jcC5zbmFwbGlua2VyLmNvbS9tY3AifQ%3D%3D`

Or add to `~/.cursor/mcp.json`:

```json
{ "mcpServers": { "snaplinker": { "url": "https://mcp.snaplinker.com/mcp" } } }
```

Cursor shows a **Connect** button for the server in Settings → MCP; the user signs in there.

## VS Code

Run:

```
code --add-mcp '{"name":"snaplinker","type":"http","url":"https://mcp.snaplinker.com/mcp"}'
```

Or add to the user `mcp.json` (Command Palette → "MCP: Open User Configuration"):

```json
{ "servers": { "snaplinker": { "type": "http", "url": "https://mcp.snaplinker.com/mcp" } } }
```

Start the server; VS Code prompts the user to sign in.

## Apps that support remote MCP servers with OAuth

Add a remote (HTTP / Streamable HTTP) server named `snaplinker` with URL
`https://mcp.snaplinker.com/mcp` and no headers. The app discovers sign-in from the server's
`401` response.

## Apps that only run local (stdio) servers

`mcp-remote` bridges a local app to the remote server and handles the sign-in in the browser:

```json
{ "mcpServers": { "snaplinker": { "command": "npx", "args": ["-y", "mcp-remote", "https://mcp.snaplinker.com/mcp"] } } }
```

This needs Node.js.

## Fallback: connection URL (no OAuth)

If the app supports neither OAuth nor `mcp-remote`, the user gets a personal connection URL by
entering their AvantLink Affiliate ID and Auth Key at https://mcp.snaplinker.com/#setup (under
"My app doesn't support sign-in"). The page then shows setup steps for many apps, including Codex,
Gemini CLI, Goose, LM Studio, Windsurf and the Claude Desktop extension. The connection URL
contains the user's token: store it in user-level settings, never in a shared or committed file.

## Check that it works

Ask the app to list SnapLinker's tools. It should show `generateAffiliateLink`,
`generateAffiliateLinks`, `searchProducts`, `getDefaultWebsite`, `getAllWebsites` and
`syncWebsites`. Then try: "Generate an affiliate link for https://www.rei.com/".
