refactor(mcp): use discover_and_filter in main.py; add per-service manifests
- main.py: drops the hard-coded McpService class and MCP_SERVICES list. Lifespan now calls discover_and_filter() which does import + env filtering. Unset MCP_SERVICES reproduces today's behavior exactly. - spark_executor/service.py: new file exporting SERVICE = McpService( name='spark_executor', app=spark_executor.app, mount_path='/spark-executor-mcp'). - files_mcp/service.py: new file exporting SERVICE = McpService( name='files', app=files_mcp.app, mount_path='/files-mcp'). The McpService dataclass itself moved to common/mcp_service.py in the prior commit. 327 existing tests pass unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# coding=utf-8
|
||||
"""
|
||||
@Time :2026/6/30
|
||||
@Author :tao.chen
|
||||
|
||||
Pluggable manifest for the spark_executor MCP service. The name and
|
||||
mount_path here are matched against the MCP_SERVICES env whitelist and
|
||||
the BUILTIN_SERVICES list in common.mcp_service.
|
||||
"""
|
||||
from common.mcp_service import McpService
|
||||
from spark_executor import app
|
||||
|
||||
SERVICE: McpService = McpService(
|
||||
name="spark_executor",
|
||||
app=app,
|
||||
mount_path="/spark-executor-mcp",
|
||||
)
|
||||
Reference in New Issue
Block a user