Thank you for your interest in contributing to OpenRouter ImageGen MCP! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors.
If you find a bug, please create an issue with:
- Clear title: Describe the issue concisely
- Description: Detailed explanation of the problem
- Steps to reproduce: List the exact steps to reproduce the issue
- Expected behavior: What you expected to happen
- Actual behavior: What actually happened
- Environment:
- OS (macOS, Linux, Windows)
- Node.js version
- Claude Code version
- OpenRouter ImageGen MCP version
Example:
**Bug**: Image generation fails with timeout error
**Steps to reproduce:**
1. Configure MCP server in Claude Code
2. Request: "Generate a sunset image"
3. Wait for response
**Expected:** Image generates successfully
**Actual:** Timeout error after 30 seconds
**Environment:**
- macOS 14.0
- Node.js 20.10.0
- Claude Code 1.0.0
- OpenRouter ImageGen MCP 1.0.0We welcome feature suggestions! Please create an issue with:
- Clear title: Describe the feature concisely
- Problem statement: What problem does this solve?
- Proposed solution: How should it work?
- Alternatives: Other approaches you considered
- Additional context: Screenshots, examples, etc.
We love pull requests! Here's how to submit one:
# Fork the repository on GitHub, then:
git clone https://github.com/YOUR_USERNAME/OpenRouter-ImageGen-MCP.git
cd OpenRouter-ImageGen-MCPgit checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fixBranch naming conventions:
feature/description- New featuresfix/description- Bug fixesdocs/description- Documentation changesrefactor/description- Code refactoringtest/description- Test improvements
# Install dependencies
npm install
# Run tests to verify everything works
npm test
# Build the project
npm run buildFollow these guidelines:
Code Style:
- Use TypeScript for all new code
- Follow the existing code style
- Run
npm run lintto check for issues - Run
npm run formatto auto-format code
Testing:
- Write tests for new features
- Ensure all tests pass:
npm test - Maintain or improve code coverage:
npm run test:coverage - Tests should be in
src/__tests__/directory - Follow the existing test patterns
Commits:
- Write clear, concise commit messages
- Use present tense ("Add feature" not "Added feature")
- Reference issues when applicable (#123)
Examples:
git commit -m "Add support for custom image sizes"
git commit -m "Fix timeout error in API client"
git commit -m "Update documentation for new model"
git commit -m "Refactor image processor for better error handling"# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run linter
npm run lint
# Type check
npm run typecheck
# Test the built package
npm run build
npm startManual Testing:
- Configure the MCP server in Claude Code
- Test your changes with real API calls
- Verify error handling works correctly
- Test edge cases
If your changes affect usage:
- Update README.md
- Update relevant documentation
- Add examples if applicable
- Update CHANGELOG.md
git push origin feature/your-feature-nameThen create a Pull Request on GitHub with:
Title: Clear, concise description of changes
Description:
- What changes were made
- Why these changes were needed
- How to test the changes
- Related issues (#123)
- Screenshots (if UI changes)
Example PR description:
## Description
Adds support for custom image dimensions in the generate_image tool.
## Changes
- Added `width` and `height` parameters to generate_image tool
- Updated OpenRouter API client to send dimension parameters
- Added validation for dimension values (min 256, max 2048)
- Added tests for dimension validation
- Updated documentation
## Testing
1. Configure MCP server
2. Request: "Generate a 512x512 image of a cat"
3. Verify image is generated with correct dimensions
Closes #45This project follows clean architecture principles:
src/
├── config/ # Configuration constants
├── domain/ # Domain models and errors
├── services/ # Business logic
├── validators/ # Input validation
├── formatters/ # Response formatting
├── utils/ # Utility functions
└── __tests__/ # Test suites
Guidelines:
- Keep services focused on single responsibilities
- Use dependency injection
- Avoid circular dependencies
- Keep domain models pure (no business logic)
TypeScript:
- Enable strict mode
- Use explicit types (avoid
any) - Use interfaces for contracts
- Use type aliases for complex types
Error Handling:
- Use custom error classes from
domain/errors.js - Provide helpful error messages
- Include context in errors
- Log errors appropriately
Testing:
- Write unit tests for business logic
- Mock external dependencies
- Test error cases
- Aim for >70% coverage
Performance:
- Avoid unnecessary async/await
- Cache when appropriate
- Handle large files efficiently
- Consider memory usage
✅ Good PRs:
- Focused on a single change
- Include tests
- Follow code style
- Update documentation
- Have clear commit messages
❌ Avoid:
- Mixing multiple unrelated changes
- Breaking existing functionality
- Skipping tests
- Ignoring linter errors
- Large, unexplained changes
- Questions: Open a Discussion
- Bugs: Open an Issue
- Security: Email security concerns privately (see SECURITY.md)
Maintainers handle releases:
- Update version in
package.json - Update
CHANGELOG.md - Create git tag:
v1.0.0 - Push tag:
git push origin v1.0.0 - Create GitHub release
- (Optional) Publish to npm
Contributors will be:
- Listed in GitHub contributors
- Mentioned in release notes (for significant contributions)
- Credited in documentation (for major features)
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to OpenRouter ImageGen MCP! 🎨