@@ -0,0 +1,8 @@
+.git
+__pycache__
+.pytest_cache
+.venv
+logs
+*.log
+server.pid
+uvicorn.log
@@ -0,0 +1,19 @@
+FROM python:3.13-slim
+
+WORKDIR /app
+ENV PYTHONDONTWRITEBYTECODE=1 \
+ PYTHONUNBUFFERED=1
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends build-essential curl \
+ && rm -rf /var/lib/apt/lists/*
+COPY requirements.txt ./requirements.txt
+RUN pip install --no-cache-dir -r requirements.txt
+COPY . .
+EXPOSE 8506
+CMD ["uvicorn", "news_mcp.mcp_server_fastmcp:app", "--host", "0.0.0.0", "--port", "8506"]
@@ -4,6 +4,7 @@ FastMCP-based MCP server that turns news feeds into **deduplicated, enriched clu
## Quick start
+Local:
```bash
cd news-mcp
source .venv/bin/activate
@@ -11,6 +12,11 @@ pip install -r requirements.txt
./run.sh
```
+Docker Compose:
+```bash
+docker compose up --build
+```
Default SSE mount (FastMCP):
- `http://127.0.0.1:8506/mcp/sse`
@@ -0,0 +1,17 @@
+services:
+ news-mcp:
+ build: .
+ container_name: news-mcp
+ env_file:
+ - .env
+ environment:
+ NEWS_MCP_DATA_DIR: ./data
+ NEWS_MCP_DB_PATH: ./data/news.sqlite
+ NEWS_PROMPTS_DIR: ./prompts
+ NEWS_ENTITY_ALIASES_FILE: ./config/entity_aliases.json
+ working_dir: /app
+ volumes:
+ - ./:/app
+ ports:
+ - "8506:8506"
+ restart: unless-stopped
@@ -99,6 +99,9 @@ class SQLiteClusterStore:
def _init_db(self) -> None:
Path(self.db_path).parent.mkdir(parents=True, exist_ok=True)
with self._conn() as conn:
+ conn.execute("PRAGMA journal_mode=WAL")
+ conn.execute("PRAGMA synchronous=NORMAL")
+ conn.execute("PRAGMA busy_timeout=5000")
conn.execute(
"""
CREATE TABLE IF NOT EXISTS clusters (