
To make the console script defined in setup.py work, the code in this if __name__ == "__main__": block should be moved into a main() function. The if block should then just call main().
# Server startup and configuration
def main():
try:
logger.info(f"Starting Gemini Research Agent MCP Server")
logger.info(f"Using model: {RESEARCH_MODEL}")
logger.info(f"Effort tiers configured: {', '.join(EFFORT_TIERS.keys())}")
# Run the FastMCP server
mcp.run()
except KeyboardInterrupt:
logger.info("Server shutdown requested")
except Exception as e:
logger.error(f"Server startup failed: {e}")
raise
finally:
# Cleanup active sessions
active_research_sessions.clear()
logger.info("Server shutdown complete")
if __name__ == "__main__":
main()
Originally posted by @gemini-code-assist[bot] in google-gemini/gemini-fullstack-langgraph-quickstart#203 (comment)
To make the console script defined in
setup.pywork, the code in thisif __name__ == "__main__":block should be moved into amain()function. Theifblock should then just callmain().Originally posted by @gemini-code-assist[bot] in google-gemini/gemini-fullstack-langgraph-quickstart#203 (comment)