Skip to content

[GRO-187] adding keep alive flag to MCP #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kylejeong2
Copy link
Collaborator

what

Adding a flag to have keep alive sessions using the MCP server. If you want to close this kind of session, you have to explicit close with the session close tool.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR introduces a new keepAlive configuration option to the Browserbase MCP server that allows users to control session lifecycle management. The feature adds an optional boolean flag that, when enabled, prevents Browserbase sessions from automatically terminating after operations complete.

The implementation follows a clean architectural pattern:

  • Configuration Layer: The keepAlive flag is defined in the Zod schema in src/index.ts as an optional boolean with proper validation and description
  • Type System: TypeScript declarations are updated in config.d.ts to include the new optional field with comprehensive JSDoc documentation
  • Runtime Integration: The flag is passed through to the Stagehand instance creation in src/stagehandStore.ts, where it's applied to the browserbaseSessionCreateParams with a sensible default of false
  • User Documentation: The README.md is updated to document the new --keepAlive CLI flag and its behavior

When keepAlive is enabled, browser sessions will persist indefinitely until explicitly closed using the existing browserbase_session_close tool. This addresses use cases where users need persistent browser state across multiple operations, long-running automation tasks, or interactive debugging scenarios. The feature integrates seamlessly with the existing MCP server architecture and maintains backward compatibility by defaulting to false.

The PR also includes a minor version bump from 2.0.0 to 2.0.1, following semantic versioning practices for this backward-compatible feature addition.

Confidence score: 5/5

  • This PR is safe to merge with minimal risk as it adds an optional feature without breaking existing functionality
  • Score reflects well-structured implementation following established patterns, proper type safety, and comprehensive integration across all relevant layers
  • No files require special attention as the changes are straightforward and follow existing architectural patterns

5 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant