@kontent-ai/mcp-server 0.25.0 → 0.26.0
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.
- package/README.md +3 -3
- package/build/schemas/languageSchemas.js +1 -10
- package/build/tools/add-language-mapi.js +2 -2
- package/build/tools/context/patch-guide-property-based.js +5 -9
- package/build/tools/list-languages-mapi.js +1 -1
- package/build/tools/patch-language-mapi.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -121,9 +121,9 @@ npx @kontent-ai/mcp-server@latest shttp
|
|
|
121
121
|
|
|
122
122
|
### Language Management
|
|
123
123
|
|
|
124
|
-
* **list-languages-mapi** – Get all Kontent.ai languages from Management API
|
|
125
|
-
* **add-language-mapi** – Add new Kontent.ai language via Management API
|
|
126
|
-
* **patch-language-mapi** – Update Kontent.ai language using replace operations via Management API
|
|
124
|
+
* **list-languages-mapi** – Get all Kontent.ai languages from Management API (includes both active and inactive - check is_active property)
|
|
125
|
+
* **add-language-mapi** – Add new Kontent.ai language via Management API (languages are always created as active)
|
|
126
|
+
* **patch-language-mapi** – Update Kontent.ai language using replace operations via Management API (only active languages can be modified - to activate/deactivate, use the Kontent.ai web UI)
|
|
127
127
|
|
|
128
128
|
### Collection Management
|
|
129
129
|
|
|
@@ -3,10 +3,6 @@ import { referenceObjectSchema } from "./referenceObjectSchema.js";
|
|
|
3
3
|
export const addLanguageSchema = z.object({
|
|
4
4
|
name: z.string().describe("Display name of the language"),
|
|
5
5
|
codename: z.string().describe("Codename identifier for the language"),
|
|
6
|
-
is_active: z
|
|
7
|
-
.boolean()
|
|
8
|
-
.optional()
|
|
9
|
-
.describe("Whether the language is active (defaults to true)"),
|
|
10
6
|
fallback_language: referenceObjectSchema
|
|
11
7
|
.optional()
|
|
12
8
|
.describe("Reference to fallback language (by id, codename, or external_id)"),
|
|
@@ -23,11 +19,6 @@ const languageReplaceOperationSchema = z.discriminatedUnion("property_name", [
|
|
|
23
19
|
property_name: z.literal("name"),
|
|
24
20
|
value: z.string(),
|
|
25
21
|
}),
|
|
26
|
-
z.object({
|
|
27
|
-
op: z.literal("replace"),
|
|
28
|
-
property_name: z.literal("is_active"),
|
|
29
|
-
value: z.boolean(),
|
|
30
|
-
}),
|
|
31
22
|
z.object({
|
|
32
23
|
op: z.literal("replace"),
|
|
33
24
|
property_name: z.literal("fallback_language"),
|
|
@@ -39,5 +30,5 @@ export const patchLanguageSchema = z.object({
|
|
|
39
30
|
operations: z
|
|
40
31
|
.array(languageReplaceOperationSchema)
|
|
41
32
|
.min(1)
|
|
42
|
-
.describe("Array of replace operations for codename, name,
|
|
33
|
+
.describe("Array of replace operations for codename, name, or fallback_language. Note: Only active languages can be modified. To activate/deactivate languages, use the Kontent.ai web UI."),
|
|
43
34
|
});
|
|
@@ -3,7 +3,7 @@ import { addLanguageSchema } from "../schemas/languageSchemas.js";
|
|
|
3
3
|
import { handleMcpToolError } from "../utils/errorHandler.js";
|
|
4
4
|
import { createMcpToolSuccessResponse } from "../utils/responseHelper.js";
|
|
5
5
|
export const registerTool = (server) => {
|
|
6
|
-
server.tool("add-language-mapi", "Add new Kontent.ai language via Management API", addLanguageSchema.shape, async ({ name, codename,
|
|
6
|
+
server.tool("add-language-mapi", "Add new Kontent.ai language via Management API. Languages are always created as active.", addLanguageSchema.shape, async ({ name, codename, fallback_language, external_id }, { authInfo: { token, clientId } = {} }) => {
|
|
7
7
|
const client = createMapiClient(clientId, token);
|
|
8
8
|
try {
|
|
9
9
|
const response = await client
|
|
@@ -11,7 +11,7 @@ export const registerTool = (server) => {
|
|
|
11
11
|
.withData({
|
|
12
12
|
name,
|
|
13
13
|
codename,
|
|
14
|
-
is_active,
|
|
14
|
+
is_active: true,
|
|
15
15
|
fallback_language,
|
|
16
16
|
external_id,
|
|
17
17
|
})
|
|
@@ -21,20 +21,16 @@ Available properties: name, codename, collections
|
|
|
21
21
|
\`\`\`json
|
|
22
22
|
{ "op": "replace", "property_name": "name", "value": "New Language Name" }
|
|
23
23
|
{ "op": "replace", "property_name": "codename", "value": "new_codename" }
|
|
24
|
-
{ "op": "replace", "property_name": "is_active", "value": true }
|
|
25
24
|
{ "op": "replace", "property_name": "fallback_language", "value": { "codename": "en-US" } }
|
|
26
25
|
\`\`\`
|
|
27
26
|
|
|
28
|
-
Available properties: name, codename,
|
|
27
|
+
Available properties: name, codename, fallback_language
|
|
29
28
|
|
|
30
29
|
## Critical Rule for Languages
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{ "op": "replace", "property_name": "name", "value": "New Name" }
|
|
36
|
-
]
|
|
37
|
-
\`\`\`
|
|
30
|
+
|
|
31
|
+
**Only active languages can be modified.** To activate or deactivate a language, the user must use the Kontent.ai web UI - this is a critical operation that cannot be performed via API tools.
|
|
32
|
+
|
|
33
|
+
When user asks to update "all languages": only update active languages (is_active: true). If they need to modify inactive languages, inform them they must first activate those languages in the Kontent.ai web UI.
|
|
38
34
|
|
|
39
35
|
## General Rules
|
|
40
36
|
- external_id cannot be modified after creation
|
|
@@ -3,7 +3,7 @@ import { listLanguagesSchema } from "../schemas/listSchemas.js";
|
|
|
3
3
|
import { handleMcpToolError } from "../utils/errorHandler.js";
|
|
4
4
|
import { createMcpToolSuccessResponse } from "../utils/responseHelper.js";
|
|
5
5
|
export const registerTool = (server) => {
|
|
6
|
-
server.tool("list-languages-mapi", "Get all Kontent.ai languages (paginated). Languages define available locales; each can have fallback language for content inheritance.", listLanguagesSchema.shape, async ({ continuation_token }, { authInfo: { token, clientId } = {} }) => {
|
|
6
|
+
server.tool("list-languages-mapi", "Get all Kontent.ai languages (paginated), including inactive ones - check is_active property. Languages define available locales; each can have fallback language for content inheritance.", listLanguagesSchema.shape, async ({ continuation_token }, { authInfo: { token, clientId } = {} }) => {
|
|
7
7
|
const client = createMapiClient(clientId, token);
|
|
8
8
|
try {
|
|
9
9
|
const query = client.listLanguages();
|
|
@@ -3,7 +3,7 @@ import { patchLanguageSchema } from "../schemas/languageSchemas.js";
|
|
|
3
3
|
import { handleMcpToolError } from "../utils/errorHandler.js";
|
|
4
4
|
import { createMcpToolSuccessResponse } from "../utils/responseHelper.js";
|
|
5
5
|
export const registerTool = (server) => {
|
|
6
|
-
server.tool("patch-language-mapi", "Update Kontent.ai language using replace operations. Call get-patch-guide first.
|
|
6
|
+
server.tool("patch-language-mapi", "Update Kontent.ai language using replace operations. Call get-patch-guide first. Only active languages can be modified - to activate/deactivate, use the Kontent.ai web UI.", patchLanguageSchema.shape, async ({ languageId, operations }, { authInfo: { token, clientId } = {} }) => {
|
|
7
7
|
const client = createMapiClient(clientId, token);
|
|
8
8
|
try {
|
|
9
9
|
const response = await client
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kontent-ai/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"mcpName": "io.github.kontent-ai/mcp-server",
|
|
6
6
|
"repository": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@kontent-ai/management-sdk": "^8.1.0",
|
|
33
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
33
|
+
"@modelcontextprotocol/sdk": "^1.25.2",
|
|
34
34
|
"applicationinsights": "^2.9.8",
|
|
35
35
|
"dotenv": "^17.2.3",
|
|
36
36
|
"express": "^5.2.1",
|