Skip to content

Conversation

@technige
Copy link
Contributor

This passes in a specific user agent to identify traffic as originating from the MCP server. The product name and version has been extracted into a separate variable near the top of the script, and this is then used to both populate the User-Agent header and the McpServer object constructor.

@technige technige requested a review from a team as a code owner May 23, 2025 19:52
@technige technige requested review from Anaethelion and JoshMock May 23, 2025 19:52
@technige
Copy link
Contributor Author

No test suite yet exists for this project, but a quick local test with mitmproxy confirms that the correct header value is transmitted to a start-local server instance.
image

Copy link
Member

@JoshMock JoshMock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small suggestion, but LGTM overall. 👏

Comment on lines 14 to 19
// Product metadata, used to generate the request User-Agent header and
// passed to the McpServer constructor.
const product = {
name: "elasticsearch-mcp-server",
version: "0.1.1",
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick improvement so you don't have to remember to modify this file before every release.

Suggested change
// Product metadata, used to generate the request User-Agent header and
// passed to the McpServer constructor.
const product = {
name: "elasticsearch-mcp-server",
version: "0.1.1",
};
// Product metadata, used to generate the request User-Agent header and
// passed to the McpServer constructor.
const { version } = JSON.parse(fs.readFileSync('package.json'))
const product = {
name: "elasticsearch-mcp-server",
version,
};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, I actually wondered about this while I was writing it :)

Copy link
Member

@jedrazb jedrazb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems E&T is still code owners, 🚢 + I will look into adding your team as well

@jedrazb
Copy link
Member

jedrazb commented May 26, 2025

buildkite test this

@technige technige requested a review from a team as a code owner May 30, 2025 11:26
@jedrazb
Copy link
Member

jedrazb commented Jun 5, 2025

buildkite test this

elastic-renovate-prod bot and others added 5 commits June 6, 2025 10:24
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
* 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]>
…c#74)

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>
…astic#76)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
@technige
Copy link
Contributor Author

technige commented Jun 6, 2025

buildkite test this

@technige technige removed the request for review from Anaethelion June 6, 2025 09:28
@technige
Copy link
Contributor Author

technige commented Jun 6, 2025

buildkite test this

@technige technige merged commit 0c0f003 into elastic:main Jun 6, 2025
2 checks passed
@technige technige deleted the adjusted-user-agent branch June 6, 2025 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants