@firecms/mcp-server 3.2.0-canary.9c3d298 → 3.3.0-canary.2064433
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 +86 -7
- package/dist/api-client.d.ts +70 -0
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +207 -3
- package/dist/api-client.js.map +1 -1
- package/dist/resources/project.d.ts +1 -0
- package/dist/resources/project.d.ts.map +1 -1
- package/dist/resources/project.js +55 -0
- package/dist/resources/project.js.map +1 -1
- package/dist/server.d.ts +12 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +23 -2
- package/dist/server.js.map +1 -1
- package/dist/tools/collection-schemas.d.ts +8 -0
- package/dist/tools/collection-schemas.d.ts.map +1 -0
- package/dist/tools/collection-schemas.js +278 -0
- package/dist/tools/collection-schemas.js.map +1 -0
- package/dist/tools/import.d.ts +8 -0
- package/dist/tools/import.d.ts.map +1 -0
- package/dist/tools/import.js +57 -0
- package/dist/tools/import.js.map +1 -0
- package/dist/tools/project-config.d.ts +8 -0
- package/dist/tools/project-config.d.ts.map +1 -0
- package/dist/tools/project-config.js +174 -0
- package/dist/tools/project-config.js.map +1 -0
- package/dist/tools/users.d.ts +2 -0
- package/dist/tools/users.d.ts.map +1 -1
- package/dist/tools/users.js +10 -3
- package/dist/tools/users.js.map +1 -1
- package/package.json +6 -6
- package/src/api-client.ts +242 -3
- package/src/resources/project.ts +69 -0
- package/src/server.ts +26 -2
- package/src/tools/collection-schemas.ts +316 -0
- package/src/tools/import.ts +65 -0
- package/src/tools/project-config.ts +202 -0
- package/src/tools/users.ts +10 -3
- package/LICENSE +0 -6
package/dist/server.js
CHANGED
|
@@ -4,16 +4,31 @@ import { registerAuthTools } from "./tools/auth.js";
|
|
|
4
4
|
import { registerProjectTools } from "./tools/projects.js";
|
|
5
5
|
import { registerUserTools } from "./tools/users.js";
|
|
6
6
|
import { registerCollectionTools } from "./tools/collections.js";
|
|
7
|
+
import { registerCollectionSchemaTools } from "./tools/collection-schemas.js";
|
|
7
8
|
import { registerDocumentTools } from "./tools/documents.js";
|
|
8
9
|
import { registerExportTools } from "./tools/export.js";
|
|
10
|
+
import { registerImportTools } from "./tools/import.js";
|
|
11
|
+
import { registerProjectConfigTools } from "./tools/project-config.js";
|
|
9
12
|
import { registerProjectResources } from "./resources/project.js";
|
|
10
13
|
/**
|
|
11
14
|
* Create and configure the FireCMS MCP server with all tools and resources.
|
|
15
|
+
*
|
|
16
|
+
* Tool categories:
|
|
17
|
+
* - Auth: Login/logout/current user
|
|
18
|
+
* - Projects: List projects, root collections
|
|
19
|
+
* - Project Config: Name, colors, locale, feature toggles (admin-only)
|
|
20
|
+
* - Users: User management (invite, roles, remove)
|
|
21
|
+
* - Collection Schemas: CRUD for collection configurations (admin-only)
|
|
22
|
+
* - AI Collections: AI-powered schema generation/modification
|
|
23
|
+
* - Documents: Firestore CRUD (list, get, create, update, delete, count)
|
|
24
|
+
* - Export: Data export as JSON
|
|
25
|
+
* - Import: Bulk data import (admin-only)
|
|
26
|
+
* - Resources: Read-only context (collections, users, schemas, config)
|
|
12
27
|
*/
|
|
13
28
|
export function createFireCMSMcpServer() {
|
|
14
29
|
const server = new McpServer({
|
|
15
30
|
name: "FireCMS Cloud",
|
|
16
|
-
version: "0.
|
|
31
|
+
version: "0.2.0",
|
|
17
32
|
});
|
|
18
33
|
const api = new FireCMSApiClient();
|
|
19
34
|
// Auth tools (login/logout)
|
|
@@ -21,13 +36,19 @@ export function createFireCMSMcpServer() {
|
|
|
21
36
|
// Project & user management (via backend API)
|
|
22
37
|
registerProjectTools(server, api);
|
|
23
38
|
registerUserTools(server, api);
|
|
39
|
+
// Project configuration (admin-only)
|
|
40
|
+
registerProjectConfigTools(server, api);
|
|
41
|
+
// Collection schema CRUD (admin-only — the core feature for agent-driven CMS management)
|
|
42
|
+
registerCollectionSchemaTools(server, api);
|
|
24
43
|
// Collection schema AI tools (via backend API)
|
|
25
44
|
registerCollectionTools(server, api);
|
|
26
45
|
// Firestore document CRUD (via backend API proxy)
|
|
27
46
|
registerDocumentTools(server, api);
|
|
28
47
|
// Data export (via backend API)
|
|
29
48
|
registerExportTools(server, api);
|
|
30
|
-
//
|
|
49
|
+
// Data import (admin-only)
|
|
50
|
+
registerImportTools(server, api);
|
|
51
|
+
// Resources (read-only contextual data)
|
|
31
52
|
registerProjectResources(server, api);
|
|
32
53
|
return server;
|
|
33
54
|
}
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAElE
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,uBAAuB,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}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { FireCMSApiClient } from "../api-client.js";
|
|
3
|
+
/**
|
|
4
|
+
* Register collection schema CRUD tools — manage the collection configurations
|
|
5
|
+
* stored in FireCMS Cloud. Admin-only operations.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerCollectionSchemaTools(server: McpServer, api: FireCMSApiClient): void;
|
|
8
|
+
//# sourceMappingURL=collection-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-schemas.d.ts","sourceRoot":"","sources":["../../src/tools/collection-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAqCpD;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,gBAAgB,QAgRrF"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Property schema definition for collection properties.
|
|
4
|
+
* Supports all FireCMS property types.
|
|
5
|
+
*/
|
|
6
|
+
const PropertySchema = z.object({
|
|
7
|
+
dataType: z.enum([
|
|
8
|
+
"string", "number", "boolean", "date", "map",
|
|
9
|
+
"array", "geopoint", "reference",
|
|
10
|
+
]).describe("The data type of this property"),
|
|
11
|
+
name: z.string().optional().describe("Display name for the property"),
|
|
12
|
+
description: z.string().optional().describe("Description shown as a tooltip"),
|
|
13
|
+
validation: z.record(z.any()).optional().describe("Validation rules (e.g., { required: true, min: 0, max: 100 })"),
|
|
14
|
+
enumValues: z.array(z.object({
|
|
15
|
+
id: z.string().describe("Enum value ID"),
|
|
16
|
+
label: z.string().describe("Display label"),
|
|
17
|
+
color: z.string().optional().describe("Color for the enum chip"),
|
|
18
|
+
})).optional().describe("Enum values for string/number fields (renders as select/chips)"),
|
|
19
|
+
multiline: z.boolean().optional().describe("For strings: render as textarea"),
|
|
20
|
+
markdown: z.boolean().optional().describe("For strings: render as markdown editor"),
|
|
21
|
+
url: z.union([z.boolean(), z.enum(["image", "video", "audio"])]).optional().describe("For strings: treat as URL, optionally specify media type"),
|
|
22
|
+
email: z.boolean().optional().describe("For strings: validate as email"),
|
|
23
|
+
storage: z.object({
|
|
24
|
+
storagePath: z.string().describe("Firebase Storage path"),
|
|
25
|
+
acceptedFiles: z.array(z.string()).optional().describe("Accepted MIME types"),
|
|
26
|
+
maxSize: z.number().optional().describe("Max file size in bytes"),
|
|
27
|
+
}).optional().describe("For strings: file upload configuration"),
|
|
28
|
+
of: z.any().optional().describe("For arrays: the property definition of array items"),
|
|
29
|
+
properties: z.record(z.any()).optional().describe("For maps: nested property definitions"),
|
|
30
|
+
path: z.string().optional().describe("For references: target collection path"),
|
|
31
|
+
previewProperties: z.array(z.string()).optional().describe("For references: properties to show in preview"),
|
|
32
|
+
disabled: z.boolean().optional().describe("If true, field is read-only in the form"),
|
|
33
|
+
columnWidth: z.number().optional().describe("Column width in pixels for table view"),
|
|
34
|
+
hideFromCollection: z.boolean().optional().describe("If true, hide from the table view"),
|
|
35
|
+
}).passthrough();
|
|
36
|
+
/**
|
|
37
|
+
* Register collection schema CRUD tools — manage the collection configurations
|
|
38
|
+
* stored in FireCMS Cloud. Admin-only operations.
|
|
39
|
+
*/
|
|
40
|
+
export function registerCollectionSchemaTools(server, api) {
|
|
41
|
+
// ─── 1. List all collection schemas ────────────────────
|
|
42
|
+
server.registerTool("list_collection_schemas", {
|
|
43
|
+
description: `List all persisted collection schemas for a FireCMS project. Returns the collection
|
|
44
|
+
configurations (name, path, properties, etc.) that define how data is displayed and edited in the CMS.`,
|
|
45
|
+
inputSchema: {
|
|
46
|
+
projectId: z.string().describe("Firebase project ID"),
|
|
47
|
+
},
|
|
48
|
+
annotations: { readOnlyHint: true },
|
|
49
|
+
}, async ({ projectId }) => {
|
|
50
|
+
try {
|
|
51
|
+
await api.assertAdmin(projectId);
|
|
52
|
+
const schemas = await api.listCollectionSchemas(projectId);
|
|
53
|
+
return {
|
|
54
|
+
content: [{
|
|
55
|
+
type: "text",
|
|
56
|
+
text: JSON.stringify(schemas, null, 2),
|
|
57
|
+
}],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
return {
|
|
62
|
+
content: [{ type: "text", text: `Error: ${error.response?.data?.error ?? error.message}` }],
|
|
63
|
+
isError: true,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
// ─── 2. Get a single collection schema ─────────────────
|
|
68
|
+
server.registerTool("get_collection_schema", {
|
|
69
|
+
description: `Get the full schema definition for a specific collection, including all properties,
|
|
70
|
+
validation rules, display configuration, and subcollection definitions.`,
|
|
71
|
+
inputSchema: {
|
|
72
|
+
projectId: z.string().describe("Firebase project ID"),
|
|
73
|
+
collectionId: z.string().describe("Collection ID (usually same as the Firestore path, e.g., 'products')"),
|
|
74
|
+
},
|
|
75
|
+
annotations: { readOnlyHint: true },
|
|
76
|
+
}, async ({ projectId, collectionId }) => {
|
|
77
|
+
try {
|
|
78
|
+
await api.assertAdmin(projectId);
|
|
79
|
+
const schema = await api.getCollectionSchema(projectId, collectionId);
|
|
80
|
+
return {
|
|
81
|
+
content: [{
|
|
82
|
+
type: "text",
|
|
83
|
+
text: JSON.stringify(schema, null, 2),
|
|
84
|
+
}],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
return {
|
|
89
|
+
content: [{ type: "text", text: `Error: ${error.response?.data?.error ?? error.message}` }],
|
|
90
|
+
isError: true,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
// ─── 3. Save (create/replace) a collection schema ──────
|
|
95
|
+
server.registerTool("save_collection_schema", {
|
|
96
|
+
description: `Create or fully replace a collection schema. This defines how a Firestore collection
|
|
97
|
+
is displayed and edited in FireCMS. Requires at minimum: id, path, and name.
|
|
98
|
+
|
|
99
|
+
Example schema:
|
|
100
|
+
{
|
|
101
|
+
"id": "products",
|
|
102
|
+
"path": "products",
|
|
103
|
+
"name": "Products",
|
|
104
|
+
"singularName": "Product",
|
|
105
|
+
"icon": "ShoppingCart",
|
|
106
|
+
"description": "Product catalog",
|
|
107
|
+
"group": "Shop",
|
|
108
|
+
"properties": {
|
|
109
|
+
"name": { "dataType": "string", "name": "Name", "validation": { "required": true } },
|
|
110
|
+
"price": { "dataType": "number", "name": "Price", "validation": { "required": true, "min": 0 } },
|
|
111
|
+
"status": { "dataType": "string", "name": "Status", "enumValues": [
|
|
112
|
+
{ "id": "draft", "label": "Draft" },
|
|
113
|
+
{ "id": "published", "label": "Published" }
|
|
114
|
+
]}
|
|
115
|
+
},
|
|
116
|
+
"propertiesOrder": ["name", "price", "status"]
|
|
117
|
+
}`,
|
|
118
|
+
inputSchema: {
|
|
119
|
+
projectId: z.string().describe("Firebase project ID"),
|
|
120
|
+
collectionId: z.string().describe("Collection ID (e.g., 'products')"),
|
|
121
|
+
schema: z.object({
|
|
122
|
+
path: z.string().describe("Firestore collection path"),
|
|
123
|
+
name: z.string().describe("Display name for the collection"),
|
|
124
|
+
singularName: z.string().optional().describe("Singular name (e.g., 'Product')"),
|
|
125
|
+
description: z.string().optional().describe("Collection description"),
|
|
126
|
+
icon: z.string().optional().describe("Material icon name (e.g., 'ShoppingCart')"),
|
|
127
|
+
group: z.string().optional().describe("Navigation group name"),
|
|
128
|
+
properties: z.record(PropertySchema).describe("Property definitions keyed by field name"),
|
|
129
|
+
propertiesOrder: z.array(z.string()).optional().describe("Display order of properties"),
|
|
130
|
+
defaultSize: z.enum(["xs", "s", "m", "l", "xl"]).optional().describe("Default row size in table"),
|
|
131
|
+
initialSort: z.tuple([z.string(), z.enum(["asc", "desc"])]).optional().describe("Default sort [field, direction]"),
|
|
132
|
+
}).passthrough().describe("Complete collection schema definition"),
|
|
133
|
+
},
|
|
134
|
+
}, async ({ projectId, collectionId, schema }) => {
|
|
135
|
+
try {
|
|
136
|
+
await api.assertAdmin(projectId);
|
|
137
|
+
const fullSchema = { id: collectionId, ...schema };
|
|
138
|
+
const result = await api.saveCollectionSchema(projectId, collectionId, fullSchema);
|
|
139
|
+
return {
|
|
140
|
+
content: [{
|
|
141
|
+
type: "text",
|
|
142
|
+
text: `Collection schema "${collectionId}" saved successfully.\n\n${JSON.stringify(result, null, 2)}`,
|
|
143
|
+
}],
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
return {
|
|
148
|
+
content: [{ type: "text", text: `Error: ${error.response?.data?.error ?? error.message}` }],
|
|
149
|
+
isError: true,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
// ─── 4. Update (partial) a collection schema ───────────
|
|
154
|
+
server.registerTool("update_collection_schema", {
|
|
155
|
+
description: `Partially update an existing collection schema. Only the specified fields are modified
|
|
156
|
+
(merged with the existing schema). Use this for changes like renaming, updating the group,
|
|
157
|
+
changing display settings, or adding new properties.`,
|
|
158
|
+
inputSchema: {
|
|
159
|
+
projectId: z.string().describe("Firebase project ID"),
|
|
160
|
+
collectionId: z.string().describe("Collection ID to update"),
|
|
161
|
+
data: z.record(z.any()).describe("Fields to update (merged with existing schema)"),
|
|
162
|
+
},
|
|
163
|
+
}, async ({ projectId, collectionId, data }) => {
|
|
164
|
+
try {
|
|
165
|
+
await api.assertAdmin(projectId);
|
|
166
|
+
const result = await api.updateCollectionSchema(projectId, collectionId, data);
|
|
167
|
+
return {
|
|
168
|
+
content: [{
|
|
169
|
+
type: "text",
|
|
170
|
+
text: `Collection schema "${collectionId}" updated successfully.\n\n${JSON.stringify(result, null, 2)}`,
|
|
171
|
+
}],
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
return {
|
|
176
|
+
content: [{ type: "text", text: `Error: ${error.response?.data?.error ?? error.message}` }],
|
|
177
|
+
isError: true,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
// ─── 5. Delete a collection schema ─────────────────────
|
|
182
|
+
server.registerTool("delete_collection_schema", {
|
|
183
|
+
description: `Delete a collection schema from FireCMS. This removes the collection configuration
|
|
184
|
+
from the CMS — it does NOT delete the underlying Firestore data. The collection will simply
|
|
185
|
+
no longer appear in the FireCMS UI.`,
|
|
186
|
+
inputSchema: {
|
|
187
|
+
projectId: z.string().describe("Firebase project ID"),
|
|
188
|
+
collectionId: z.string().describe("Collection ID to delete"),
|
|
189
|
+
},
|
|
190
|
+
annotations: { destructiveHint: true },
|
|
191
|
+
}, async ({ projectId, collectionId }) => {
|
|
192
|
+
try {
|
|
193
|
+
await api.assertAdmin(projectId);
|
|
194
|
+
await api.deleteCollectionSchema(projectId, collectionId);
|
|
195
|
+
return {
|
|
196
|
+
content: [{
|
|
197
|
+
type: "text",
|
|
198
|
+
text: `Collection schema "${collectionId}" deleted successfully. Note: the underlying Firestore data was not affected.`,
|
|
199
|
+
}],
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
return {
|
|
204
|
+
content: [{ type: "text", text: `Error: ${error.response?.data?.error ?? error.message}` }],
|
|
205
|
+
isError: true,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
// ─── 6. Save (add/update) a single property ────────────
|
|
210
|
+
server.registerTool("save_property", {
|
|
211
|
+
description: `Add or update a single property in a collection schema. This is more granular than
|
|
212
|
+
updating the entire schema — use it when you want to add a new field or modify an existing
|
|
213
|
+
one without affecting other properties.
|
|
214
|
+
|
|
215
|
+
Example property:
|
|
216
|
+
{
|
|
217
|
+
"dataType": "string",
|
|
218
|
+
"name": "Description",
|
|
219
|
+
"description": "Product description",
|
|
220
|
+
"multiline": true,
|
|
221
|
+
"validation": { "required": true, "max": 500 }
|
|
222
|
+
}`,
|
|
223
|
+
inputSchema: {
|
|
224
|
+
projectId: z.string().describe("Firebase project ID"),
|
|
225
|
+
collectionId: z.string().describe("Collection ID"),
|
|
226
|
+
propertyKey: z.string().describe("Property field key (e.g., 'description', 'price')"),
|
|
227
|
+
property: PropertySchema.describe("Property definition"),
|
|
228
|
+
namespace: z.string().optional().describe("Dot-separated namespace for nested properties in maps (e.g., 'address' for address.street)"),
|
|
229
|
+
},
|
|
230
|
+
}, async ({ projectId, collectionId, propertyKey, property, namespace }) => {
|
|
231
|
+
try {
|
|
232
|
+
await api.assertAdmin(projectId);
|
|
233
|
+
const result = await api.saveProperty(projectId, collectionId, propertyKey, property, namespace);
|
|
234
|
+
return {
|
|
235
|
+
content: [{
|
|
236
|
+
type: "text",
|
|
237
|
+
text: `Property "${propertyKey}" saved in collection "${collectionId}" successfully.\n\n${JSON.stringify(result, null, 2)}`,
|
|
238
|
+
}],
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
catch (error) {
|
|
242
|
+
return {
|
|
243
|
+
content: [{ type: "text", text: `Error: ${error.response?.data?.error ?? error.message}` }],
|
|
244
|
+
isError: true,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
// ─── 7. Delete a property ──────────────────────────────
|
|
249
|
+
server.registerTool("delete_property", {
|
|
250
|
+
description: `Remove a property from a collection schema. This removes the field definition from
|
|
251
|
+
the CMS configuration — it does NOT delete the field from existing Firestore documents.`,
|
|
252
|
+
inputSchema: {
|
|
253
|
+
projectId: z.string().describe("Firebase project ID"),
|
|
254
|
+
collectionId: z.string().describe("Collection ID"),
|
|
255
|
+
propertyKey: z.string().describe("Property key to remove"),
|
|
256
|
+
namespace: z.string().optional().describe("Dot-separated namespace for nested properties"),
|
|
257
|
+
},
|
|
258
|
+
annotations: { destructiveHint: true },
|
|
259
|
+
}, async ({ projectId, collectionId, propertyKey, namespace }) => {
|
|
260
|
+
try {
|
|
261
|
+
await api.assertAdmin(projectId);
|
|
262
|
+
await api.deleteProperty(projectId, collectionId, propertyKey, namespace);
|
|
263
|
+
return {
|
|
264
|
+
content: [{
|
|
265
|
+
type: "text",
|
|
266
|
+
text: `Property "${propertyKey}" removed from collection "${collectionId}". Note: existing Firestore data was not affected.`,
|
|
267
|
+
}],
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
catch (error) {
|
|
271
|
+
return {
|
|
272
|
+
content: [{ type: "text", text: `Error: ${error.response?.data?.error ?? error.message}` }],
|
|
273
|
+
isError: true,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=collection-schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-schemas.js","sourceRoot":"","sources":["../../src/tools/collection-schemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AACH,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC;QACb,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK;QAC5C,OAAO,EAAE,UAAU,EAAE,WAAW;KACnC,CAAC,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IACrE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IAC7E,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;IAClH,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACzB,EAAE,EAAE,CAAC,CAAC,MAAM,EA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,QAAQ,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;SAC7F;QACD,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;KACzC,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,EAAE;QAC1D,IAAI,CAAC;YACD,MAAM,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;YACjC,MAAM,GAAG,CAAC,cAAc,CAAC,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;YAC1E,OAAO;gBACH,OAAO,EAAE,CAAC;wBACN,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,aAAa,WAAW,8BAA8B,YAAY,oDAAoD;qBAC/H,CAAC;aACL,CAAC;QACN,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YAClB,OAAO;gBACH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;gBACpG,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;IACL,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { FireCMSApiClient } from "../api-client.js";
|
|
3
|
+
/**
|
|
4
|
+
* Register data import tools — bulk operations for Firestore documents.
|
|
5
|
+
* Admin-only operations.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerImportTools(server: McpServer, api: FireCMSApiClient): void;
|
|
8
|
+
//# sourceMappingURL=import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../src/tools/import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,gBAAgB,QAwD3E"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Register data import tools — bulk operations for Firestore documents.
|
|
4
|
+
* Admin-only operations.
|
|
5
|
+
*/
|
|
6
|
+
export function registerImportTools(server, api) {
|
|
7
|
+
server.registerTool("import_documents", {
|
|
8
|
+
description: `Bulk import documents into a Firestore collection. Useful for seeding data,
|
|
9
|
+
migrations, or restoring from a backup. Each document can optionally specify an ID;
|
|
10
|
+
if omitted, Firestore generates one. Use "merge: true" to update existing documents
|
|
11
|
+
instead of overwriting.
|
|
12
|
+
|
|
13
|
+
Maximum 500 documents per call. For larger imports, call multiple times.`,
|
|
14
|
+
inputSchema: {
|
|
15
|
+
projectId: z.string().describe("Firebase project ID"),
|
|
16
|
+
collectionPath: z.string().describe("Target collection path (e.g., 'products')"),
|
|
17
|
+
documents: z.array(z.object({
|
|
18
|
+
id: z.string().optional().describe("Optional document ID"),
|
|
19
|
+
data: z.record(z.any()).describe("Document fields"),
|
|
20
|
+
})).describe("Array of documents to import (max 500)"),
|
|
21
|
+
merge: z.boolean().optional().describe("If true, merge with existing documents instead of overwriting (default: false)"),
|
|
22
|
+
databaseId: z.string().optional().describe("Firestore database ID (default: '(default)')"),
|
|
23
|
+
},
|
|
24
|
+
}, async ({ projectId, collectionPath, documents, merge, databaseId }) => {
|
|
25
|
+
try {
|
|
26
|
+
await api.assertAdmin(projectId);
|
|
27
|
+
if (documents.length > 500) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{
|
|
30
|
+
type: "text",
|
|
31
|
+
text: `Error: Maximum 500 documents per import call. You provided ${documents.length}. Split into batches.`,
|
|
32
|
+
}],
|
|
33
|
+
isError: true,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const result = await api.importDocuments(projectId, {
|
|
37
|
+
path: collectionPath,
|
|
38
|
+
documents,
|
|
39
|
+
merge: merge ?? false,
|
|
40
|
+
databaseId,
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
content: [{
|
|
44
|
+
type: "text",
|
|
45
|
+
text: `Successfully imported ${documents.length} document(s) into "${collectionPath}".\n\n${JSON.stringify(result, null, 2)}`,
|
|
46
|
+
}],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
return {
|
|
51
|
+
content: [{ type: "text", text: `Error importing: ${error.response?.data?.error ?? error.message}` }],
|
|
52
|
+
isError: true,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/tools/import.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAiB,EAAE,GAAqB;IAExE,MAAM,CAAC,YAAY,CACf,kBAAkB,EAClB;QACI,WAAW,EAAE;;;;;yEAKgD;QAC7D,WAAW,EAAE;YACT,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;YACrD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;YAChF,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;gBACxB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;gBAC1D,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ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IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;gBAC9G,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;IACL,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { FireCMSApiClient } from "../api-client.js";
|
|
3
|
+
/**
|
|
4
|
+
* Register project configuration tools — manage project settings like
|
|
5
|
+
* name, colors, locale, feature toggles, etc. Admin-only operations.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerProjectConfigTools(server: McpServer, api: FireCMSApiClient): void;
|
|
8
|
+
//# sourceMappingURL=project-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-config.d.ts","sourceRoot":"","sources":["../../src/tools/project-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,gBAAgB,QAiMlF"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Register project configuration tools — manage project settings like
|
|
4
|
+
* name, colors, locale, feature toggles, etc. Admin-only operations.
|
|
5
|
+
*/
|
|
6
|
+
export function registerProjectConfigTools(server, api) {
|
|
7
|
+
// ─── 1. Get project configuration ──────────────────────
|
|
8
|
+
server.registerTool("get_project_config", {
|
|
9
|
+
description: `Get the full configuration for a FireCMS project, including:
|
|
10
|
+
- Project name, logo, and brand colors (primary/secondary)
|
|
11
|
+
- Subscription plan and trial status
|
|
12
|
+
- Feature toggles (text search, entity history, App Check)
|
|
13
|
+
- Default locale settings
|
|
14
|
+
- Customization revision info`,
|
|
15
|
+
inputSchema: {
|
|
16
|
+
projectId: z.string().describe("Firebase project ID"),
|
|
17
|
+
},
|
|
18
|
+
annotations: { readOnlyHint: true },
|
|
19
|
+
}, async ({ projectId }) => {
|
|
20
|
+
try {
|
|
21
|
+
await api.assertAdmin(projectId);
|
|
22
|
+
const config = await api.getProjectConfig(projectId);
|
|
23
|
+
return {
|
|
24
|
+
content: [{
|
|
25
|
+
type: "text",
|
|
26
|
+
text: JSON.stringify(config, null, 2),
|
|
27
|
+
}],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
return {
|
|
32
|
+
content: [{ type: "text", text: `Error: ${error.response?.data?.error ?? error.message}` }],
|
|
33
|
+
isError: true,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
// ─── 2. Update project name ────────────────────────────
|
|
38
|
+
server.registerTool("update_project_name", {
|
|
39
|
+
description: "Update the display name of a FireCMS project.",
|
|
40
|
+
inputSchema: {
|
|
41
|
+
projectId: z.string().describe("Firebase project ID"),
|
|
42
|
+
name: z.string().describe("New project name"),
|
|
43
|
+
},
|
|
44
|
+
}, async ({ projectId, name }) => {
|
|
45
|
+
try {
|
|
46
|
+
await api.assertAdmin(projectId);
|
|
47
|
+
await api.updateProjectConfig(projectId, { name });
|
|
48
|
+
return {
|
|
49
|
+
content: [{
|
|
50
|
+
type: "text",
|
|
51
|
+
text: `Project name updated to "${name}".`,
|
|
52
|
+
}],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
return {
|
|
57
|
+
content: [{ type: "text", text: `Error: ${error.response?.data?.error ?? error.message}` }],
|
|
58
|
+
isError: true,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
// ─── 3. Update brand colors ────────────────────────────
|
|
63
|
+
server.registerTool("update_project_colors", {
|
|
64
|
+
description: "Update the primary and/or secondary brand colors for the CMS UI. Colors should be hex values (e.g., '#0070F4').",
|
|
65
|
+
inputSchema: {
|
|
66
|
+
projectId: z.string().describe("Firebase project ID"),
|
|
67
|
+
primaryColor: z.string().optional().describe("Primary color hex (e.g., '#0070F4')"),
|
|
68
|
+
secondaryColor: z.string().optional().describe("Secondary color hex (e.g., '#FF5B79')"),
|
|
69
|
+
},
|
|
70
|
+
}, async ({ projectId, primaryColor, secondaryColor }) => {
|
|
71
|
+
try {
|
|
72
|
+
await api.assertAdmin(projectId);
|
|
73
|
+
const data = {};
|
|
74
|
+
if (primaryColor)
|
|
75
|
+
data.primary_color = primaryColor;
|
|
76
|
+
if (secondaryColor)
|
|
77
|
+
data.secondary_color = secondaryColor;
|
|
78
|
+
await api.updateProjectConfig(projectId, data);
|
|
79
|
+
const parts = [];
|
|
80
|
+
if (primaryColor)
|
|
81
|
+
parts.push(`primary → ${primaryColor}`);
|
|
82
|
+
if (secondaryColor)
|
|
83
|
+
parts.push(`secondary → ${secondaryColor}`);
|
|
84
|
+
return {
|
|
85
|
+
content: [{
|
|
86
|
+
type: "text",
|
|
87
|
+
text: `Brand colors updated: ${parts.join(", ")}.`,
|
|
88
|
+
}],
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
return {
|
|
93
|
+
content: [{ type: "text", text: `Error: ${error.response?.data?.error ?? error.message}` }],
|
|
94
|
+
isError: true,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
// ─── 4. Update default locale ──────────────────────────
|
|
99
|
+
server.registerTool("update_default_locale", {
|
|
100
|
+
description: "Change the default locale for the CMS (affects date formatting, etc.).",
|
|
101
|
+
inputSchema: {
|
|
102
|
+
projectId: z.string().describe("Firebase project ID"),
|
|
103
|
+
locale: z.string().describe("Locale code (e.g., 'en', 'es', 'de', 'fr', 'it')"),
|
|
104
|
+
},
|
|
105
|
+
}, async ({ projectId, locale }) => {
|
|
106
|
+
try {
|
|
107
|
+
await api.assertAdmin(projectId);
|
|
108
|
+
await api.updateProjectConfig(projectId, { default_locale: locale });
|
|
109
|
+
return {
|
|
110
|
+
content: [{
|
|
111
|
+
type: "text",
|
|
112
|
+
text: `Default locale updated to "${locale}".`,
|
|
113
|
+
}],
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
return {
|
|
118
|
+
content: [{ type: "text", text: `Error: ${error.response?.data?.error ?? error.message}` }],
|
|
119
|
+
isError: true,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
// ─── 5. Toggle text search ─────────────────────────────
|
|
124
|
+
server.registerTool("toggle_text_search", {
|
|
125
|
+
description: "Enable or disable the local text search feature for a project.",
|
|
126
|
+
inputSchema: {
|
|
127
|
+
projectId: z.string().describe("Firebase project ID"),
|
|
128
|
+
enabled: z.boolean().describe("true to enable, false to disable"),
|
|
129
|
+
},
|
|
130
|
+
}, async ({ projectId, enabled }) => {
|
|
131
|
+
try {
|
|
132
|
+
await api.assertAdmin(projectId);
|
|
133
|
+
await api.updateProjectConfig(projectId, { local_text_search_enabled: enabled });
|
|
134
|
+
return {
|
|
135
|
+
content: [{
|
|
136
|
+
type: "text",
|
|
137
|
+
text: `Local text search ${enabled ? "enabled" : "disabled"}.`,
|
|
138
|
+
}],
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
return {
|
|
143
|
+
content: [{ type: "text", text: `Error: ${error.response?.data?.error ?? error.message}` }],
|
|
144
|
+
isError: true,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
// ─── 6. Toggle entity history ──────────────────────────
|
|
149
|
+
server.registerTool("toggle_entity_history", {
|
|
150
|
+
description: "Enable or disable entity history tracking (audit log of document changes) for a project.",
|
|
151
|
+
inputSchema: {
|
|
152
|
+
projectId: z.string().describe("Firebase project ID"),
|
|
153
|
+
enabled: z.boolean().describe("true to enable, false to disable"),
|
|
154
|
+
},
|
|
155
|
+
}, async ({ projectId, enabled }) => {
|
|
156
|
+
try {
|
|
157
|
+
await api.assertAdmin(projectId);
|
|
158
|
+
await api.updateProjectConfig(projectId, { history_default_enabled: enabled });
|
|
159
|
+
return {
|
|
160
|
+
content: [{
|
|
161
|
+
type: "text",
|
|
162
|
+
text: `Entity history tracking ${enabled ? "enabled" : "disabled"}.`,
|
|
163
|
+
}],
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
return {
|
|
168
|
+
content: [{ type: "text", text: `Error: ${error.response?.data?.error ?? error.message}` }],
|
|
169
|
+
isError: true,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=project-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-config.js","sourceRoot":"","sources":["../../src/tools/project-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAiB,EAAE,GAAqB;IAE/E,0DAA0D;IAE1D,MAAM,CAAC,YAAY,CACf,oBAAoB,EACpB;QACI,WAAW,EAAE;;;;;8BAKK;QAClB,WAAW,EAAE;YACT,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;SACxD;QACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;KACtC,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;QACpB,IAAI,CAAC;YACD,MAAM,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;YACjC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;YACrD,OAAO;gBACH,OAAO,EAAE,CAAC;wBACN,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;qBAC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