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.
README
π° MCP News Collector
νκ΅ μ£Όμμμ₯ λ΄μ€ μ€μκ° μμ§ λ° λΆμμ μν MCP μλ²
π― νλ‘μ νΈ κ°μ
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) λ°©λ²λ‘ μ λ°λ¦ λλ€:
- Red: μ€ν¨νλ ν μ€νΈ μμ±
- Green: ν μ€νΈλ₯Ό ν΅κ³Όμν€λ μ΅μνμ μ½λ μμ±
- Refactor: μ½λ κ°μ λ° μ΅μ ν
π€ κΈ°μ¬νκΈ°
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
κ°λ° κ°μ΄λλΌμΈ
- λͺ¨λ μλ‘μ΄ κΈ°λ₯μ ν μ€νΈμ ν¨κ» κ°λ°
- μ½λ 컀λ²λ¦¬μ§ 80% μ΄μ μ μ§
- νμ ννΈ μ¬μ© νμ
- λ¬Έμν μ² μ ν
π λΌμ΄μ μ€
μ΄ νλ‘μ νΈλ MIT λΌμ΄μ μ€ νμ λ°°ν¬λ©λλ€. μμΈν λ΄μ©μ LICENSE νμΌμ μ°Έμ‘°νμΈμ.
π λ¬Έμ
- κ°λ°μ: Your Name
- μ΄μ νΈλ컀: GitHub Issues
- νλ‘μ νΈ μν€: GitHub Wiki
π κ°μ¬μ λ§
- MCP (Model Context Protocol) - Anthropic
- FastAPI - SebastiΓ‘n Ramirez
- KoBERT - SKT Brain
β μ΄ νλ‘μ νΈκ° λμμ΄ λμ ¨λ€λ©΄ Starλ₯Ό λλ¬μ£ΌμΈμ!
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
E2B
Using MCP to run code via e2b.