Skip to content

Commit 50c0a65

Browse files
authored
workflow (#3)
* refactor * workflow: generate docs * fix * fix * Update docs.yml * fix
1 parent fdb4661 commit 50c0a65

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

.github/workflows/docs.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Generate Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
9+
jobs:
10+
docs:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.12'
20+
21+
- name: Generate HTML docs with Sphinx
22+
run: |
23+
pip install sphinx sphinx-rtd-theme sphinx-autodoc-typehints
24+
sphinx-apidoc -o docs/source src/news_mcp_server
25+
26+
- name: Upload docs artifact
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: api-docs
30+
path: docs

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ dmake build # 构建 Docker 镜像
174174
- 引入基于 JWT 或 OAuth2 的更安全鉴权机制
175175
- 支持多进程/多实例共享会话(如使用 Redis Session Store)
176176
- 优化 Elasticsearch 查询性能,添加缓存层(Redis)
177-
- 集成请求限流和熔断策略,以防止高频或恶意请求
178177
- 增加端到端集成测试覆盖,并配置 CI/CD 流水线
179178
- 支持 ES 聚合查询与热门关键词统计功能
180179
- 提供 Swagger UI 或 Postman 集合示例

src/news_mcp_server/mcp_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
from .services.news_service import NewsService
77
from .clients.elastic_client import AsyncElasticClient
88
from .middlewares.audit import AuditMiddleware
9-
import structlog
10-
logger = structlog.get_logger(__name__)
11-
9+
from .utils.logger import logger
1210
logger.info("News MCP module")
11+
12+
1313
class NewsMCP(FastMCP):
1414
"""FastMCP server with authentication middleware."""
1515
pass

0 commit comments

Comments
 (0)