MCP News Collector

MCP News Collector

A Model Context Protocol server that collects and analyzes Korean stock market news in real-time, providing investment insights through AI-based analysis of sentiment, market impact, and rumor detection.

Category
Visit Server

README

📰 MCP News Collector

한국 주식시장 뉴스 실시간 수집 및 분석을 위한 MCP 서버

Python FastAPI License 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+

설치

# 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 클라이언트 연결

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

주요 엔드포인트

# 뉴스 조회
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

🧪 테스트

# 전체 테스트 실행
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를 참조하세요.

🏗️ 프로젝트 구조

mcp-news-collector/
├── src/                    # 메인 소스 코드
│   ├── analysis/          # 분석 엔진 (감정, 영향도, 루머 탐지 등)
│   ├── collectors/        # 뉴스 수집기 (네이버, 다음, RSS)
│   ├── monitoring/        # 실시간 모니터링 시스템
│   ├── server/            # MCP 서버 및 REST API
│   └── utils/             # 공통 유틸리티
├── tests/                 # 테스트 코드
│   ├── unit/              # 단위 테스트
│   └── integration/       # 통합 테스트
├── docs/                  # 문서
├── configs/               # 설정 파일
└── scripts/               # 유틸리티 스크립트

🔧 개발 도구

코드 품질

# 코드 포맷팅
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 파일을 참조하세요.

📞 문의

🙏 감사의 말


⭐ 이 프로젝트가 도움이 되셨다면 Star를 눌러주세요!

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured