"""Entry point for running the Sentry MCP server."""
import logging
import os
from .server import app
# Enable logging
logging.basicConfig(
level=os.environ.get("LOG_LEVEL", "INFO").upper(),
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
)
logger = logging.getLogger(__name__)
if __name__ == "__main__":
host = os.environ.get("SENTRY_MCP_HOST", "0.0.0.0")
port = int(os.environ.get("SENTRY_MCP_PORT", "8080"))
logger.info(f"Starting Sentry MCP server on {host}:{port}/mcp")
# Use path="/mcp" to match the default FastMCP path that clients expect
# The full URL should be: http://host:port/mcp
app.run(transport="http", host=host, port=port, path="/mcp")