#!/usr/bin/env python3
"""HTTP server entry point for 42crunch MCP Server."""
import argparse
from src.http_server import run_server
def main():
"""Main entry point for HTTP server."""
parser = argparse.ArgumentParser(
description="42crunch MCP HTTP Server - JSON-RPC over HTTP",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
Examples:
# Run on default host and port (0.0.0.0:8000)
python http_main.py
# Run on custom host and port
python http_main.py --host 127.0.0.1 --port 8080
# Run with auto-reload for development
python http_main.py --reload
"""
)
parser.add_argument(
"--host",
default="0.0.0.0",
help="Host to bind to (default: 0.0.0.0)"
)
parser.add_argument(
"--port",
type=int,
default=8000,
help="Port to bind to (default: 8000)"
)
parser.add_argument(
"--reload",
action="store_true",
help="Enable auto-reload for development"
)
args = parser.parse_args()
print(f"Starting 42crunch MCP HTTP Server on {args.host}:{args.port}")
print(f"JSON-RPC endpoint: http://{args.host}:{args.port}/jsonrpc")
print(f"API docs: http://{args.host}:{args.port}/docs")
run_server(host=args.host, port=args.port, reload=args.reload)
if __name__ == "__main__":
main()