Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /ViperJuice_Code-Index-MCP /mcp_server /cli /server_commands.py
| """Server startup CLI commands.""" | |
| from __future__ import annotations | |
| import os | |
| import click | |
| def _default_host() -> str: | |
| return os.getenv("MCP_SERVER_HOST", "127.0.0.1") | |
| def _default_port() -> int: | |
| try: | |
| return int(os.getenv("MCP_SERVER_PORT", "8765")) | |
| except ValueError: | |
| return 8765 | |
| def serve(host: str, port: int, reload: bool, rebuild_on_schema_mismatch: bool) -> None: | |
| """Start the FastAPI admin/debug HTTP gateway, not the MCP Streamable HTTP transport.""" | |
| from pathlib import Path | |
| import uvicorn | |
| os.environ.setdefault("MCP_INDEX_STORAGE_PATH", str(Path.home() / ".mcp" / "indexes")) | |
| os.environ.setdefault("MCP_SKIP_PLUGIN_PREINDEX", "true") | |
| if rebuild_on_schema_mismatch: | |
| os.environ["MCP_REBUILD_ON_SCHEMA_MISMATCH"] = "1" | |
| click.echo( | |
| f"Starting FastAPI admin/debug gateway on http://{host}:{port} " | |
| "(not the MCP Streamable HTTP transport)" | |
| ) | |
| uvicorn.run("mcp_server.gateway:app", host=host, port=port, reload=reload) | |
| def stdio(rebuild_on_schema_mismatch: bool) -> None: | |
| """Start the primary MCP client transport over STDIO (JSON-RPC over stdin/stdout).""" | |
| from mcp_server.cli.stdio_runner import run | |
| if rebuild_on_schema_mismatch: | |
| os.environ["MCP_REBUILD_ON_SCHEMA_MISMATCH"] = "1" | |
| run() | |
Xet Storage Details
- Size:
- 1.99 kB
- Xet hash:
- 54da2e6eb6a2176f9571ef997e478ea614febc3e7685cdaa2b7ea9a3952f2998
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.