Skip to main content
Glama

MCP News Collector

by whdghk1907
README.md7.1 kB
# 📰 MCP News Collector > **한국 주식시장 뉴스 실시간 수집 및 분석을 위한 MCP 서버** [![Python](https://img.shields.io/badge/Python-3.11+-blue.svg)](https://python.org) [![FastAPI](https://img.shields.io/badge/FastAPI-0.104+-green.svg)](https://fastapi.tiangolo.com) [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Tests](https://img.shields.io/badge/Tests-Passing-brightgreen.svg)](tests/) ## 🎯 프로젝트 개요 MCP News Collector는 한국 주식시장 관련 뉴스를 실시간으로 수집, 분석하여 투자 인사이트를 제공하는 MCP(Model Context Protocol) 서버입니다. ### ✨ 주요 기능 - 🔄 **실시간 뉴스 수집**: 네이버, 다음, RSS 피드 등 다양한 소스 - 🧠 **AI 기반 분석**: 감정 분석, 시장 영향도 예측, 루머 탐지 - 📊 **실시간 모니터링**: WebSocket 기반 실시간 데이터 스트리밍 - 🌐 **REST API**: FastAPI 기반 RESTful 엔드포인트 - 🔧 **MCP 통합**: Claude 등 AI 어시스턴트와 원활한 연동 ### 🏗️ 아키텍처 ``` ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │ Data Sources │ │ MCP Server │ │ AI Assistant │ │ │ │ │ │ │ │ • 네이버 뉴스 │────▶│ • 수집 엔진 │◀───│ • Claude │ │ • 다음 뉴스 │ │ • 분석 엔진 │ │ • ChatGPT │ │ • RSS 피드 │ │ • REST API │ │ • 기타 │ │ • 빅카인즈 │ │ • WebSocket │ │ │ └─────────────────┘ └─────────────────┘ └─────────────────┘ ``` ## 🚀 빠른 시작 ### 사전 요구사항 - Python 3.11+ - PostgreSQL 13+ - Redis 6+ ### 설치 ```bash # 1. 저장소 클론 git clone https://github.com/YOUR_USERNAME/mcp-news-collector.git cd mcp-news-collector # 2. 가상환경 생성 및 활성화 python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate # 3. 의존성 설치 pip install -e . # 4. 환경변수 설정 cp .env.example .env # .env 파일을 편집하여 데이터베이스 및 API 설정 # 5. 데이터베이스 마이그레이션 alembic upgrade head # 6. 서버 실행 python -m src.server.main ``` ### MCP 클라이언트 연결 ```python from mcp import Client # MCP 서버 연결 client = Client("stdio", ["python", "-m", "src.server.main"]) # 뉴스 수집 result = await client.call_tool("get_recent_news", { "keyword": "삼성전자", "limit": 10 }) ``` ## 📖 API 문서 ### MCP Tools | Tool | 설명 | 파라미터 | |------|------|----------| | `get_recent_news` | 최근 뉴스 조회 | keyword, source, limit, hours | | `analyze_news_sentiment` | 뉴스 감정 분석 | news_id, text, detail_level | | `analyze_news_impact` | 시장 영향도 분석 | news_id, company, timeframe | | `detect_market_rumors` | 루머 탐지 | news_id, threshold | | `monitor_news_stream` | 실시간 뉴스 모니터링 | topics, filters | ### REST API API 문서는 서버 실행 후 다음 URL에서 확인할 수 있습니다: - Swagger UI: `http://localhost:8000/api/docs` - ReDoc: `http://localhost:8000/api/redoc` #### 주요 엔드포인트 ```bash # 뉴스 조회 GET /api/v1/news?query=삼성전자&limit=10 # 감정 분석 POST /api/v1/analysis/sentiment { "news_ids": ["news_1", "news_2"], "options": {"include_confidence": true} } # 실시간 모니터링 상태 GET /api/v1/monitoring/status ``` ## 🧪 테스트 ```bash # 전체 테스트 실행 pytest # 특정 모듈 테스트 pytest tests/unit/test_sentiment_analyzer.py # 커버리지 확인 pytest --cov=src --cov-report=html ``` ### 테스트 현황 - **전체 테스트**: 169개 통과 - **커버리지**: - 감정 분석기: 92% - 시장 영향 분석기: 85% - 실시간 모니터링: 76% - 루머 탐지: 89% - 뉴스 요약: 90% ## 📊 개발 현황 ### Phase 별 진행 상황 - ✅ **Phase 1**: 기초 인프라 구축 (완료) - ✅ **Phase 2**: 핵심 수집 시스템 (완료) - ✅ **Phase 3**: 분석 엔진 구현 (완료) - 🔄 **Phase 4**: API 및 통합 시스템 (75% 완료) - ⏳ **Phase 5**: 최적화 및 배포 (예정) 자세한 개발 계획은 [detailed-development-plan.md](detailed-development-plan.md)를 참조하세요. ## 🏗️ 프로젝트 구조 ``` mcp-news-collector/ ├── src/ # 메인 소스 코드 │ ├── analysis/ # 분석 엔진 (감정, 영향도, 루머 탐지 등) │ ├── collectors/ # 뉴스 수집기 (네이버, 다음, RSS) │ ├── monitoring/ # 실시간 모니터링 시스템 │ ├── server/ # MCP 서버 및 REST API │ └── utils/ # 공통 유틸리티 ├── tests/ # 테스트 코드 │ ├── unit/ # 단위 테스트 │ └── integration/ # 통합 테스트 ├── docs/ # 문서 ├── configs/ # 설정 파일 └── scripts/ # 유틸리티 스크립트 ``` ## 🔧 개발 도구 ### 코드 품질 ```bash # 코드 포맷팅 black src/ tests/ # 타입 체킹 mypy src/ # 린팅 pylint src/ # 보안 스캔 bandit -r src/ ``` ### TDD 개발 프로세스 이 프로젝트는 **엄격한 TDD(Test-Driven Development)** 방법론을 따릅니다: 1. **Red**: 실패하는 테스트 작성 2. **Green**: 테스트를 통과시키는 최소한의 코드 작성 3. **Refactor**: 코드 개선 및 최적화 ## 🤝 기여하기 1. Fork the repository 2. Create your feature branch (`git checkout -b feature/amazing-feature`) 3. Commit your changes (`git commit -m 'Add some amazing feature'`) 4. Push to the branch (`git push origin feature/amazing-feature`) 5. Open a Pull Request ### 개발 가이드라인 - 모든 새로운 기능은 테스트와 함께 개발 - 코드 커버리지 80% 이상 유지 - 타입 힌트 사용 필수 - 문서화 철저히 ## 📄 라이선스 이 프로젝트는 MIT 라이선스 하에 배포됩니다. 자세한 내용은 [LICENSE](LICENSE) 파일을 참조하세요. ## 📞 문의 - **개발자**: [Your Name](mailto:your.email@example.com) - **이슈 트래커**: [GitHub Issues](https://github.com/YOUR_USERNAME/mcp-news-collector/issues) - **프로젝트 위키**: [GitHub Wiki](https://github.com/YOUR_USERNAME/mcp-news-collector/wiki) ## 🙏 감사의 말 - [MCP (Model Context Protocol)](https://github.com/anthropics/mcp) - Anthropic - [FastAPI](https://fastapi.tiangolo.com/) - Sebastián Ramirez - [KoBERT](https://github.com/SKTBrain/KoBERT) - SKT Brain --- ⭐ 이 프로젝트가 도움이 되셨다면 Star를 눌러주세요!

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/whdghk1907/mcp-news-collector'

If you have feedback or need assistance with the MCP directory API, please join our Discord server