Thanks for your interest in contributing! This project is open to everyone.
- Fork the repository
- Clone your fork:
git clone https://github.com/<your-username>/opencode-mcp.git cd opencode-mcp
- Install dependencies:
npm install
- Build:
npm run build
- Test locally — start an OpenCode server (
opencode serve) and run:npm start
- Create a branch from
main:git checkout -b feat/my-feature
- Make your changes in
src/ - Build and verify:
npm run build
- Test manually against a running OpenCode server
- Commit with a descriptive message:
git commit -m "feat: add support for X" - Push and open a pull request against
main
Use Conventional Commits:
feat:— new featurefix:— bug fixchore:— maintenance (deps, config, CI)docs:— documentation changesrefactor:— code restructuring without behavior change
- New tools wrapping OpenCode API endpoints
- Bug fixes for existing tools
- Better error handling or response formatting
- Documentation improvements
- MCP client configuration examples
- Tests
src/
index.ts Entry point
client.ts HTTP client (retry, SSE, errors)
helpers.ts Response formatting utilities
resources.ts MCP Resources
prompts.ts MCP Prompts
tools/ Tool implementations (one file per domain)
- Find the appropriate file in
src/tools/(or create a new one) - Register the tool with
server.tool(name, description, schema, handler) - Use
toolResult(),toolError(), andtoolJson()fromhelpers.ts - Add the tool to the README and
docs/tools.md
- TypeScript with ES modules (
"type": "module") - Use the helper functions from
helpers.tsinstead of rawJSON.stringify - Handle errors gracefully — return
toolError()instead of throwing
Open an issue for questions, bugs, or feature requests.