🚀 产品搜索MCP服务器
](https://pypi.org/project/product-hunt-mcp/)   ](Dockerfile) 
即插即用 主控程序 Product Hunt服务器
______________________________________________________________________
📦 快速安装
pip install product-hunt-mcp🏃♂️ 快速入门示例
# Run the MCP server (requires PRODUCT_HUNT_TOKEN environment variable)
export PRODUCT_HUNT_TOKEN=your_token_here
product-hunt-mcp______________________________________________________________________
✨ 这是什么?
产品搜索MCP服务器 将Product Hunt的API连接到任何LLM或代理 模型上下文协议(MCP)非常适合AI助手、聊天机器人或您自己的自动化!
- 🔍 获取帖子、收藏、主题、用户
- 🗳️ 获取投票、评论等
- 🛠️ 与Claude Desktop、Cursor或任何MCP客户端一起使用
______________________________________________________________________
🛠️ 特性
- 获取帖子、评论、收藏、主题、用户的详细信息
- 按主题、日期、投票等进行搜索/筛选。
- 分页评论、用户赞成票等
- 内置于 FastMCP 速度和兼容性
______________________________________________________________________
🧑💻 这是给谁的?
- AI/LLM用户:插入Claude Desktop、Cursor或您自己的代理
- 开发者:使用Product Hunt数据构建机器人、仪表板或自动化
- 修补工:探索MCP生态系统并构建自己的工具
______________________________________________________________________
🏁 设置
先决条件
- Python 3.10+
- Product Hunt API代币(在这里买一个)
- 您需要在Product Hunt上创建一个帐户 - 导航到API仪表板并创建新的应用程序 - 使用 Developer Token 对于令牌
注: 在Product Hunt上创建新应用程序时,系统会要求您提供redirect_uri。虽然MCP服务器不使用重定向URI,但它是必填字段。您可以输入任何有效的URL,例如https://localhost:8424/callback.
安装
首选: 紫外线 (快速、现代的Python安装程序)
# Install uv if you don't have it
pip install uv从PyPI安装(推荐)
uv pip install product-hunt-mcp
# or
pip install product-hunt-mcp从GitHub安装(最新主分支)
uv pip install 'git+https://github.com/jaipandya/producthunt-mcp-server.git'
# or
pip install 'git+https://github.com/jaipandya/producthunt-mcp-server.git'从源代码本地安装
uv pip install .
# or
pip install .______________________________________________________________________
🚀 使用Claude桌面和光标
安装后 product-hunt-mcp 命令将可用。将其添加到您的Claude桌面或光标配置中:
{
"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中,则使用命令。如果遇到问题,可以提供可执行文件的完整路径。安装后,运行: ``bash which product-hunt-mcp`使用Claude Desktop配置中的输出路径,替换"command": "product-hunt-mcp"对于完整路径(例如。,"command": "/Users/youruser/.local/bin/product-hunt-mcp"`).
查找配置文件
- 克劳德桌面:
- 窗户: %APPDATA%\claude-desktop\config.json - macOS: ~/Library/Application Support/claude-desktop/config.json - Linux: ~/.config/claude-desktop/config.json
- 光标:
- 窗户: %APPDATA%\Cursor\User\settings.json - macOS: ~/Library/Application Support/Cursor/User/settings.json - Linux: ~/.config/Cursor/User/settings.json
码头工人
您还可以使用Docker运行服务器:
# Build the Docker image
docker build -t product-hunt-mcp .
# Run the Docker container (interactive for 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 | 获取特定帖子的信息 | id 或 slug, comments_count, comments_after |
| get_posts | 使用过滤器获取帖子 | topic, order, count, featured, posted_before, posted_after |
| get_comment | 获取特定评论的信息 | id (必填) |
| get_post_comments | 获取帖子的评论 | post_id 或 slug, order, count, after |
| get_collection | 获取集合信息 | id 或 slug |
| get_collections | 使用过滤器获取集合 | featured, user_id, post_id, order, count |
| get_topic | 获取主题信息 | id 或 slug |
| 搜索主题 | 搜索主题 | query, followed_by_user_id, order, count |
| get_user | 获取用户信息 | id 或 username, posts_type, posts_count |
| get_viewer | 获取已验证用户的信息 | 无 |
| check_server_status | 检查服务器/API状态和身份验证 | 无 |
______________________________________________________________________
🏗️ 项目结构
product-hunt-mcp/
├── src/
│ └── product_hunt_mcp/ # Main package directory
│ ├── __init__.py
│ ├── cli.py # Command-line entry point
│ ├── api/ # API clients & queries
│ ├── schemas/ # Data validation schemas
│ ├── tools/ # MCP tool definitions
│ └── utils/ # Utility functions
├── pyproject.toml # Project metadata, dependencies, build config
├── README.md
├── CONTRIBUTING.md
├── CHANGELOG.md
├── Dockerfile
└── ... (config files, etc.)______________________________________________________________________
🔄 速率限制
Product Hunt API有此客户尊重的费率限制。如果您遇到速率限制错误,客户端将在速率限制重置时通知您。您可以使用 get_api_rate_limits 或 check_server_status 工具。
______________________________________________________________________
🐛 故障排除
- 缺少令牌:确保您的
PRODUCT_HUNT_TOKEN被正确设置为环境变量。 - 连接问题:验证您的互联网连接以及Product Hunt API是否可访问。
- 速率限制:如果达到速率限制,请等到重置时间或降低查询频率。
- 克劳德桌面/光标找不到服务器:验证Python可执行文件的路径,然后重新启动客户端。
______________________________________________________________________
🤝 贡献
- 欢迎PR和问题!
- 看
pyproject.toml对于开发依赖关系。
______________________________________________________________________
🌐 链接
______________________________________________________________________
📝 备注
- 该项目与Product Hunt无关。
- 产品搜寻API可能会更改。
______________________________________________________________________
📜 许可证
麻省理工学院
