返回市场
产品猎手-mcp服务器

产品猎手-mcp服务器

作者:jaipandya34 星标更新:2025-04-19

项目介绍

🚀 Product Hunt MCP Server

PyPI 版本 许可证: MIT Python 3.10+ Docker 就绪 MCP 兼容

一个即插即用的 MCP 服务器用于 Product Hunt


📦 快速安装

pip install product-hunt-mcp

🏃‍♂️ 快速启动示例

# 运行 MCP 服务器(需要设置 PRODUCT_HUNT_TOKEN 环境变量)
export PRODUCT_HUNT_TOKEN=your_token_here
product-hunt-mcp

✨ 这是什么?

Product Hunt MCP Server 将 Product Hunt 的 API 连接到任何支持 模型上下文协议 (MCP) 的 LLM 或代理。非常适合 AI 助手、聊天机器人或您自己的自动化!

  • 🔍 获取帖子、集合、主题、用户信息
  • 🗳️ 获取投票、评论等
  • 🛠️ 与 Claude Desktop、Cursor 或任何 MCP 客户端一起使用

🛠️ 特性

  • 获取详细的帖子、评论、集合、主题、用户信息
  • 按主题、日期、投票数等搜索/过滤
  • 分页评论、用户点赞等
  • 使用 FastMCP 构建,以实现速度和兼容性

🧑‍💻 这是给谁的?

  • AI/LLM 用户:连接到 Claude Desktop、Cursor 或您自己的代理
  • 开发者:使用 Product Hunt 数据构建机器人、仪表板或自动化
  • DIY 爱好者:探索 MCP 生态系统并构建自己的工具

🏁 设置

预备条件

  • Python 3.10+
  • Product Hunt API 令牌(在这里获取
    • 您需要在 Product Hunt 上创建一个账户
    • 导航到 API 控制面板并创建一个新的应用程序
    • 使用 Developer Token 作为令牌

注意:当在 Product Hunt 上创建新应用时,会被要求提供 redirect_uri。虽然 MCP 服务器不使用重定向 URI,但这是一个必填字段。您可以输入任何有效的 URL,例如 https://localhost:8424/callback

安装

首选:uv(快速、现代的 Python 安装器)

# 如果没有安装 uv,请先安装
pip install uv

从 PyPI 安装(推荐)

uv pip install product-hunt-mcp
# 或
pip install product-hunt-mcp

从 GitHub 安装(最新主分支)

uv pip install 'git+https://github.com/jaipandya/producthunt-mcp-server.git'
# 或
pip install 'git+https://github.com/jaipandya/producthunt-mcp-server.git'

从源码本地安装

uv pip install .
# 或
pip install .

🚀 与 Claude Desktop & Cursor 的使用

安装后,product-hunt-mcp 命令将可用。将其添加到您的 Claude Desktop 或 Cursor 配置中:

{
  "mcpServers": {
    "product-hunt": {
      "command": "product-hunt-mcp",
      "env": {
        "PRODUCT_HUNT_TOKEN": "your_token_here"
      }
    }
  }
}
  • your_token_here 替换为您实际的 Product Hunt API 令牌。
  • 令牌必须在您的 Claude Desktop 或 Cursor 配置中设置为环境变量,以便服务器进行身份验证。
  • 编辑配置文件后,始终重启客户端(Claude Desktop/Cursor)。

提示:在 macOS 上,Claude Desktop 可能无法总是找到 product-hunt-mcp 命令,如果它不在默认的 PATH 中。如果您遇到问题,可以提供可执行文件的完整路径。安装后运行:

which product-hunt-mcp

在您的 Claude Desktop 配置中使用输出路径,替换 "command": "product-hunt-mcp" 为完整的路径(例如,"command": "/Users/youruser/.local/bin/product-hunt-mcp")。

查找您的配置文件

  • Claude Desktop

    • Windows: %APPDATA%\claude-desktop\config.json
    • macOS: ~/Library/Application Support/claude-desktop/config.json
    • Linux: ~/.config/claude-desktop/config.json
  • Cursor

    • Windows: %APPDATA%\Cursor\User\settings.json
    • macOS: ~/Library/Application Support/Cursor/User/settings.json
    • Linux: ~/.config/Cursor/User/settings.json

Docker

您也可以使用 Docker 运行服务器:

# 构建 Docker 镜像
docker build -t product-hunt-mcp .

# 运行 Docker 容器(交互式 MCP)
docker run -i --rm -e PRODUCT_HUNT_TOKEN=your_token_here product-hunt-mcp

对于 Claude Desktop/Cursor 与 Docker 的集成,使用以下配置:

{
  "mcpServers": {
    "product-hunt": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "PRODUCT_HUNT_TOKEN=your_token_here", "product-hunt-mcp"],
      "env": {}
    }
  }
}

安全提示:您的 PRODUCT_HUNT_TOKEN 是敏感信息。不要分享或提交到版本控制中。


🛠️ MCP 工具

工具描述关键参数
get_post_details获取特定帖子的信息idslug, comments_count, comments_after
get_posts获取带有过滤器的帖子topic, order, count, featured, posted_before, posted_after
get_comment获取特定评论的信息id(必需)
get_post_comments获取帖子的评论post_idslug, order, count, after
get_collection获取集合的信息idslug
get_collections获取带有过滤器的集合featured, user_id, post_id, order, count
get_topic获取主题的信息idslug
search_topics搜索主题query, followed_by_user_id, order, count
get_user获取用户的详细信息idusername, posts_type, posts_count
get_viewer获取已认证用户的详细信息
check_server_status检查服务器/API 状态及身份验证

🏗️ 项目结构

product-hunt-mcp/
├── src/
│   └── product_hunt_mcp/ # 主包目录
│       ├── __init__.py
│       ├── cli.py        # 命令行入口点
│       ├── api/          # API 客户端及查询
│       ├── schemas/      # 数据验证模式
│       ├── tools/        # MCP 工具定义
│       └── utils/        # 实用函数
├── pyproject.toml      # 项目元数据、依赖项、构建配置
├── README.md
├── CONTRIBUTING.md
├── CHANGELOG.md
├── Dockerfile
└── ... (配置文件等)

🔄 速率限制

Product Hunt API 有速率限制,此客户端会遵守这些限制。如果您遇到速率限制错误,客户端将通知您何时速率限制重置。您可以使用 get_api_rate_limitscheck_server_status 工具检查当前的速率限制状态。


🐛 故障排除

  • 缺少令牌:确保您的 PRODUCT_HUNT_TOKEN 正确设置为环境变量。
  • 连接问题:验证您的互联网连接,并确认可以访问 Product Hunt API。
  • 速率限制:如果达到速率限制,请等待重置时间或减少查询频率。
  • Claude Desktop/Cursor 未找到服务器:验证 Python 可执行文件的路径并重启客户端。

🤝 贡献

  • 欢迎 PR 和 issue!
  • 请遵循 PEP8 并使用 ruff 进行代码检查。
  • 查看 pyproject.toml 了解开发依赖项。

🌐 链接


📝 注意事项

  • 本项目与 Product Hunt 无关。
  • Product Hunt API 可能会发生变化。

📜 许可证

MIT