@lacecms/mcp 0.0.0-stage → 0.1.0-alpha.8
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/LICENSE +21 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +180 -0
- package/dist/index.js.map +1 -0
- package/package.json +33 -3
- package/README.md +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Boris Khakhin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ContentUseCases } from "@lacecms/application";
|
|
2
|
+
import { type Actor } from "@lacecms/domain";
|
|
3
|
+
import { mcpToolArgumentSchemas } from "@lacecms/contracts";
|
|
4
|
+
export declare const packageName = "@lacecms/mcp";
|
|
5
|
+
type ToolName = keyof typeof mcpToolArgumentSchemas;
|
|
6
|
+
export interface McpToolCompletion {
|
|
7
|
+
readonly actorId: string;
|
|
8
|
+
readonly tool: ToolName;
|
|
9
|
+
readonly outcome: "success" | "error";
|
|
10
|
+
readonly durationMs: number;
|
|
11
|
+
}
|
|
12
|
+
/** A stateless protocol adapter over the same instances used by REST. */
|
|
13
|
+
export declare function createMcpContentHandler(input: {
|
|
14
|
+
readonly content: ContentUseCases;
|
|
15
|
+
readonly version: string;
|
|
16
|
+
}): {
|
|
17
|
+
fetch(request: Request, actor: Actor, completed?: (event: McpToolCompletion) => void): Promise<Response>;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EACL,sBAAsB,EAcvB,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,WAAW,iBAAiB,CAAC;AAC1C,KAAK,QAAQ,GAAG,MAAM,OAAO,sBAAsB,CAAC;AAiDpD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AACD,yEAAyE;AACzE,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,GAAG;IACF,KAAK,CACH,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAC7C,OAAO,CAAC,QAAQ,CAAC,CAAC;CACtB,CA2JA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { McpServer, createMcpHandler } from "@modelcontextprotocol/server";
|
|
2
|
+
import { toJsonSchema } from "@valibot/to-json-schema";
|
|
3
|
+
import * as v from "valibot";
|
|
4
|
+
import { canContentOperation, opaqueCursor, } from "@lacecms/application";
|
|
5
|
+
import { contentEntryId } from "@lacecms/domain";
|
|
6
|
+
import { mcpToolArgumentSchemas, mcpListEntriesEnvelopeSchema, contractJsonSchemaOverride, toContentBlockInput, toContentModelDiscoveryDto, toContentEntryListDto, toAdminEntryProjectionDto, contentModelListSchema, contentEntryListSchema, adminContentEntrySchema, classifyError, validationError, toContractValidationIssues, transportError, } from "@lacecms/contracts";
|
|
7
|
+
export const packageName = "@lacecms/mcp";
|
|
8
|
+
class ArgumentFailure extends Error {
|
|
9
|
+
body;
|
|
10
|
+
constructor(body) {
|
|
11
|
+
super("Invalid tool arguments.");
|
|
12
|
+
this.body = body;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function argumentsFor(schema, value) {
|
|
16
|
+
const result = v.safeParse(schema, value);
|
|
17
|
+
if (!result.success)
|
|
18
|
+
throw new ArgumentFailure(validationError(toContractValidationIssues(result.issues)).body);
|
|
19
|
+
return result.output;
|
|
20
|
+
}
|
|
21
|
+
const tools = Object.freeze([
|
|
22
|
+
{
|
|
23
|
+
name: "list_content_models",
|
|
24
|
+
operation: "discoverModels",
|
|
25
|
+
description: "Inspect content models and their fields, blocks and query limits.",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "list_entries",
|
|
29
|
+
operation: "list",
|
|
30
|
+
description: "List and filter draft entries for one content model.",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "get_entry",
|
|
34
|
+
operation: "load",
|
|
35
|
+
description: "Read an entry, its draft revision and published snapshot.",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "create_entry",
|
|
39
|
+
operation: "create",
|
|
40
|
+
description: "Create an unpublished entry from a complete draft. Re-read after an uncertain outcome; creation is not idempotent.",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "save_draft",
|
|
44
|
+
operation: "save",
|
|
45
|
+
description: "Replace the complete draft using the explicit expected revision. Does not publish or request a build.",
|
|
46
|
+
},
|
|
47
|
+
]);
|
|
48
|
+
/** A stateless protocol adapter over the same instances used by REST. */
|
|
49
|
+
export function createMcpContentHandler(input) {
|
|
50
|
+
const content = input.content;
|
|
51
|
+
const execute = async (name, raw, actor) => {
|
|
52
|
+
switch (name) {
|
|
53
|
+
case "list_content_models": {
|
|
54
|
+
argumentsFor(mcpToolArgumentSchemas.list_content_models, raw);
|
|
55
|
+
return v.parse(contentModelListSchema, toContentModelDiscoveryDto(content.discoverModels({ actor })));
|
|
56
|
+
}
|
|
57
|
+
case "list_entries": {
|
|
58
|
+
const args = argumentsFor(mcpListEntriesEnvelopeSchema, raw);
|
|
59
|
+
return v.parse(contentEntryListSchema, toContentEntryListDto(await content.list({
|
|
60
|
+
actor,
|
|
61
|
+
modelKey: args.modelKey,
|
|
62
|
+
limit: args.limit,
|
|
63
|
+
...(args.after === undefined ? {} : { after: opaqueCursor(args.after) }),
|
|
64
|
+
...(args.q === undefined ? {} : { q: args.q }),
|
|
65
|
+
...(args.sort === undefined ? {} : { sort: args.sort }),
|
|
66
|
+
...(args.status === undefined ? {} : { status: args.status }),
|
|
67
|
+
...(args.filters === undefined ? {} : { filters: args.filters }),
|
|
68
|
+
})));
|
|
69
|
+
}
|
|
70
|
+
case "get_entry": {
|
|
71
|
+
const args = argumentsFor(mcpToolArgumentSchemas.get_entry, raw);
|
|
72
|
+
const entry = await content.loadAdminEntry({
|
|
73
|
+
actor,
|
|
74
|
+
entryId: contentEntryId(args.entryId),
|
|
75
|
+
});
|
|
76
|
+
if (!entry)
|
|
77
|
+
return Promise.reject(new ArgumentFailure(transportError("NOT_FOUND").body));
|
|
78
|
+
return v.parse(adminContentEntrySchema, toAdminEntryProjectionDto(entry));
|
|
79
|
+
}
|
|
80
|
+
case "create_entry": {
|
|
81
|
+
const args = argumentsFor(mcpToolArgumentSchemas.create_entry, raw);
|
|
82
|
+
const entry = await content.create({
|
|
83
|
+
actor,
|
|
84
|
+
modelKey: args.modelKey,
|
|
85
|
+
title: args.title,
|
|
86
|
+
blocks: args.blocks.map(toContentBlockInput),
|
|
87
|
+
fields: args.fields,
|
|
88
|
+
...(args.slug === undefined ? {} : { slug: args.slug }),
|
|
89
|
+
...(args.seo === undefined ? {} : { seo: args.seo }),
|
|
90
|
+
});
|
|
91
|
+
return v.parse(adminContentEntrySchema, toAdminEntryProjectionDto(await content.projectAdminEntry({ actor, entry })));
|
|
92
|
+
}
|
|
93
|
+
case "save_draft": {
|
|
94
|
+
const args = argumentsFor(mcpToolArgumentSchemas.save_draft, raw);
|
|
95
|
+
const entry = await content.save({
|
|
96
|
+
actor,
|
|
97
|
+
entryId: contentEntryId(args.entryId),
|
|
98
|
+
expectedRevision: args.expectedRevision,
|
|
99
|
+
title: args.title,
|
|
100
|
+
blocks: args.blocks.map(toContentBlockInput),
|
|
101
|
+
fields: args.fields,
|
|
102
|
+
...(args.slug === undefined ? {} : { slug: args.slug }),
|
|
103
|
+
...(args.seo === undefined ? {} : { seo: args.seo }),
|
|
104
|
+
});
|
|
105
|
+
return v.parse(adminContentEntrySchema, toAdminEntryProjectionDto(await content.projectAdminEntry({ actor, entry })));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
return Object.freeze({
|
|
110
|
+
fetch: async (request, actor, completed) => {
|
|
111
|
+
const handler = createMcpHandler(() => {
|
|
112
|
+
const server = new McpServer({ name: "lace-content", version: input.version });
|
|
113
|
+
for (const tool of tools) {
|
|
114
|
+
if (!canContentOperation(actor, tool.operation))
|
|
115
|
+
continue;
|
|
116
|
+
const schema = mcpToolArgumentSchemas[tool.name];
|
|
117
|
+
const advertised = toJsonSchema(schema, {
|
|
118
|
+
errorMode: "ignore",
|
|
119
|
+
overrideSchema: ({ valibotSchema }) => contractJsonSchemaOverride(valibotSchema),
|
|
120
|
+
});
|
|
121
|
+
// Publish the derived JSON Schema; Valibot validates inside the callback
|
|
122
|
+
// so invalid business arguments retain the shared safe error envelope.
|
|
123
|
+
const json = { ...advertised };
|
|
124
|
+
const inputSchema = {
|
|
125
|
+
"~standard": {
|
|
126
|
+
version: 1,
|
|
127
|
+
vendor: "lace-contracts",
|
|
128
|
+
validate: (value) => ({ value }),
|
|
129
|
+
jsonSchema: { input: () => json, output: () => json },
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
server.registerTool(tool.name, {
|
|
133
|
+
description: tool.description,
|
|
134
|
+
inputSchema,
|
|
135
|
+
annotations: {
|
|
136
|
+
readOnlyHint: ["discoverModels", "list", "load"].includes(tool.operation),
|
|
137
|
+
destructiveHint: false,
|
|
138
|
+
openWorldHint: false,
|
|
139
|
+
},
|
|
140
|
+
}, async (raw) => {
|
|
141
|
+
const started = Date.now();
|
|
142
|
+
let outcome = "success";
|
|
143
|
+
try {
|
|
144
|
+
const result = await execute(tool.name, raw, actor);
|
|
145
|
+
return {
|
|
146
|
+
content: [{ type: "text", text: JSON.stringify(result) }],
|
|
147
|
+
structuredContent: result,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
outcome = "error";
|
|
152
|
+
const result = error instanceof ArgumentFailure ? error.body : classifyError(error).body;
|
|
153
|
+
return {
|
|
154
|
+
isError: true,
|
|
155
|
+
content: [{ type: "text", text: JSON.stringify(result) }],
|
|
156
|
+
structuredContent: result,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
finally {
|
|
160
|
+
completed?.({
|
|
161
|
+
actorId: actor.id,
|
|
162
|
+
tool: tool.name,
|
|
163
|
+
outcome,
|
|
164
|
+
durationMs: Date.now() - started,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return server;
|
|
170
|
+
}, { legacy: "stateless" });
|
|
171
|
+
try {
|
|
172
|
+
return await handler.fetch(request);
|
|
173
|
+
}
|
|
174
|
+
finally {
|
|
175
|
+
await handler.close();
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,EACL,mBAAmB,EACnB,YAAY,GAGb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAc,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,aAAa,EACb,eAAe,EACf,0BAA0B,EAC1B,cAAc,GACf,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAE1C,MAAM,eAAgB,SAAQ,KAAK;IACL,IAAI;IAAhC,YAA4B,IAAgD;QAC1E,KAAK,CAAC,yBAAyB,CAAC,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.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0-alpha.8",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/lacecms/lace.git",
|
|
8
|
+
"directory": "packages/mcp"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"type": "module",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public",
|
|
23
|
+
"tag": "next"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@lacecms/application": "0.1.0-alpha.8",
|
|
27
|
+
"@lacecms/contracts": "0.1.0-alpha.8",
|
|
28
|
+
"@lacecms/domain": "0.1.0-alpha.8",
|
|
29
|
+
"@modelcontextprotocol/server": "2.4.0",
|
|
30
|
+
"@valibot/to-json-schema": "1.4.0",
|
|
31
|
+
"valibot": "1.4.2"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=24.12.0"
|
|
35
|
+
}
|
|
6
36
|
}
|
package/README.md
DELETED