> ## Agent Instructions
>
> Base URL: https://api.anysite.io
> Authentication: send the `access-token` header. Do NOT use `Authorization: Bearer`.
> Full endpoint catalog: https://app.anysite.io/docs
# 连接客户端

把 Claude、Cursor、Codex、ChatGPT、n8n、Make、Clay 或 Grok 连接到 Anysite MCP 服务器。

目标：把 Anysite MCP 服务器添加到你的 AI 客户端，并确认其工具可用。

在下面选择你的客户端。每个标签页顶部的方框中是你的专属地址、命令或安装按钮（需要登录才能看到）；下面
的步骤在客户端内部完成。各认证方式的含义见：[MCP 服务器](/docs/mcp/overview?lang=zh#authentication)。

#### Claude.ai

> ACTION FOR THE HUMAN: open https://app.anysite.io/mcp?client=claude-ai, sign in, and follow the Claude.ai instructions there. An agent cannot obtain the key or URL itself.

1. 在 Claude 中，打开 **Settings → Connectors**，选择 **Add custom connector**。
2. 粘贴上方方框中的 MCP 地址并保存。
3. 点击 **Connect**。会打开一个 Anysite 页面：在**使用以下来源的积分**下选择套餐，然后点击**允许访问**。
4. 开始一个新对话并提问：`What tools do you have from Anysite?`

#### Claude Desktop

> ACTION FOR THE HUMAN: open https://app.anysite.io/mcp?client=claude-desktop, sign in, and follow the Claude Desktop instructions there. An agent cannot obtain the key or URL itself.

1. 在 Claude Desktop 中，打开 **Settings → Connectors**，选择 **Add Custom Connector**。
2. 粘贴上方方框中的 MCP 地址并添加该连接器。
3. 点击 **Connect**。浏览器会打开 Anysite 的授权页面：在**使用以下来源的积分**下选择套餐，然后点击
   **允许访问**。
4. 如果 Claude 不会自动调用 Anysite 的工具，把 Claude 的 **Tool access** 选项设为
   **Tools already loaded**，这样工具会一直保留在上下文中，而不是按名称临时查找。
5. 开始一个新对话并提问：`What tools do you have from Anysite?`

#### Claude Code

> ACTION FOR THE HUMAN: open https://app.anysite.io/mcp?client=claude-code, sign in, and follow the Claude Code instructions there. An agent cannot obtain the key or URL itself.

1. 在终端中运行上方方框里的命令。它会以 `anysite` 为名注册该服务器，密钥已包含在 URL 中。
2. 运行 `claude mcp list`，确认 `anysite` 显示为已连接。
3. 开始一个新的 Claude Code 会话并提问：`What tools do you have from Anysite?`

#### Cursor

> ACTION FOR THE HUMAN: open https://app.anysite.io/mcp?client=cursor, sign in, and follow the Cursor instructions there. An agent cannot obtain the key or URL itself.

1. 点击上方方框中的**添加到 Cursor**。Cursor 会打开，`anysite` 服务器已预先填好，并用 `Authorization`
   请求头中的密钥完成认证。
2. 在 Cursor 中确认安装。
3. 重启 Cursor。
4. 在智能体对话中提问：`What tools do you have from Anysite?`

#### Codex

> ACTION FOR THE HUMAN: open https://app.anysite.io/mcp?client=codex, sign in, and follow the Codex instructions there. An agent cannot obtain the key or URL itself.

1. 在终端中运行上方方框里的命令。
2. 开始一个新的 Codex 会话。
3. 如果 Codex 打开了浏览器窗口，登录 Anysite 并点击**允许访问**。
4. 提问：`What tools do you have from Anysite?`

#### ChatGPT

> ACTION FOR THE HUMAN: open https://app.anysite.io/mcp?client=chatgpt, sign in, and follow the ChatGPT instructions there. An agent cannot obtain the key or URL itself.

1. 在 ChatGPT 中添加一个自定义 MCP 连接器，并粘贴上方方框中的 MCP 地址。
2. 连接它。Anysite 的授权页面会打开：在**使用以下来源的积分**下选择套餐，然后点击**允许访问**。
3. 在启用了该连接器的新对话中提问：`What tools do you have from Anysite?`

#### n8n

> ACTION FOR THE HUMAN: open https://app.anysite.io/mcp?client=n8n, sign in, and follow the n8n instructions there. An agent cannot obtain the key or URL itself.

1. 在你的工作流中，打开 **AI Agent** 节点，给它添加 **MCP Client Tool**。
2. 把上方方框中的直连地址粘贴到端点字段中。
3. 把传输方式设为 **HTTP Streamable**，认证方式设为 **None** —— 密钥已经包含在地址中了。
4. 用类似 `List the tools you have from Anysite` 的提示词运行工作流，并检查智能体的工具调用。

#### Make

> ACTION FOR THE HUMAN: open https://app.anysite.io/mcp?client=make, sign in, and follow the Make instructions there. An agent cannot obtain the key or URL itself.

1. 在 Make 中，打开 **AI Agents**，选择或创建一个智能体。
2. 在该智能体的 **MCP** 部分点击 **Add**，然后在连接对话框中选择 **New MCP server**。
3. 把上方方框中的直连地址粘贴为服务器地址。API key / access token 字段留空 —— 密钥已经包含在地址
   中了。
4. 保存连接，然后向智能体提问：`What tools do you have from Anysite?`

#### Clay

> ACTION FOR THE HUMAN: open https://app.anysite.io/mcp?client=clay, sign in, and follow the Clay instructions there. An agent cannot obtain the key or URL itself.

1. 在 Clay 中，打开 **Settings → Tools**，点击 **Add custom MCP server**。
2. 给连接命名，把上方方框中的直连地址粘贴为 MCP URL，MCP API key 留空。
3. 保存，并确认新服务器的开关已打开。
4. 在 Clay 的 AI 数据补全列中使用它，例如：`Use Anysite to get the LinkedIn profile for {LinkedIn URL}`。

Clay 也可以不通过 MCP，而是从它的 **HTTP API** 数据补全直接调用 REST API：发送
`POST https://api.anysite.io/api/<endpoint>`，把密钥放在 `access-token` 请求头中（不是
`Authorization: Bearer`）。请求格式见[快速入门](/docs/quickstart?lang=zh)和
[身份验证](/docs/authentication?lang=zh)；端点和参数见 [API 参考](/docs/api)。

#### Grok

> ACTION FOR THE HUMAN: open https://app.anysite.io/mcp?client=grok, sign in, and follow the Grok instructions there. An agent cannot obtain the key or URL itself.

1. 在 Grok 中，打开 **Skills and Connectors**，切换到 **Connectors** 标签页，点击
   **New Connector → Custom**。
2. 输入名称 `Anysite`，把上方方框中的 MCP 地址粘贴为服务器地址，然后点击 **Add Connector**。
3. 点击 **Connect**。在 Anysite 的弹窗中，在**使用以下来源的积分**下选择套餐，然后点击**允许访问**。
   如果 Grok 显示 "Connection failed"，说明浏览器拦截了弹窗：请允许 grok.com 的弹窗，再次点击
   **Connect**。
4. 打开一个新对话并提问：`What tools do you have from Anysite?`

## 验证

客户端会列出 `discover`、`execute`、`get_page`、`query_cache`、`merge_data`、`export_data` 和
`search_requests`。启用 CRM 集成后，`crm_*` 工具也会出现（[CRM 工具](/docs/mcp/crm?lang=zh)）。然后试
一个真实请求，例如 `Use Anysite to find the LinkedIn profile of the CEO of Anthropic`：客户端应该会先
调用 `discover`，再调用 `execute`。

## Clients without HTTP transport

#### stdio 桥接（npx @anysiteio/mcp）

仅当你的客户端无法连接 HTTP MCP 服务器时才使用这种方式。npm 包 `@anysiteio/mcp` 在本地通过 stdio
运行，并携带你的密钥把每个请求转发到 `https://mcp.anysite.io/mcp`；工具与托管服务器上的完全一致。

```json
{
  "mcpServers": {
    "anysite": {
      "command": "npx",
      "args": ["-y", "@anysiteio/mcp"],
      "env": {
        "ANYSITE_ACCESS_TOKEN": "YOUR_API_KEY"
      }
    }
  }
}
```

> ACTION FOR THE HUMAN: copy your API key at https://app.anysite.io/billing — an agent cannot obtain it.

`ANYSITE_ACCESS_TOKEN` 是唯一必需的变量。`ANYSITE_MCP_URL` 用于覆盖服务器地址，正常使用时不需要设置。

这个变量改过名字。在改名之前写好的配置仍使用旧名称，会导致不再生效 —— 把该名称替换为
`ANYSITE_ACCESS_TOKEN`；密钥本身的值不变。

## 故障排查

| 你看到的情况 | 原因和解决方法 |
|---|---|
| `401` `Authentication required. Include Authorization: Bearer <token> header.` | 客户端没有发送密钥：直连地址在 `?api_key=` 之前被截断，或者缺少请求头。请从「MCP 集成」页面重新复制地址或配置。 |
| `Active subscription required. Please subscribe first.` | 账户没有有效套餐。完成设置或选择一个套餐，然后重新连接。 |
| `429` `You've reached your 5-hour usage limit…`（或每周版本） | MCP 套餐的某个窗口已用尽。在「MCP 集成」页面查看用量，等待重置或更换套餐。 |
| 「MCP 集成」页面上的直连地址或密钥一直显示「Loading…」 | 不是密钥或计费问题：该客户端无法使用直连地址。请改用同一页面上的 OAuth 地址连接。 |
| 某次工具调用返回 `502`、代理错误或超时 | 属于瞬时问题。让客户端重新发起同样的请求；如果每次调用都失败，先检查套餐和连接状态。 |
| 原本正常的 OAuth 客户端突然无法认证 | OAuth 授权的有效期是 30 天。重新连接该连接器并再次允许访问。 |
| 没有 `crm_*` 工具 | CRM 集成未开启。在个人资料中启用它，然后刷新客户端的工具列表；更改会在一分钟内同步到服务器。 |

> ACTION FOR THE HUMAN: open https://app.anysite.io/mcp (打开 MCP 集成).
