|
| 1 | +# Contributing to MongoDB MCP Server |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the MongoDB MCP Server project! This document provides guidelines and instructions for contributing. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +This project implements a Model Context Protocol (MCP) server for MongoDB and MongoDB Atlas, enabling AI assistants to interact with MongoDB Atlas resources through natural language. |
| 8 | + |
| 9 | +## Development Setup |
| 10 | + |
| 11 | +### Prerequisites |
| 12 | + |
| 13 | +- Node.js (v23 or later) |
| 14 | +- npm |
| 15 | + |
| 16 | +### Getting Started |
| 17 | + |
| 18 | +1. Clone the repository: |
| 19 | + |
| 20 | + ``` |
| 21 | + git clone https://github.com/mongodb-labs/mongodb-mcp-server.git |
| 22 | + cd mongodb-mcp-server |
| 23 | + ``` |
| 24 | + |
| 25 | +2. Install dependencies: |
| 26 | + |
| 27 | + ``` |
| 28 | + npm install |
| 29 | + ``` |
| 30 | + |
| 31 | +3. Add the mcp server to your IDE of choice |
| 32 | + ```json |
| 33 | + { |
| 34 | + "mcpServers": { |
| 35 | + "MongoDB": { |
| 36 | + "command": "/path/to/mongodb-mcp-server/dist/index.js" |
| 37 | + } |
| 38 | + } |
| 39 | + } |
| 40 | + ``` |
| 41 | + |
| 42 | +## Code Contribution Workflow |
| 43 | + |
| 44 | +1. Create a new branch for your feature or bugfix: |
| 45 | + |
| 46 | + ``` |
| 47 | + git checkout -b feature/your-feature-name |
| 48 | + ``` |
| 49 | + |
| 50 | +2. Make your changes, following the code style of the project |
| 51 | + |
| 52 | +3. Run the inspector and double check your changes: |
| 53 | + |
| 54 | + ``` |
| 55 | + npm run inspect |
| 56 | + ``` |
| 57 | + |
| 58 | +4. Commit your changes with a descriptive commit message |
| 59 | + |
| 60 | +## Pull Request Guidelines |
| 61 | + |
| 62 | +1. Update documentation if necessary |
| 63 | +2. Ensure your PR includes only relevant changes |
| 64 | +3. Link any related issues in your PR description |
| 65 | +4. Keep PRs focused on a single topic |
| 66 | + |
| 67 | +## Code Standards |
| 68 | + |
| 69 | +- Use TypeScript for all new code |
| 70 | +- Follow the existing code style (indentation, naming conventions, etc.) |
| 71 | +- Comment your code when necessary, especially for complex logic |
| 72 | +- Use meaningful variable and function names |
| 73 | + |
| 74 | +## Reporting Issues |
| 75 | + |
| 76 | +When reporting issues, please include: |
| 77 | + |
| 78 | +- A clear description of the problem |
| 79 | +- Steps to reproduce |
| 80 | +- Expected vs. actual behavior |
| 81 | +- Version information |
| 82 | +- Environment details |
| 83 | + |
| 84 | +## Adding New Tools |
| 85 | + |
| 86 | +When adding new tools to the MCP server: |
| 87 | + |
| 88 | +1. Follow the existing pattern in `server.ts` |
| 89 | +2. Define clear parameter schemas using Zod |
| 90 | +3. Implement thorough error handling |
| 91 | +4. Add proper documentation for the tool |
| 92 | +5. Include examples of how to use the tool |
| 93 | + |
| 94 | +## License |
| 95 | + |
| 96 | +By contributing to this project, you agree that your contributions will be licensed under the project's license. |
| 97 | + |
| 98 | +## Questions? |
| 99 | + |
| 100 | +If you have any questions or need help, please open an issue or reach out to the maintainers. |
0 commit comments