From 1ef5bf7d15242275a5fbaec870c16e362a1c6de0 Mon Sep 17 00:00:00 2001 From: dswbx Date: Mon, 15 Sep 2025 10:09:51 +0200 Subject: [PATCH] fix: adjust mcp schema validation and add default path support Updated `mcp.json` to enhance validation by supporting `anyOf` schema for `entity` properties and refined `role` typing. Introduced default `path` property for MCP system API and aligned build assets configuration accordingly. --- app/internal/docs.build-assets.ts | 1 + docs/mcp.json | 157 ++++++++++++++++++++++-------- 2 files changed, 116 insertions(+), 42 deletions(-) diff --git a/app/internal/docs.build-assets.ts b/app/internal/docs.build-assets.ts index 127def7..730367f 100644 --- a/app/internal/docs.build-assets.ts +++ b/app/internal/docs.build-assets.ts @@ -7,6 +7,7 @@ async function generate() { server: { mcp: { enabled: true, + path: "/mcp", }, }, auth: { diff --git a/docs/mcp.json b/docs/mcp.json index df16c4b..7075b1e 100644 --- a/docs/mcp.json +++ b/docs/mcp.json @@ -35,8 +35,7 @@ "minLength": 8 }, "role": { - "type": "string", - "enum": [] + "type": "string" } }, "required": [ @@ -134,10 +133,17 @@ ], "properties": { "entity": { - "type": "string", - "enum": [ - "users", - "media" + "anyOf": [ + { + "type": "string", + "enum": [ + "users", + "media" + ] + }, + { + "type": "string" + } ], "$target": "param" }, @@ -161,10 +167,17 @@ ], "properties": { "entity": { - "type": "string", - "enum": [ - "users", - "media" + "anyOf": [ + { + "type": "string", + "enum": [ + "users", + "media" + ] + }, + { + "type": "string" + } ], "$target": "param" }, @@ -194,10 +207,17 @@ ], "properties": { "entity": { - "type": "string", - "enum": [ - "users", - "media" + "anyOf": [ + { + "type": "string", + "enum": [ + "users", + "media" + ] + }, + { + "type": "string" + } ], "$target": "param" }, @@ -235,10 +255,17 @@ ], "properties": { "entity": { - "type": "string", - "enum": [ - "users", - "media" + "anyOf": [ + { + "type": "string", + "enum": [ + "users", + "media" + ] + }, + { + "type": "string" + } ], "$target": "param" }, @@ -276,10 +303,17 @@ ], "properties": { "entity": { - "type": "string", - "enum": [ - "users", - "media" + "anyOf": [ + { + "type": "string", + "enum": [ + "users", + "media" + ] + }, + { + "type": "string" + } ], "$target": "param" } @@ -297,10 +331,17 @@ ], "properties": { "entity": { - "type": "string", - "enum": [ - "users", - "media" + "anyOf": [ + { + "type": "string", + "enum": [ + "users", + "media" + ] + }, + { + "type": "string" + } ], "$target": "param" }, @@ -334,10 +375,17 @@ ], "properties": { "entity": { - "type": "string", - "enum": [ - "users", - "media" + "anyOf": [ + { + "type": "string", + "enum": [ + "users", + "media" + ] + }, + { + "type": "string" + } ], "$target": "param" }, @@ -410,10 +458,17 @@ ], "properties": { "entity": { - "type": "string", - "enum": [ - "users", - "media" + "anyOf": [ + { + "type": "string", + "enum": [ + "users", + "media" + ] + }, + { + "type": "string" + } ], "$target": "param" }, @@ -462,10 +517,17 @@ ], "properties": { "entity": { - "type": "string", - "enum": [ - "users", - "media" + "anyOf": [ + { + "type": "string", + "enum": [ + "users", + "media" + ] + }, + { + "type": "string" + } ], "$target": "param" }, @@ -494,10 +556,17 @@ ], "properties": { "entity": { - "type": "string", - "enum": [ - "users", - "media" + "anyOf": [ + { + "type": "string", + "enum": [ + "users", + "media" + ] + }, + { + "type": "string" + } ], "$target": "param" }, @@ -3994,6 +4063,10 @@ "enabled": { "type": "boolean", "default": false + }, + "path": { + "type": "string", + "default": "/api/system/mcp" } } }