> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anysite.io/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP 服务器安装

> 安装和配置 Anysite MCP 服务器

## 概述

Anysite MCP（模型上下文协议）服务器为 AI 工具提供对 LinkedIn、Instagram、Reddit 和其他社交媒体数据提取功能的直接访问。

## 先决条件

* Python 3.8 或更高版本
* Anysite API 账户和凭据
* 兼容的 AI 客户端（Claude Desktop、Cursor、Windsurf）

## 安装

<Steps>
  <Step title="克隆仓库">
    ```bash theme={null}
    git clone https://github.com/horizondatawave/hdw-mcp-server.git
    cd hdw-mcp-server
    ```
  </Step>

  <Step title="获取 API 凭据">
    1. 访问 [anysite.io](https://anysite.io)
    2. 创建账户并登录
    3. 导航到账户设置
    4. 生成您的 API 凭据：
       * `HDW_ACCESS_TOKEN`：您的 API 访问令牌
       * `HDW_ACCOUNT_ID`：您的账户标识符（可选）
  </Step>

  <Step title="配置环境">
    创建 `.env` 文件或设置环境变量：

    ```bash theme={null}
    export HDW_ACCESS_TOKEN="your_access_token_here"
    export HDW_ACCOUNT_ID="your_account_id_here"
    ```
  </Step>
</Steps>

## 客户端配置

### Claude Desktop

将此配置添加到您的 Claude Desktop 配置文件：

<Tabs>
  <Tab title="macOS">
    编辑 `~/Library/Application Support/Claude/claude_desktop_config.json`：

    ```json theme={null}
    {
      "mcpServers": {
        "hdw-mcp-server": {
          "command": "python",
          "args": ["/path/to/hdw-mcp-server/main.py"],
          "env": {
            "HDW_ACCESS_TOKEN": "your_access_token_here",
            "HDW_ACCOUNT_ID": "your_account_id_here"
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Windows">
    编辑 `%APPDATA%\Claude\claude_desktop_config.json`：

    ```json theme={null}
    {
      "mcpServers": {
        "hdw-mcp-server": {
          "command": "python",
          "args": ["C:\\path\\to\\hdw-mcp-server\\main.py"],
          "env": {
            "HDW_ACCESS_TOKEN": "your_access_token_here",
            "HDW_ACCOUNT_ID": "your_account_id_here"
          }
        }
      }
    }
    ```
  </Tab>
</Tabs>

### Cursor

添加到您的 Cursor 设置：

```json theme={null}
{
  "mcp.servers": {
    "hdw-mcp-server": {
      "command": "python",
      "args": ["/path/to/hdw-mcp-server/main.py"],
      "env": {
        "HDW_ACCESS_TOKEN": "your_access_token_here",
        "HDW_ACCOUNT_ID": "your_account_id_here"
      }
    }
  }
}
```

### Windsurf

在您的 Windsurf 设置中配置：

```json theme={null}
{
  "mcpServers": {
    "hdw-mcp-server": {
      "command": "python",
      "args": ["/path/to/hdw-mcp-server/main.py"],
      "env": {
        "HDW_ACCESS_TOKEN": "your_access_token_here",
        "HDW_ACCOUNT_ID": "your_account_id_here"
      }
    }
  }
}
```

## 验证

安装后，重启您的 AI 客户端并验证 MCP 服务器是否正常工作：

1. 在您的 AI 客户端中打开新对话
2. 询问："你有哪些可用的 MCP 工具？"
3. 您应该看到列出的 Anysite 工具

<Note>
  确保将 `/path/to/hdw-mcp-server/` 替换为您克隆仓库的实际路径。
</Note>

## 故障排除

<AccordionGroup>
  <Accordion title="MCP 服务器未出现在 AI 客户端中">
    * 检查配置中的文件路径是否正确
    * 验证 Python 是否可从命令行访问
    * 确保凭据已正确设置在环境变量中
    * 更改配置后重启 AI 客户端
  </Accordion>

  <Accordion title="身份验证错误">
    * 验证您的 `HDW_ACCESS_TOKEN` 和 `HDW_ACCOUNT_ID` 是否正确
    * 检查您的 Anysite 账户是否处于活跃状态
    * 确保您具有 API 访问权限
  </Accordion>

  <Accordion title="Python 路径问题">
    * 使用 Python 可执行文件的完整路径
    * 如果使用虚拟环境，请使用该环境中的 Python 路径
    * 在 Windows 上，在路径中使用正斜杠或双反斜杠
  </Accordion>
</AccordionGroup>

## 后续步骤

* [配置 MCP 服务器](/mcp-server/configuration)
* [探索可用工具](/mcp-server/tools)
* [查看使用示例](/mcp-server/examples)
