内容
# NewsBot-MCP
## 概述
**NewsBot-MCP** 是一个基于 Kotlin 的对话式聊天机器人,它使用 **Model Context Protocol (MCP)** 传递实时新闻内容。
## 功能
- 使用 MCP 管理对话上下文。
- 根据用户输入获取当前新闻。
- 自动生成新闻摘要。
## 设置说明
### 1. 克隆存储库
```bash
git clone https://github.com/ishabodiwala/NewsBot-MCP.git
cd NewsBot-MCP
```
### 2. 在 Android Studio 中打开项目
### 3. 添加您的 API 密钥
- 从 https://newsapi.org 获取一个 **News API key**。
- 从 https://www.anthropic.com/api 获取一个 **Anthropic API key**。
- 打开 `Config` 文件并找到 API 密钥变量。
- 将占位符替换为您实际的密钥:
```
const val NEWS_API_KEY = "your_news_api_key"
const val ANTHROPIC_API_KEY = "your-anthropic-api-key"
```
### 4. 运行应用程序
## 演示
https://github.com/user-attachments/assets/6b323b20-55c7-4ed3-828f-87947643e836
## 参考
https://github.com/modelcontextprotocol/kotlin-sdk/tree/main/samples/kotlin-mcp-server