diff --git a/runtimes/basic/core_py/thinui/api.py b/runtimes/basic/core_py/thinui/api.py index 1b99517..ed3a71e 100644 --- a/runtimes/basic/core_py/thinui/api.py +++ b/runtimes/basic/core_py/thinui/api.py @@ -318,7 +318,6 @@ def run_api_server(host: str = "127.0.0.1", port: int = 8001): print(f" GET http://{host}:{port}/api/udo/workflows") print(f" GET http://{host}:{port}/api/udo/publish/targets") print(f" GET http://{host}:{port}/api/udo/vault") - print(f" GET http://{host}:{port}/api/udo/mcp/status") print(f" GET http://{host}:{port}/api/udo/checks") print(f" POST http://{host}:{port}/api/udo/exec") diff --git a/runtimes/basic/core_py/udo_runtime/__init__.py b/runtimes/basic/core_py/udo_runtime/__init__.py index ec485ee..b1c4e82 100644 --- a/runtimes/basic/core_py/udo_runtime/__init__.py +++ b/runtimes/basic/core_py/udo_runtime/__init__.py @@ -9,12 +9,10 @@ - Workflows: Multi-step orchestration - Publish: Content publishing to targets - Vault: File system abstraction -- MCP: Model Context Protocol server management - Checks: System health checks - Exec: Command execution -This module is the Python reference implementation. -A Rust-native version will be built for Snackbar production deployment. +This module is the Python runtime implementation. """ __version__ = "0.1.0" diff --git a/runtimes/basic/core_py/udo_runtime/api.py b/runtimes/basic/core_py/udo_runtime/api.py index c6cdb2e..8daf020 100644 --- a/runtimes/basic/core_py/udo_runtime/api.py +++ b/runtimes/basic/core_py/udo_runtime/api.py @@ -235,40 +235,6 @@ def write_vault(): success = rt.write_vault_file(data["path"], data.get("content", "")) return jsonify({"success": success}) - # ─── MCP ─────────────────────────────────────────────────────── - - @bp.route("/mcp/status", methods=["GET"]) - def mcp_status(): - servers = rt.get_mcp_status() - return jsonify([{ - "id": s.id, - "name": s.name, - "running": s.running, - "output": s.output, - "error": s.error, - "startedAt": s.started_at, - } for s in servers]) - - @bp.route("/mcp//start", methods=["POST"]) - def start_mcp(server_id: str): - success = rt.start_mcp_server(server_id) - return jsonify({"success": success}) - - @bp.route("/mcp//stop", methods=["POST"]) - def stop_mcp(server_id: str): - success = rt.stop_mcp_server(server_id) - return jsonify({"success": success}) - - @bp.route("/mcp//call", methods=["POST"]) - def call_mcp(server_id: str): - data = request.get_json() or {} - result = rt.call_mcp_tool( - server_id, - data.get("tool", ""), - data.get("args", {}), - ) - return jsonify(result) - # ─── Checks ──────────────────────────────────────────────────── @bp.route("/checks", methods=["GET"]) diff --git a/runtimes/basic/core_py/udo_runtime/runtime.py b/runtimes/basic/core_py/udo_runtime/runtime.py index 0e28ca7..7f739f8 100644 --- a/runtimes/basic/core_py/udo_runtime/runtime.py +++ b/runtimes/basic/core_py/udo_runtime/runtime.py @@ -75,16 +75,6 @@ class UDOPublishTarget: status: str = "disconnected" # 'connected' | 'disconnected' | 'error' -@dataclass -class MCPServerStatus: - id: str - name: str - running: bool = False - output: List[str] = field(default_factory=list) - error: Optional[str] = None - started_at: Optional[int] = None - - @dataclass class CheckResult: id: str @@ -117,7 +107,6 @@ def __init__(self, data_dir: Optional[str] = None): self.agents: Dict[str, UDOAgent] = {} self.workflows: Dict[str, UDOWorkflow] = {} self.publish_targets: Dict[str, UDOPublishTarget] = {} - self.mcp_servers: Dict[str, MCPServerStatus] = {} self.checks: Dict[str, CheckResult] = {} # Load persisted state @@ -149,7 +138,6 @@ def _load_state(self): ("agents", UDOAgent), ("workflows", UDOWorkflow), ("publish_targets", UDOPublishTarget), - ("mcp_servers", MCPServerStatus), ("checks", CheckResult), ]: items = self._load_state_file(key) @@ -411,34 +399,6 @@ def write_vault_file(self, path: str, content: str) -> bool: target.write_text(content) return True - # ─── MCP ─────────────────────────────────────────────────────── - - def get_mcp_status(self) -> List[MCPServerStatus]: - return list(self.mcp_servers.values()) - - def start_mcp_server(self, server_id: str) -> bool: - if server_id in self.mcp_servers: - self.mcp_servers[server_id].running = True - self.mcp_servers[server_id].started_at = int(time.time()) - self._persist("mcp_servers") - return True - return False - - def stop_mcp_server(self, server_id: str) -> bool: - if server_id in self.mcp_servers: - self.mcp_servers[server_id].running = False - self._persist("mcp_servers") - return True - return False - - def call_mcp_tool(self, server_id: str, tool: str, args: Dict[str, Any]) -> Any: - if server_id not in self.mcp_servers: - return {"error": f"MCP server {server_id} not found"} - if not self.mcp_servers[server_id].running: - return {"error": f"MCP server {server_id} is not running"} - # Placeholder: actual MCP tool call - return {"result": f"Called {tool} on {server_id} with {args}"} - # ─── Checks ──────────────────────────────────────────────────── def list_checks(self) -> List[CheckResult]: