# Contributing to YT PostgreSQL MCP Server
Thank you for considering contributing to YT PostgreSQL MCP Server! We welcome contributions from the community.
## How to Contribute
### Reporting Bugs
- Check if the issue already exists in [Issues](https://github.com/yty-build/postgres_mcp_allaccess/issues)
- Use the bug report template
- Include:
- PostgreSQL version
- Python version
- MCP server version
- Steps to reproduce
- Expected vs actual behavior
- Relevant logs
### Suggesting Features
- Open an issue with the feature request template
- Describe the use case and benefits
- Consider if it fits the project scope (PostgreSQL MCP operations)
### Pull Requests
1. **Fork the repository**
2. **Create a feature branch**
```bash
git checkout -b feature/your-feature-name
```
3. **Make your changes**
- Follow existing code style
- Add tests for new features
- Update documentation
4. **Test your changes**
```bash
# Run tests
pytest
# Test Docker deployment
docker-compose up -d
curl http://localhost:3000/health
```
5. **Commit with clear messages**
```bash
git commit -m "Add feature: brief description"
```
6. **Push and create PR**
```bash
git push origin feature/your-feature-name
```
### Code Style
- Python 3.10+ syntax
- Use `black` for formatting (line length 100)
- Use `ruff` for linting
- Type hints encouraged
- Docstrings for public APIs
Run formatters:
```bash
black src/
ruff check src/ --fix
```
### Testing
- Add tests for new features in `tests/`
- Ensure existing tests pass
- Test both stdio and SSE transports
- Test with and without PgBouncer
### Documentation
Update documentation when you:
- Add new MCP tools
- Change configuration options
- Modify deployment process
- Add new features
Files to update:
- `README.md` - User-facing documentation
- Docstrings - Code documentation
- `.env.example` - Configuration examples
## Development Setup
### Local Development
```bash
# Clone repository
git clone https://github.com/yty-build/postgres_mcp_allaccess.git
cd postgres_mcp_allaccess
# Install dependencies
pip install -r requirements.txt
pip install -e ".[dev]"
# Setup test database
# (Use your own PostgreSQL instance)
export POSTGRES_HOST=localhost
export POSTGRES_DATABASE=test_db
export POSTGRES_USER=postgres
export POSTGRES_PASSWORD=your_password
# Run server
python -m postgres_mcp_allaccess.server
```
### Docker Development
```bash
# Build and run
docker-compose up --build
# View logs
docker-compose logs -f
# Shell into container
docker exec -it yt-postgres-mcp bash
```
## Project Structure
```
postgres_mcp_allaccess/
├── src/postgres_mcp_allaccess/
│ ├── server.py # Main MCP server
│ ├── database.py # Database operations
│ ├── pgbouncer_manager.py # PgBouncer integration
│ ├── tools.py # MCP tool definitions
│ ├── transports/ # stdio & SSE transports
│ └── ...
├── tests/ # Test suite
├── pgbouncer/ # PgBouncer config
├── docker-compose.yml # Docker orchestration
└── Dockerfile # Container definition
```
## Commit Message Guidelines
Use conventional commits format:
- `feat:` New feature
- `fix:` Bug fix
- `docs:` Documentation changes
- `refactor:` Code refactoring
- `test:` Test changes
- `chore:` Build/tooling changes
Examples:
```
feat: add query result caching
fix: handle connection timeout errors
docs: clarify AWS Secrets setup
refactor: simplify pool initialization
```
## Security
- **Never commit secrets** (AWS keys, passwords, tokens)
- Report security vulnerabilities privately via GitHub Security Advisories
- See [SECURITY.md](SECURITY.md) for details
## Questions?
- Open a [Discussion](https://github.com/yty-build/postgres_mcp_allaccess/discussions)
- Ask in issues (label: `question`)
- Check existing documentation first
## License
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.
## Recognition
Contributors will be acknowledged in release notes and README. Thank you for making this project better!
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yty-build/postgres_mcp_allaccess'
If you have feedback or need assistance with the MCP directory API, please join our Discord server