Metadata-Version: 2.4
Name: mcp-tech-ai-tracker
Version: 0.1.0
Summary: 科技AI资讯 MCP Server — 模型排行/开源趋势/AI行业速览/多源摘要, 数据源GitHub+HackerNews+arXiv+HuggingFace+TianAPI
Author: Tech AI Tracker Team
License-Expression: MIT
License-File: LICENSE
Keywords: ai,arxiv,github,hackernews,huggingface,llm,mcp,news,open-source,tech
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27.0
Requires-Dist: mcp[cli]>=1.9.2
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# 🤖 mcp-tech-ai-tracker

**科技AI资讯 MCP Server** — 模型排行、开源趋势、AI行业速览、每日多源摘要，一个 Server 全搞定。

基于扣子技能 tech-ai-tracker 重写为 MCP Server。

数据源：[GitHub Search API](https://docs.github.com/en/rest/search) + [HackerNews Algolia API](https://hn.algolia.com/api) + [arXiv API](http://export.arxiv.org/api/query) + [HuggingFace API](https://huggingface.co/api) + [TianAPI](https://www.tianapi.com/)（可选）。

---

## 🛠 工具列表

| 工具 | 功能 | 典型场景 |
|------|------|---------|
| `model_rank` | 模型排行与技术数据：LLM排行/开源趋势/Benchmark对比 | "LLM下载排行" "AI开源趋势" "模型对比" |
| `ai_pulse` | AI行业速览：今日热点/本周回顾/热门话题 | "今天AI圈有什么" "本周AI热点" |
| `tech_digest` | 每日多源摘要：新闻+开源+论文+模型一键聚合 | "今天的AI摘要" "科技日报" |

---

## 📦 安装

```bash
pip install mcp-tech-ai-tracker
```

或从源码安装：

```bash
git clone https://github.com/yourname/mcp-tech-ai-tracker.git
cd mcp-tech-ai-tracker
pip install -e .
```

## ⚙️ 配置

### 可选

[TianAPI](https://www.tianapi.com/) API 密钥（免费注册即得，用于AI/科技新闻增强）：

```bash
export TIANAPI_KEY="your_api_key_here"
```

> 不设置 TIANAPI_KEY 时，`ai_pulse` 和 `tech_digest` 仍可返回 HackerNews 社区热点和开源数据（跳过新闻部分）。

## 🚀 使用

### 命令行

```bash
# STDIO 模式 (默认)
mcp-tech-ai-tracker

# 或
python -m mcp_tech_ai_tracker
```

### MCP 客户端配置

在 Claude Desktop / Cherry Studio / ChatBox 等 MCP 客户端中添加：

```json
{
  "mcpServers": {
    "tech-ai-tracker": {
      "command": "mcp-tech-ai-tracker",
      "env": {
        "TIANAPI_KEY": "your_tianapi_key"
      }
    }
  }
}
```

### 开发测试

```bash
# 安装 FastMCP CLI
pip install "mcp[cli]"

# 交互式测试
mcp dev src/mcp_tech_ai_tracker/server.py
```

---

## 💡 工具详细说明

### model_rank — 模型排行与技术数据

```python
# LLM模型下载排行 (优先HuggingFace，不可用时降级到GitHub)
model_rank(action="llm_rank")

# 指定分类
model_rank(action="llm_rank", category="text-generation")

# 开源AI项目趋势
model_rank(action="trending_repos")

# 指定语言和时间范围
model_rank(action="trending_repos", language="python", time_range="7d")

# Benchmark对比 (需HuggingFace，不可用时降级)
model_rank(action="model_compare")
```

**参数**：
- `action`: llm_rank / trending_repos / model_compare
- `category`: 模型分类过滤（llm_rank/model_compare）
- `language`: 编程语言过滤（trending_repos）
- `time_range`: 7d / 30d / 365d
- `top_n`: 返回条数，默认10，最大30

### ai_pulse — AI行业速览

```python
# 今日AI速览
ai_pulse(action="today")

# 本周科技回顾
ai_pulse(action="weekly", category="tech")

# 热门开源话题
ai_pulse(action="hot", category="opensource")

# 关键词过滤
ai_pulse(action="today", keyword="GPT")
```

**参数**：
- `action`: today / weekly / hot
- `category`: ai / tech / opensource
- `keyword`: 过滤关键词

数据源：HackerNews（技术社区热点）+ TianAPI（AI/科技/IT新闻，需KEY），30天时效过滤

### tech_digest — 每日多源摘要

```python
# 今日完整摘要（新闻+开源+论文+模型）
tech_digest()

# 指定日期
tech_digest(date="2025-05-15")

# 只要论文和模型
tech_digest(include="papers,models")

# 只要新闻
tech_digest(include="news")
```

**参数**：
- `date`: 指定日期，YYYY-MM-DD格式，不传则默认今天
- `include**: 包含内容类型，逗号分隔: news/repos/papers/models，默认全部

数据源：GitHub+HackerNews+arXiv+HuggingFace+TianAPI，30天时效过滤，约200 tokens精简输出

---

## 📋 数据源

| 优先级 | 数据源 | 覆盖 | 限制 |
|--------|--------|------|------|
| 主力 | GitHub Search API | 开源项目趋势 | 10次/分钟，内置频率控制 |
| 主力 | HackerNews Algolia API | 技术社区热点 | 免费 |
| 主力 | arXiv API | AI论文 | 免费 |
| 增强 | HuggingFace API | 模型排行/Benchmark | 国内可能不可访问，自动降级 |
| 降级 | TianAPI | AI/科技/IT新闻 | 需TIANAPI_KEY |

---

## 📋 环境变量

| 变量 | 必需 | 说明 |
|------|------|------|
| `TIANAPI_KEY` | ❌ | 天聚数行API密钥，AI/科技新闻增强用，不设置时跳过新闻部分 |

---

## 🔧 降级策略

- **HuggingFace 不可用**：自动降级到 GitHub AI 项目排行（按Stars排序）
- **GitHub API 频率限制**：内置请求间隔0.6秒的频率控制
- **TianAPI 无 KEY**：跳过新闻部分，仅返回 HackerNews 社区数据
- **所有新闻数据**：30天时效过滤，过期数据自动移除

---

## 📄 License

MIT
