Thank you for your interest in contributing to this project! This guide will help you get started.
- Report Bugs - Found an issue? Let us know!
- Suggest Features - Have an idea? Share it!
- Write Documentation - Help others understand the plugin
- Submit Code - Fix bugs or add features
- Share Examples - Add useful automation examples
- Node.js v18 or higher
- OpenCode installed
- Browser MCP extension installed
- Git
- Clone the repository:
git clone https://github.com/michaljach/opencode-browser.git
cd opencode-browser- Install dependencies (if you add any):
npm install- Link the plugin locally:
# For testing
mkdir -p .opencode/plugin
ln -s $(pwd)/index.ts .opencode/plugin/browser-mcp.ts- Create your OpenCode configuration:
cp opencode.json.example opencode.json- Make your changes to
index.ts - Restart OpenCode
- Test with browser automation prompts
- Verify the changes work as expected
Before submitting, ensure:
- Plugin loads without errors
- Basic browser navigation works
- Tool execution hooks function correctly
- Session context is preserved
- No console errors or warnings
- Documentation is updated
- Use TypeScript for all code
- Enable strict type checking
- Add JSDoc comments for public APIs
- Use meaningful variable names
- Keep functions small and focused
/**
* Processes browser tool execution results
* @param input - The tool execution input
* @param output - The tool execution output
*/
"tool.execute.after": async (input, output) => {
if (input.tool.startsWith("browsermcp_")) {
console.log(`Completed: ${input.tool}`)
}
}- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name- Make your changes
- Add tests if applicable
- Update documentation
- Commit with a clear message:
git commit -m "feat: add custom browser tool for screenshots"- Push to your fork:
git push origin feature/your-feature-name- Open a Pull Request
Use conventional commits:
feat:- New featurefix:- Bug fixdocs:- Documentation changesrefactor:- Code refactoringtest:- Adding testschore:- Maintenance tasks
Examples:
feat: add screenshot comparison tool
fix: resolve session context preservation issue
docs: update installation instructions for Windows
To add a custom browser tool:
return {
tool: {
browser_screenshot: tool({
description: "Take a screenshot of the current page",
args: {
fullPage: tool.schema.boolean().optional(),
},
async execute(args, ctx) {
// Implementation
return "Screenshot saved"
},
}),
},
}To add a new hook:
return {
"new.hook.name": async (input, output) => {
// Implementation
},
}- Clear, concise explanations
- Code examples for all features
- Troubleshooting section
- Links to related resources
- Explain WHY, not WHAT
- Use JSDoc for public APIs
- Keep comments up-to-date
Add practical examples to EXAMPLES.md:
## Your Feature Name
### Use Case Description
Your example prompt here
Explanation of what happens.
- Functionality - Does it work as intended?
- Code Quality - Is it well-written and maintainable?
- Documentation - Is it properly documented?
- Tests - Are edge cases handled?
- Breaking Changes - Are they necessary and documented?
- We aim to review PRs within 3-5 days
- Complex changes may take longer
- Feel free to ping if no response after a week
- Check existing issues and discussions
- Review the documentation
- Ask in the PR or issue comments
- Join the OpenCode Discord (if available)
- Treat everyone with respect
- Assume good intentions
- Provide constructive feedback
- Help others learn and grow
- Keep discussions on-topic
- Avoid inflammatory language
- Respect different perspectives
- Follow the code of conduct
Contributors will be:
- Listed in the README
- Credited in release notes
- Appreciated by the community
By contributing, you agree that your contributions will be licensed under the MIT License.
Feel free to open an issue or discussion if you have questions about contributing!
Thank you for contributing to OpenCode Browser MCP Plugin!