|
| 1 | +# Contributing |
| 2 | + |
| 3 | +[fork]: https://github.com/elastic/mcp-server-elasticsearch/fork |
| 4 | +[pr]: https://github.com/elastic/mcp-server-elasticsearch/compare |
| 5 | +[code-of-conduct]: https://www.elastic.co/community/codeofconduct |
| 6 | + |
| 7 | +Elasticsearch MCP Server client is open source and we love to receive contributions from our community — you! |
| 8 | + |
| 9 | +There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests or writing code. |
| 10 | + |
| 11 | + |
| 12 | +Contributions are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) under the [project's license](../LICENSE). |
| 13 | + |
| 14 | +Please note that this project follows the [Elastic's Open Source Community Code of Conduct][code-of-conduct]. |
| 15 | + |
| 16 | +## Setup |
| 17 | + |
| 18 | +1. Install Node.js 18+ (using [nvm](https://github.com/nvm-sh/nvm) is recommended) |
| 19 | + ```bash |
| 20 | + nvm use |
| 21 | + ``` |
| 22 | +2. Install dependencies |
| 23 | + ```bash |
| 24 | + npm install |
| 25 | + ``` |
| 26 | +3. Build the project |
| 27 | + ```bash |
| 28 | + npm run build |
| 29 | + ``` |
| 30 | + |
| 31 | +## Start Elasticsearch |
| 32 | + |
| 33 | +You can use either: |
| 34 | + |
| 35 | +1. **Elastic Cloud** - Use an existing Elasticsearch deployment and your API key |
| 36 | +2. **Local Elasticsearch** - Run Elasticsearch locally using the [start-local](https://www.elastic.co/guide/en/elasticsearch/reference/current/run-elasticsearch-locally.html) script: |
| 37 | + ```bash |
| 38 | + curl -fsSL https://elastic.co/start-local | sh |
| 39 | + ``` |
| 40 | + |
| 41 | + This starts Elasticsearch and Kibana with Docker: |
| 42 | + - Elasticsearch: http://localhost:9200 |
| 43 | + - Kibana: http://localhost:5601 |
| 44 | + |
| 45 | +> [!NOTE] |
| 46 | +> The `start-local` setup is for development only. It uses basic authentication and disables HTTPS. |
| 47 | +
|
| 48 | +## Development Workflow |
| 49 | + |
| 50 | +1. [Fork][fork] and clone the repository |
| 51 | +2. Create a new branch: `git checkout -b my-branch-name` |
| 52 | +3. Make your changes |
| 53 | +4. Test locally with the MCP Inspector: |
| 54 | + ```bash |
| 55 | + ES_URL=your-elasticsearch-url ES_API_KEY=your-api-key npm run inspector |
| 56 | + ``` |
| 57 | +5. [Test with MCP Client](../README.md#developing-locally) |
| 58 | +6. Push to your fork and [submit a pull request][pr] |
| 59 | + |
| 60 | +## Best Practices |
| 61 | + |
| 62 | +- Follow existing code style and patterns |
| 63 | +- Write [conventional commits](https://www.conventionalcommits.org/) |
| 64 | +- Include tests for your changes |
| 65 | +- Keep PRs focused on a single concern |
| 66 | +- Update documentation as needed |
| 67 | +- Use TypeScript with proper typing |
| 68 | +- Add JSDoc comments to new functions |
| 69 | + |
| 70 | +## Getting Help |
| 71 | + |
| 72 | +- Open an issue in the repository |
| 73 | +- Ask questions on [discuss.elastic.co](https://discuss.elastic.co/) |
| 74 | + |
| 75 | +## Resources |
| 76 | + |
| 77 | +- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) |
| 78 | +- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) |
| 79 | +- [Elastic Code of Conduct][code-of-conduct] |
0 commit comments