-
Notifications
You must be signed in to change notification settings - Fork 110
Add new configuration option for Elasticsearch path prefix #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
💚 CLA has been signed |
|
I've just read and signed the contributor agreement. Do I need to make a new pull request? |
|
@bryangwj Thanks for signing the CLA. Opening a new PR is not required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks great to me. Thanks for the contribution @bryangwj!
|
Closing and reopening to try to get the Buildkite CI job going. |
|
buildkite test this |
* Update index.ts to accept path prefix in Elasticsearch URL * Update README.md to include information about path prefix --------- Co-authored-by: Josh Mock <[email protected]>
* Includes specific user-agent for MCP * Simplified product name for user agent * chore(deps): update node.js to v22.16.0 (#58) Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> * Add new configuration option for Elasticsearch path prefix (#72) * Update index.ts to accept path prefix in Elasticsearch URL * Update README.md to include information about path prefix --------- Co-authored-by: Josh Mock <[email protected]> * fix(deps): update dependency @elastic/elasticsearch to v9.0.2 (#74) Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> * chore(deps): update buildkite plugin monorepo-diff to v1.4.0 (#75) Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> * fix(deps): update dependency @modelcontextprotocol/sdk to v1.12.1 (#76) Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> --------- Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> Co-authored-by: Ang Wei Jun Bryan <[email protected]> Co-authored-by: Josh Mock <[email protected]>
Currently, the only configuration option for the Elasticsearch instance URL is
ES_URL. However, this means you cannot directly connect to Elasticsearch instances behind a reverse proxy or ingress controller that exposes Elasticsearch at a non-root path. This is because the current@elastic/elasticsearchJavaScript client internally uses theundiciHTTP library for Node.js, which enforces strict URL validation for connections. Specifically,undicidoes not allow paths other than/in the base URL you provide to the node property. If you try to connect to a URL likehttps://example.test.net/test-es/elastic, the client throws anInvalidArgumentError: invalid urlbecause the path is not/. The changes in this pull request addresses this issue by allowing users to include a path prefix (e.g./test-es/elastic) with theES_PATH_PREFIXconfiguration option, while ES_URL remains as before (e.g.https://example.test.net).