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.
This commit is contained in:
dswbx
2025-09-15 10:09:51 +02:00
parent 9a1589da0b
commit 1ef5bf7d15
2 changed files with 116 additions and 42 deletions

View File

@@ -7,6 +7,7 @@ async function generate() {
server: { server: {
mcp: { mcp: {
enabled: true, enabled: true,
path: "/mcp",
}, },
}, },
auth: { auth: {

View File

@@ -35,8 +35,7 @@
"minLength": 8 "minLength": 8
}, },
"role": { "role": {
"type": "string", "type": "string"
"enum": []
} }
}, },
"required": [ "required": [
@@ -134,10 +133,17 @@
], ],
"properties": { "properties": {
"entity": { "entity": {
"anyOf": [
{
"type": "string", "type": "string",
"enum": [ "enum": [
"users", "users",
"media" "media"
]
},
{
"type": "string"
}
], ],
"$target": "param" "$target": "param"
}, },
@@ -161,10 +167,17 @@
], ],
"properties": { "properties": {
"entity": { "entity": {
"anyOf": [
{
"type": "string", "type": "string",
"enum": [ "enum": [
"users", "users",
"media" "media"
]
},
{
"type": "string"
}
], ],
"$target": "param" "$target": "param"
}, },
@@ -194,10 +207,17 @@
], ],
"properties": { "properties": {
"entity": { "entity": {
"anyOf": [
{
"type": "string", "type": "string",
"enum": [ "enum": [
"users", "users",
"media" "media"
]
},
{
"type": "string"
}
], ],
"$target": "param" "$target": "param"
}, },
@@ -235,10 +255,17 @@
], ],
"properties": { "properties": {
"entity": { "entity": {
"anyOf": [
{
"type": "string", "type": "string",
"enum": [ "enum": [
"users", "users",
"media" "media"
]
},
{
"type": "string"
}
], ],
"$target": "param" "$target": "param"
}, },
@@ -276,10 +303,17 @@
], ],
"properties": { "properties": {
"entity": { "entity": {
"anyOf": [
{
"type": "string", "type": "string",
"enum": [ "enum": [
"users", "users",
"media" "media"
]
},
{
"type": "string"
}
], ],
"$target": "param" "$target": "param"
} }
@@ -297,10 +331,17 @@
], ],
"properties": { "properties": {
"entity": { "entity": {
"anyOf": [
{
"type": "string", "type": "string",
"enum": [ "enum": [
"users", "users",
"media" "media"
]
},
{
"type": "string"
}
], ],
"$target": "param" "$target": "param"
}, },
@@ -334,10 +375,17 @@
], ],
"properties": { "properties": {
"entity": { "entity": {
"anyOf": [
{
"type": "string", "type": "string",
"enum": [ "enum": [
"users", "users",
"media" "media"
]
},
{
"type": "string"
}
], ],
"$target": "param" "$target": "param"
}, },
@@ -410,10 +458,17 @@
], ],
"properties": { "properties": {
"entity": { "entity": {
"anyOf": [
{
"type": "string", "type": "string",
"enum": [ "enum": [
"users", "users",
"media" "media"
]
},
{
"type": "string"
}
], ],
"$target": "param" "$target": "param"
}, },
@@ -462,10 +517,17 @@
], ],
"properties": { "properties": {
"entity": { "entity": {
"anyOf": [
{
"type": "string", "type": "string",
"enum": [ "enum": [
"users", "users",
"media" "media"
]
},
{
"type": "string"
}
], ],
"$target": "param" "$target": "param"
}, },
@@ -494,10 +556,17 @@
], ],
"properties": { "properties": {
"entity": { "entity": {
"anyOf": [
{
"type": "string", "type": "string",
"enum": [ "enum": [
"users", "users",
"media" "media"
]
},
{
"type": "string"
}
], ],
"$target": "param" "$target": "param"
}, },
@@ -3994,6 +4063,10 @@
"enabled": { "enabled": {
"type": "boolean", "type": "boolean",
"default": false "default": false
},
"path": {
"type": "string",
"default": "/api/system/mcp"
} }
} }
} }