Thank you for your interest in contributing! This document provides guidelines and instructions for contributing to the project.
- Development Setup
- Project Structure
- Development Workflow
- Code Style
- Testing
- Pull Requests
- Reporting Issues
- Node.js >= 18
- npm >= 9
- PostgreSQL (for integration testing)
-
Clone the repository:
git clone https://github.com/VKirill/multi-postgres-mcp-server.git cd multi-postgres-mcp-server -
Install dependencies:
npm install
-
Build the project:
npm run build
-
Run in development mode (with auto-reload):
npm run dev
├── src/
│ ├── index.ts # Main MCP server implementation
│ └── __tests__/
│ └── index.test.ts # Test suite
├── dist/ # Compiled JavaScript (generated)
├── config.example.json # Example configuration
├── tsconfig.json # TypeScript configuration
├── vitest.config.ts # Test configuration
├── eslint.config.js # ESLint configuration
├── .prettierrc # Prettier configuration
├── Dockerfile # Container image
└── .github/
└── workflows/
└── ci.yml # GitHub Actions CI/CD
-
Create a feature branch from
master:git checkout -b feature/your-feature-name
-
Make your changes in
src/index.ts -
Run the linter:
npm run lint
-
Run tests:
npm test -
Build to verify compilation:
npm run build
-
Commit and push your changes
This project uses ESLint and Prettier for consistent code formatting.
- TypeScript strict mode is enabled
- ES modules (
"type": "module"in package.json) - Single file architecture: The main server logic is in
src/index.ts - Follow existing patterns for new MCP tools
# Check formatting
npx prettier --check "src/**/*.ts"
# Fix formatting
npx prettier --write "src/**/*.ts"Tests are written with vitest and located in src/__tests__/.
# Run tests once
npm test
# Run tests in watch mode
npm run test:watch- Test pure functions (like
isSingleStatement()) thoroughly - Cover edge cases: empty strings, Unicode, nested quotes, etc.
- Group related tests with
describe()blocks - Use descriptive test names
- Keep PRs focused: One feature or fix per PR
- Include tests: Add tests for new functionality
- Update docs: Update README.md if adding new features or changing behavior
- Describe changes: Write a clear PR description explaining what and why
- Code compiles without errors (
npm run build) - All tests pass (
npm test) - Linter passes (
npm run lint) - New features have tests
- README updated (if applicable)
- CHANGELOG.md updated
When reporting issues, please include:
- Node.js version (
node -v) - OS and version
- Steps to reproduce
- Expected behavior
- Actual behavior
- Error messages (if any)
For security vulnerabilities, see SECURITY.md.
By contributing, you agree that your contributions will be licensed under the MIT License.