diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..ca0ee09 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,30 @@ +name: Generate Docs + +on: + push: + branches: + - main + - dev + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + + - name: Generate HTML docs with Sphinx + run: | + pip install sphinx sphinx-rtd-theme sphinx-autodoc-typehints + sphinx-apidoc -o docs/source src/news_mcp_server + + - name: Upload docs artifact + uses: actions/upload-artifact@v4 + with: + name: api-docs + path: docs diff --git a/README.md b/README.md index f368f62..32cd023 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,6 @@ dmake build # 构建 Docker 镜像 - 引入基于 JWT 或 OAuth2 的更安全鉴权机制 - 支持多进程/多实例共享会话(如使用 Redis Session Store) - 优化 Elasticsearch 查询性能,添加缓存层(Redis) -- 集成请求限流和熔断策略,以防止高频或恶意请求 - 增加端到端集成测试覆盖,并配置 CI/CD 流水线 - 支持 ES 聚合查询与热门关键词统计功能 - 提供 Swagger UI 或 Postman 集合示例 diff --git a/src/news_mcp_server/mcp_server.py b/src/news_mcp_server/mcp_server.py index 6d499ca..f9e05e9 100644 --- a/src/news_mcp_server/mcp_server.py +++ b/src/news_mcp_server/mcp_server.py @@ -6,10 +6,10 @@ from .services.news_service import NewsService from .clients.elastic_client import AsyncElasticClient from .middlewares.audit import AuditMiddleware -import structlog -logger = structlog.get_logger(__name__) - +from .utils.logger import logger logger.info("News MCP module") + + class NewsMCP(FastMCP): """FastMCP server with authentication middleware.""" pass