Skip to content

![high](https://www.gstatic.com/codereviewagent/high-priority.svg) #23479

Description

@kristentr

high

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreIssues related to User Interface, OS Support, Core Functionalitystatus/need-triageIssues that need to be triaged by the triage automation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions