> ## 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
# MCP 服务器安装

安装和配置 Anysite MCP 服务器

## 概述

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

## 先决条件

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

## 安装

  
#### 克隆仓库

    ```bash
    git clone https://github.com/horizondatawave/hdw-mcp-server.git
    cd hdw-mcp-server
    ```
  

  
#### 获取 API 凭据

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

  
#### 配置环境

    创建 `.env` 文件或设置环境变量：
    ```bash
    export HDW_ACCESS_TOKEN="your_access_token_here"
    export HDW_ACCOUNT_ID="your_account_id_here"
    ```
  

## 客户端配置

### Claude Desktop

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

  
#### macOS

    编辑 `~/Library/Application Support/Claude/claude_desktop_config.json`：

    ```json
    {
      "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"
          }
        }
      }
    }
    ```
  

  
#### Windows

    编辑 `%APPDATA%\Claude\claude_desktop_config.json`：

    ```json
    {
      "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"
          }
        }
      }
    }
    ```
  

### Cursor

添加到您的 Cursor 设置：

```json
{
  "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
{
  "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 工具

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

## 故障排除

  
#### MCP 服务器未出现在 AI 客户端中

    - 检查配置中的文件路径是否正确
    - 验证 Python 是否可从命令行访问
    - 确保凭据已正确设置在环境变量中
    - 更改配置后重启 AI 客户端
  

  
#### 身份验证错误

    - 验证您的 `HDW_ACCESS_TOKEN` 和 `HDW_ACCOUNT_ID` 是否正确
    - 检查您的 Anysite 账户是否处于活跃状态
    - 确保您具有 API 访问权限
  

  
#### Python 路径问题

    - 使用 Python 可执行文件的完整路径
    - 如果使用虚拟环境，请使用该环境中的 Python 路径
    - 在 Windows 上，在路径中使用正斜杠或双反斜杠
  

## 后续步骤

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