MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / api_start

Function api_start

src/codegraphcontext/cli/main.py:944–958  ·  view source on GitHub ↗

Start the CGC Gateway HTTP API server. This server provides a REST API that can be used by ChatGPT Actions, Claude, or web frontends to interact with the CodeGraphContext graph.

(
    host: str = typer.Option("0.0.0.0", help="Host to bind the server to"),
    port: int = typer.Option(8000, help="Port to bind the server to"),
    reload: bool = typer.Option(False, help="Enable auto-reload (development only)"),
)

Source from the content-addressed store, hash-verified

942
943@api_app.command("start")
944def api_start(
945 host: str = typer.Option("0.0.0.0", help="Host to bind the server to"),
946 port: int = typer.Option(8000, help="Port to bind the server to"),
947 reload: bool = typer.Option(False, help="Enable auto-reload (development only)"),
948):
949 """
950 Start the CGC Gateway HTTP API server.
951
952 This server provides a REST API that can be used by ChatGPT Actions,
953 Claude, or web frontends to interact with the CodeGraphContext graph.
954 """
955 import uvicorn
956 console.print(f"[bold green]Starting CGC Gateway on {host}:{port}...[/bold green]")
957 _load_credentials()
958 uvicorn.run("codegraphcontext.api.app:app", host=host, port=port, reload=reload)
959
960
961

Callers

nothing calls this directly

Calls 3

_load_credentialsFunction · 0.85
printMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected