@kontent-ai/mcp-server 0.6.1 → 0.7.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 CHANGED
@@ -56,6 +56,10 @@ npx @kontent-ai/mcp-server@latest sse
56
56
 
57
57
  ## 🛠️ Available Tools
58
58
 
59
+ ### Context and Setup
60
+
61
+ * **get-initial-context** – 🚨 **MANDATORY FIRST STEP**: Provides essential context, configuration, and operational guidelines for Kontent.ai. This tool MUST be called before using any other tools to understand the platform structure, core entities, relationships, and best practices.
62
+
59
63
  ### Content Type Management
60
64
 
61
65
  * **get-type-mapi** – Get a specific content type by codename
@@ -41,7 +41,9 @@ const taxonomyElementValueSchema = z.object({
41
41
  .describe("Array of references to taxonomy terms by their codename or id"),
42
42
  });
43
43
  const richTextElementValueSchema = z.object({
44
- value: z.string().describe("The rich text content as HTML string"),
44
+ value: z
45
+ .string()
46
+ .describe("The rich text content as a subset of HTML string format. Only specific HTML5 elements and attributes are supported as defined by Kontent.ai's rich text specification. See: https://kontent.ai/learn/docs/apis/openapi/management-api-v2/#section/HTML5-elements-allowed-in-rich-text"),
45
47
  });
46
48
  const urlSlugElementValueSchema = z.object({
47
49
  value: z.string().describe("The URL slug value"),
@@ -138,9 +140,11 @@ export const elementValueHelpers = {
138
140
  .describe("Text element value - use for simple text fields like titles, descriptions, etc."),
139
141
  richText: z
140
142
  .object({
141
- value: z.string().describe("HTML content as string"),
143
+ value: z
144
+ .string()
145
+ .describe("Rich text content as a subset of HTML string format. See: https://kontent.ai/learn/docs/apis/openapi/management-api-v2/#section/HTML5-elements-allowed-in-rich-text"),
142
146
  })
143
- .describe("Rich text element value - use for formatted content with HTML tags"),
147
+ .describe("Rich text element value - use for formatted content with HTML subset (specific HTML5 elements and attributes supported by Kontent.ai)"),
144
148
  number: z
145
149
  .object({
146
150
  value: z.number().describe("Numeric value"),
@@ -0,0 +1,18 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { createMcpToolSuccessResponse } from "../utils/responseHelper.js";
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
7
+ export const registerTool = (server) => {
8
+ server.tool("get-initial-context", "🚨 MANDATORY FIRST STEP: This tool MUST be called before using ANY other tools. It provides essential context, configuration, and operational guidelines for Kontent.ai. If you have not called this tool, do so immediately before proceeding with any other operation.", {}, async () => {
9
+ try {
10
+ const markdownPath = join(__dirname, "./context/get-initial-context.md");
11
+ const kontentaiInstructions = await readFile(markdownPath, "utf-8");
12
+ return createMcpToolSuccessResponse(kontentaiInstructions);
13
+ }
14
+ catch (error) {
15
+ throw new Error(`Failed to read initial context: ${error instanceof Error ? error.message : "Unknown error"}`);
16
+ }
17
+ });
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontent-ai/mcp-server",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "rimraf build && tsc",