跳转到主要内容

概述

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

先决条件

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

安装

1

克隆仓库

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

获取 API 凭据

  1. 访问 anysite.io
  2. 创建账户并登录
  3. 导航到账户设置
  4. 生成您的 API 凭据:
    • HDW_ACCESS_TOKEN:您的 API 访问令牌
    • HDW_ACCOUNT_ID:您的账户标识符(可选)
3

配置环境

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

客户端配置

Claude Desktop

将此配置添加到您的 Claude Desktop 配置文件:
编辑 ~/Library/Application Support/Claude/claude_desktop_config.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"
      }
    }
  }
}

Cursor

添加到您的 Cursor 设置:
{
  "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 设置中配置:
{
  "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/ 替换为您克隆仓库的实际路径。

故障排除

  • 检查配置中的文件路径是否正确
  • 验证 Python 是否可从命令行访问
  • 确保凭据已正确设置在环境变量中
  • 更改配置后重启 AI 客户端
  • 验证您的 HDW_ACCESS_TOKENHDW_ACCOUNT_ID 是否正确
  • 检查您的 Anysite 账户是否处于活跃状态
  • 确保您具有 API 访问权限
  • 使用 Python 可执行文件的完整路径
  • 如果使用虚拟环境,请使用该环境中的 Python 路径
  • 在 Windows 上,在路径中使用正斜杠或双反斜杠

后续步骤