Thank you for your interest in contributing to MCP Foxxy Bridge! This guide will help you get started with development and contribution workflows.
- Python 3.10+ - Required for running the bridge
- Node.js 18+ - Required for MCP servers that use npm
- UV - Python package manager and tool runner
- Git - Version control
-
Clone the repository
git clone https://github.com/billyjbryant/mcp-foxxy-bridge cd mcp-foxxy-bridge -
Install dependencies
uv sync
-
Run the bridge in development mode
uv run mcp-foxxy-bridge --bridge-config bridge_config_example.json
-
Test the installation
# Check status endpoint curl http://localhost:8080/status
# Run the bridge as a module
uv run -m mcp_foxxy_bridge
# Run the bridge as a package
uv run mcp-foxxy-bridge
# Run tests
pytest
# Run tests with coverage
coverage run -m pytest
coverage report
# Type checking
mypy src/
# Linting
ruff check
# Code formatting
ruff format
# Install from source
uv tool install .mcp-foxxy-bridge/
├── src/mcp_foxxy_bridge/ # Main source code
│ ├── __main__.py # CLI entry point
│ ├── mcp_server.py # HTTP/SSE server
│ ├── bridge_server.py # MCP protocol bridge
│ ├── server_manager.py # MCP server connections
│ └── config_loader.py # Configuration parsing
├── tests/ # Test files
├── docs/ # Documentation
├── bridge_config_example.json # Example configuration
├── pyproject.toml # Project configuration
└── README.md # Main project documentation
- Type hints: Use type hints for all function signatures
- Async/await: Use async/await throughout for I/O operations
- Error handling: Proper exception handling with context
- Logging: Use structured logging with appropriate levels
We use ruff for both linting and formatting:
# Format code
ruff format
# Check for issues
ruff check
# Fix auto-fixable issues
ruff check --fixRun mypy to ensure type safety:
mypy src/# Run all tests
pytest
# Run with coverage
coverage run -m pytest
coverage report
# Run specific test file
pytest tests/test_config_loader.py
# Run with verbose output
pytest -v- Use
pytestframework - Place tests in the
tests/directory - Use
pytest-asynciofor async test functions - Mock external dependencies appropriately
Example test structure:
import pytest
from mcp_foxxy_bridge.config_loader import load_config
def test_config_loading():
"""Test basic configuration loading."""
config = load_config("example_config.json")
assert config is not None
assert "mcpServers" in config-
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Follow code style guidelines
- Add tests for new functionality
- Update documentation as needed
-
Test your changes
# Run tests pytest # Check type safety mypy src/ # Check code style ruff check ruff format
-
Commit your changes using conventional commit format
git add . git commit -m "feat: add your feature description"
Commit Message Format:
<type>(<scope>): <description> [optional body] [optional footer]Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Formatting, missing semicolons, etc.refactor: Code refactoringtest: Adding or updating testschore: Build tasks, package manager configs
Examples:
git commit -m "feat(bridge): add environment variable expansion" git commit -m "fix(server): resolve connection timeout issues" git commit -m "docs: update installation instructions"
To use the commit message template:
git config commit.template .gitmessage
-
Push and create a pull request
git push origin feature/your-feature-name
Use conventional commits format:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesrefactor:- Code refactoringtest:- Test additions or changeschore:- Maintenance tasks
Examples:
feat: add environment variable expansion supportfix: resolve async context manager lifecycle issuedocs: update installation guide with UV commands
- Title: Use a clear, descriptive title
- Description: Explain what changes you made and why
- Testing: Describe how you tested your changes
- Breaking Changes: Note any breaking changes
- Documentation: Update docs if needed
Run the bridge with debug logging:
uv run mcp-foxxy-bridge --bridge-config config.json --debug- Connection errors: Check MCP server commands and arguments
- Port conflicts: Bridge auto-increments ports when needed
- Environment variables: Verify variable names and values
- Tool routing: Check namespace configuration
The bridge uses Python's logging module:
import logging
logger = logging.getLogger(__name__)
logger.info("Bridge started successfully")
logger.error("Failed to connect to server: %s", error)- Update relevant documentation in
docs/directory - Keep
README.mdcurrent with major changes - Add docstrings to new functions and classes
- Update configuration examples when needed
- Use clear, concise language
- Include code examples where helpful
- Keep line lengths reasonable (80 characters preferred)
- Use proper markdown formatting
The project uses automated versioning based on Git tags:
- Versions are automatically determined from Git tags using
hatch-vcs - No manual version updates needed in code
- Development versions get
.devNsuffix automatically
For Maintainers:
-
Prepare the release
- Ensure all changes are merged to
main - Run tests locally to verify everything works
- Ensure all changes are merged to
-
Releases happen automatically via semantic-release
- Push conventional commits to
mainbranch - Semantic-release analyzes commits and creates releases
- No manual intervention needed for most releases
- Push conventional commits to
-
Manual testing (if needed)
- Go to Actions → "CI/CD Pipeline" workflow
- Use dry-run mode to preview releases
- Use test PyPI option for testing
For Contributors:
- Focus on code contributions and follow conventional commits
- Maintainers handle all releases via semantic-release
- See docs/releasing.md for detailed release process
The repository uses comprehensive labeling for organization:
- Type labels:
type: feature,type: bug,type: documentation - Area labels:
area: bridge,area: server,area: config - Priority labels:
priority: critical,priority: high,priority: medium,priority: low - Status labels:
status: in progress,status: needs review,status: blocked - Size labels:
size: XS,size: S,size: M,size: L,size: XL(auto-applied) - Release labels:
release: major,release: minor,release: patch
Labels are automatically applied based on file changes and can be manually adjusted by maintainers.
- Check existing issues on GitHub
- Look at the codebase documentation
- Review test files for usage examples
When reporting issues, include:
- Bridge version
- Configuration file (sanitized)
- Error messages and logs
- Steps to reproduce
- Environment details (OS, Python version)
For feature requests, provide:
- Clear description of the feature
- Use case and motivation
- Possible implementation approach
- Any breaking changes
- Be respectful and constructive
- Follow the code of conduct
- Help other contributors when possible
- Focus on the project's goals and user needs
Thank you for contributing to MCP Foxxy Bridge!