Skip to content

feat: update command arguments and improve logging for service initialization #37

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

Merged
merged 1 commit into from
May 20, 2025

Conversation

cfc4n
Copy link
Member

@cfc4n cfc4n commented May 20, 2025

This pull request introduces several updates across multiple files, focusing on improving logging, updating dependencies, enhancing browser server functionality, and refactoring request argument handling. Below is a summary of the most important changes grouped by theme:

Logging Enhancements

  • Added debug-level logs to the mlsCommandFunc function in cli/cmd/root.go to provide better visibility into module processing and service startup.

Dependency Updates

  • Updated dependencies in go.mod, including github.com/chromedp/cdproto, github.com/mark3labs/mcp-go, and others. Added a new indirect dependency on github.com/spf13/cast.

Browser Server Improvements

  • Enhanced browser server initialization in services/browser.go by adding new Chrome flags (e.g., disable-notifications, disable-dev-shm-usage) and conditional handling for headless mode.
  • Removed unused logging hooks in the browser server initialization process for cleaner code.

Refactoring Request Argument Handling

  • Refactored multiple handler functions across services/browser.go, services/browser_debugger.go, services/command.go, and services/file_system.go to use request.GetArguments() for extracting arguments, improving consistency and readability. [1] [2] [3] [4]

Configuration Updates

  • Changed the default Args value in NewMCPServerConfig to ["-m", "Browser"] in client/client.go, aligning with the intended service behavior.

@cfc4n cfc4n requested a review from Copilot May 20, 2025 15:09
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 20, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors service request argument handling and improves logging in several service modules while updating dependencies and configurations. Key changes include refactoring argument extraction via request.GetArguments(), enhancing Chrome flags in browser initialization, and updating default command arguments.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
services/file_system.go Replaced direct map access to use request.GetArguments() for file operations.
services/command.go Updated command extraction to use request.GetArguments().
services/browser_test.go Modified test assignment for arguments.
services/browser_debugger.go Updated debugger functions to use request.GetArguments().
services/browser.go Enhanced argument extraction and added additional Chrome flags.
go.mod Updated dependency versions and added an indirect dependency.
client/client.go Changed default Args from ["-m", "all"] to ["-m", "Browser"].
cli/cmd/root.go Improved logging with debug messages for module filtering.

@dosubot dosubot bot added the enhancement New feature or request label May 20, 2025
@cfc4n cfc4n merged commit 94244a1 into master May 20, 2025
6 checks passed
@cfc4n cfc4n deleted the update-mcp-go branch May 20, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant