Skip to content

Conversation

@elliot245
Copy link

@elliot245 elliot245 commented May 19, 2025

Finish: #1

@elliot245 elliot245 marked this pull request as ready for review May 19, 2025 15:51
Copy link
Contributor

@alexchenzl alexchenzl left a comment

Choose a reason for hiding this comment

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

  1. use ai.nanobrowser.mcp.host as the host application's name, following the convention "com.my_company.my_application"
  2. use pnpm as package manager, keep it the same as the Nanobrowser repo
  3. would be great to have a document to describe the capabilities of this MCP server, eg. description, supported tools, resources etc.

@elliot245
Copy link
Author

  1. use ai.nanobrowser.mcp.host as the host application's name, following the convention "com.my_company.my_application"
  2. use pnpm as package manager, keep it the same as the Nanobrowser repo
  3. would be great to have a document to describe the capabilities of this MCP server, eg. description, supported tools, resources etc.

Thank you for the feedback! I've addressed all your suggestions:

✅ Changes Made

  1. Host application naming convention: Updated to use ai.nanobrowser.mcp.host following the "com.my_company.my_application" convention throughout the codebase.

  2. Package manager: Switched to pnpm as the package manager to align with the Nanobrowser repo:

    • Updated all build commands in README from npm to pnpm
    • Leveraged pnpm's ability to omit run for cleaner commands (e.g., pnpm build, pnpm test)
  3. Capabilities documentation: Created comprehensive documentation at docs/mcp-server-capabilities.md that includes:

    • Supported Tools:
      • navigate_to: URL navigation with input schema
      • run_task: Complex browser automation with detailed capabilities list
    • Resources:
      • browser://current/state: Current browser state as JSON resource
    • API Reference: Input schemas, resource URIs, and usage details
    • Added prominent link to this documentation in the README

🔧 Additional Improvements

  • Fixed Vite build warnings by removing duplicate sourcemap configuration
  • Added nvm use step to installation instructions for proper Node.js version management
  • Improved README structure and formatting for better developer experience
  • Updated license section to reference the actual LICENSE file

The MCP Host now provides a clean, well-documented interface for AI systems to interact with browser functionality through standardized tools and resources. The documentation makes it easy for developers and integrators to understand and extend the API

Copy link
Contributor

@alexchenzl alexchenzl left a comment

Choose a reason for hiding this comment

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

  1. Looks like install-vite-deps.sh is not necessary, devDependencies in package.json should be enough
  2. It should be better to update versions of dependencies, use the same version as the one in Nanobrowse or use latest versions if possible.
  3. Use the similar eslint configuration as Nanobrowser to lint the source code, so that the source code in this repo follow similar rules.
  4. Is it possible to create an installation configuration for dev environment in the install.sh for developers, so that we can use the dist and node_modules directly when debugging the application.

Copy link
Contributor

Choose a reason for hiding this comment

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

The dependencies in $APP_DIR is incomplete. Errors will happen if you run "node index.js" in the $APP_DIR.

The issue was caused by pnpm's symlink structure being broken when copying node_modules with cp -r, solution:

cp -a "$SCRIPT_DIR/node_modules" "$APP_DIR/"

-a (archive mode) preserves symlinks, permissions, timestamps, and all file attributes
This maintains pnpm's symlink structure intact
Module resolution works correctly because the symlink paths remain valid

@elliot245
Copy link
Author

  1. Looks like install-vite-deps.sh is not necessary, devDependencies in package.json should be enough
  2. It should be better to update versions of dependencies, use the same version as the one in Nanobrowse or use latest versions if possible.
  3. Use the similar eslint configuration as Nanobrowser to lint the source code, so that the source code in this repo follow similar rules.
  4. Is it possible to create an installation configuration for dev environment in the install.sh for developers, so that we can use the dist and node_modules directly when debugging the application.

The issues you reported have been fixed. Please review them again. https://github.com/nanobrowser/nanobrowser I will check the issues you reported tomorrow.

Copy link
Contributor

@alexchenzl alexchenzl left a comment

Choose a reason for hiding this comment

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

It's almost done!

I still failed to start mcp host after running the install.sh at first

Finally I changed the path of node to the full path of node in the file mcp-host.sh and got it worked, now I can call the mcp tool in cursor.

So there's only one more step that needs to be done:

  • update the install.sh, use full path of node in the mcp-host.sh

@elliot245
Copy link
Author

It's almost done!

I still failed to start mcp host after running the install.sh at first

Finally I changed the path of node to the full path of node in the file mcp-host.sh and got it worked, now I can call the mcp tool in cursor.

So there's only one more step that needs to be done:

  • update the install.sh, use full path of node in the mcp-host.sh

I'm trying to compile nanobrowser-mcp-host as a standalone binary so that I don't have to install nodejs.

@alexchenzl
Copy link
Contributor

alexchenzl commented Jun 10, 2025

I'm trying to compile nanobrowser-mcp-host as a standalone binary so that I don't have to install nodejs.

That would be better.

In fact, I have ever even thought of building a go/rust native app as the bridge to provide APIs, they usually provide smaller footprints and better performance than Nodejs.

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.

2 participants