app_stop_server
Stop the currently running HTTP server to halt web application serving and free system resources.
Instructions
Stop the currently running HTTP server.
Returns:
A dictionary containing the result of the operation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:480-512 (handler)The handler function for the app_stop_server tool. It stops the HTTP server serving the app, resets response state, and returns success or error status. Registered via @mcp.tool() decorator.@mcp.tool() def app_stop_server() -> Dict[str, Any]: """ Stop the currently running HTTP server. Returns: A dictionary containing the result of the operation """ global http_server, app_response, response_ready try: if http_server: logger.info("Stopping HTTP server") http_server.shutdown() http_server.server_close() http_server = None # Reset response state app_response = None response_ready = False return { "success": True, "message": "HTTP server stopped successfully" } else: return { "success": False, "error": "No HTTP server is currently running" } except Exception as e: logger.error(f"Error stopping server: {e}") return {"success": False, "error": f"Failed to stop server: {str(e)}"}
- main.py:480-480 (registration)The @mcp.tool() decorator registers the app_stop_server function as an MCP tool.@mcp.tool()