@kontent-ai/mcp-server 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { createManagementClient } from '@kontent-ai/management-sdk';
|
|
2
|
+
import packageJson from "../../package.json" with { type: "json" };
|
|
3
|
+
const sourceTrackingHeaderName = "X-KC-SOURCE";
|
|
2
4
|
/**
|
|
3
5
|
* Creates a Kontent.ai Management API client
|
|
4
6
|
* @param environmentId Optional environment ID (defaults to process.env.KONTENT_ENVIRONMENT_ID)
|
|
@@ -9,6 +11,10 @@ export const createMapiClient = (environmentId, apiKey) => {
|
|
|
9
11
|
return createManagementClient({
|
|
10
12
|
apiKey: apiKey ?? process.env.KONTENT_API_KEY ?? throwError("KONTENT_API_KEY is not set"),
|
|
11
13
|
environmentId: environmentId ?? process.env.KONTENT_ENVIRONMENT_ID ?? throwError("KONTENT_ENVIRONMENT_ID is not set"),
|
|
14
|
+
headers: [{
|
|
15
|
+
header: sourceTrackingHeaderName,
|
|
16
|
+
value: `${packageJson.name};${packageJson.version}`,
|
|
17
|
+
}],
|
|
12
18
|
});
|
|
13
19
|
};
|
|
14
20
|
const throwError = (message) => {
|