npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

competitor-tracking-mcp

v0.1.2

Published

npx entrypoint to launch the competitor-tracking MCP Python server

Readme

竞品追踪MCP服务

简介

竞品追踪MCP服务是一个基于Model Context Protocol (MCP)的工具集合,用于自动化收集、分析和报告竞品信息。该服务利用Tavily搜索引擎获取最新的竞品资讯,并结合LLM分析能力生成深度洞察报告。

本项目现已升级为使用FastMCP框架构建,提供了更简洁、高效的开发体验。

功能特性

核心工具

  1. search_competitor_updates: 搜索竞品的版本更新和功能发布信息
  2. analyze_reviews_sentiment: 分析竞品用户评价的情感倾向
  3. analyze_user_painpoints: 分析用户评价中的痛点和需求
  4. track_market_activities: 追踪竞品市场动态
  5. generate_report: 生成HTML可视化竞品分析报告
  6. run_full_analysis: 一键执行完整竞品分析

支持的分析类型

  • 版本更新追踪
  • 用户情感分析(五分类:非常正面/正面/中性/负面/非常负面)
  • 用户痛点识别与分类
  • 市场活动监控(融资、营销、合作等)
  • 多维度雷达图对比
  • 功能矩阵对比
  • SWOT分析
  • 综合智能摘要

快速开始

环境要求

  • Python 3.12+
  • Tavily API Key

安装

从PyPI安装(推荐):

pip install competitor-tracking-mcp

或从源码安装:

git clone <repository-url>
cd competitor-tracking-mcp
pip install -e .

开发安装:

pip install -e ".[dev]"

通过 npx 直接运行(需要本机已安装 Python 3.12+ 且已安装项目的 Python 依赖):

# 先确保 Python 依赖已装好(至少运行一次)
pip install -e .

# 然后使用 npx 启动服务,仍需提供 Tavily API Key
TAVILY_API_KEY=your_tavily_api_key npx competitor-tracking-mcp --transport http --host 0.0.0.0 --port 8000

配置

  1. 复制环境变量模板:
cp .env.example .env
  1. 编辑 .env 文件,设置以下必要变量:
TAVILY_API_KEY=your_tavily_api_key
DEFAULT_LANGUAGE=zh
DEFAULT_REGION=cn
DEFAULT_DAYS=7

使用方式

Stdio模式(本地Claude Desktop)

  1. 配置 claude_desktop_config.json
{
  "mentionable": [
    {
      "type": "computer",
      "computer": {
        "type": "local",
        "name": "competitor-tracking",
        "description": "竞品追踪分析工具",
        "commands": [
          {
            "name": "search_competitor_updates",
            "description": "搜索竞品的版本更新和功能发布信息"
          },
          {
            "name": "analyze_reviews_sentiment",
            "description": "分析竞品用户评价的情感倾向"
          },
          {
            "name": "analyze_user_painpoints",
            "description": "分析用户评价中的痛点和需求"
          },
          {
            "name": "track_market_activities",
            "description": "追踪竞品市场动态"
          },
          {
            "name": "generate_report",
            "description": "生成HTML可视化竞品分析报告"
          },
          {
            "name": "run_full_analysis",
            "description": "一键执行完整竞品分析"
          }
        ]
      }
    }
  ]
}
  1. 启动服务:
competitor-tracking

HTTP模式(远程服务)

  1. 启动命令:
competitor-tracking --transport http --host 0.0.0.0 --port 8000
  1. 连接方式: 通过MCP客户端连接到 http://<host>:<port>

Tool使用示例

search_competitor_updates

输入:

{
  "competitors": ["微信", "支付宝"],
  "language": "zh",
  "region": "cn",
  "days": 7
}

输出:

{
  "success": true,
  "data": {
    "competitors": [
      {
        "name": "微信",
        "aliases_used": ["微信", "WeChat", "wechat"],
        "updates": [
          {
            "title": "微信发布新版本",
            "date": "2023-01-01",
            "summary": "新增聊天功能",
            "source_url": "https://example.com",
            "is_major_update": true,
            "update_type": "feature"
          }
        ]
      }
    ]
  },
  "errors": null,
  "api_calls_used": 2
}

analyze_reviews_sentiment

输入:

{
  "competitors": ["微信"],
  "language": "zh",
  "region": "cn",
  "days": 7
}

输出:

{
  "success": true,
  "data": {
    "competitors": [
      {
        "name": "微信",
        "sentiment_analysis": {
          "distribution": {
            "very_positive": 10,
            "positive": 20,
            "neutral": 5,
            "negative": 3,
            "very_negative": 1
          },
          "score": 85.2,
          "total_reviews_analyzed": 39,
          "sample_reviews": [
            {
              "content": "非常好用",
              "sentiment": "very_positive",
              "source": "应用商店"
            }
          ]
        },
        "raw_reviews": [...],
        "analysis_prompt": "..."
      }
    ]
  },
  "errors": null,
  "api_calls_used": 2
}

analyze_user_painpoints

输入:

{
  "competitors": ["微信"],
  "language": "zh",
  "region": "cn",
  "days": 7
}

输出:

{
  "success": true,
  "data": {
    "competitors": [
      {
        "name": "微信",
        "painpoints": {
          "categories": [
            {
              "name": "性能问题",
              "count": 15,
              "severity": "high",
              "description": "占用内存大,卡顿",
              "examples": ["使用一段时间后很卡"]
            }
          ],
          "total_issues_found": 25,
          "most_critical": "性能问题"
        },
        "analysis_prompt": "..."
      }
    ]
  },
  "errors": null,
  "api_calls_used": 1
}

track_market_activities

输入:

{
  "competitors": ["微信"],
  "language": "zh",
  "region": "cn",
  "days": 7
}

输出:

{
  "success": true,
  "data": {
    "competitors": [
      {
        "name": "微信",
        "activities": [
          {
            "type": "funding",
            "title": "腾讯完成新一轮融资",
            "date": "2023-01-01",
            "summary": "获得10亿美元投资",
            "source_url": "https://example.com",
            "importance": "high",
            "related_entities": ["腾讯"]
          }
        ],
        "activity_summary": {
          "total_count": 1,
          "by_type": {
            "funding": 1,
            "marketing": 0,
            "partnership": 0,
            "product": 0,
            "executive": 0,
            "legal": 0
          },
          "timeline_available": true
        }
      }
    ]
  },
  "errors": null,
  "api_calls_used": 2
}

generate_report

输入:

{
  "competitors": ["微信", "支付宝"],
  "auto_fetch": true,
  "modules": ["radar", "comparison", "swot"],
  "save_path": "./report.html"
}

run_full_analysis

输入:

{
  "competitors": ["微信", "支付宝"],
  "save_report": true,
  "save_path": "./full_analysis_report.html"
}

报告模块说明

  1. 雷达图模块: 多维度能力评估雷达图
  2. 功能对比矩阵: 核心功能横向对比表
  3. SWOT分析: 优势、劣势、机会、威胁分析
  4. 趋势图表: 版本更新时间线
  5. 用户情感分布: 用户评价情感分析饼图
  6. 痛点词云: 用户痛点关键词云图

API配额说明

本服务使用Tavily API进行网络搜索,每次工具调用会消耗不同数量的API配额:

  • search_competitor_updates: 每个竞品消耗2次调用
  • analyze_reviews_sentiment: 每个竞品消耗2次调用
  • analyze_user_painpoints: 不额外消耗API配额(复用情感分析数据)
  • track_market_activities: 每个竞品消耗2次调用
  • generate_report: 不消耗API配额
  • run_full_analysis: 根据启用模块消耗相应配额

建议合理规划使用频率,避免超出API配额限制。

常见问题

Q: 如何获取Tavily API Key? A: 访问 https://tavily.com 注册账户并获取API Key。

Q: 报告中的LLM分析部分为什么是占位符? A: LLM分析需要由MCP客户端执行,服务只生成Prompt供客户端调用LLM完成分析。

Q: 如何自定义报告维度? A: 使用 radar_dimensionscomparison_dimensions 参数在生成报告时指定自定义维度。

开发指南

运行测试

pytest tests/

代码质量检查

ruff check .

License

MIT License