@chaprola/mcp-server 1.13.1 → 1.14.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/dist/index.js +39 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -954,25 +954,6 @@ server.tool("chaprola_delete_record", "Delete a single record matched by a where
|
|
|
954
954
|
const res = await authedFetch("/delete-record", { userid: userid || username, project, file, where: whereClause });
|
|
955
955
|
return textResult(res);
|
|
956
956
|
}));
|
|
957
|
-
server.tool("chaprola_upsert_record", "Insert or update a record by key field. If a record with the matching key value exists, update it in place. If not, insert it. Supports batch: pass records array to upsert multiple records in one call.", {
|
|
958
|
-
project: z.string().describe("Project name"),
|
|
959
|
-
file: z.string().describe("Data file name (without extension)"),
|
|
960
|
-
key: z.string().describe("Field name to match on, e.g. \"contact_id\". Must exist in the format file."),
|
|
961
|
-
record: z.string().optional().describe("JSON object of a single record to upsert, e.g. {\"contact_id\": \"c-42\", \"name\": \"Alice\"}. Must contain the key field. Use this OR records, not both."),
|
|
962
|
-
records: z.string().optional().describe("JSON array of records for batch upsert (max 1000). Each must contain the key field. Use this OR record, not both."),
|
|
963
|
-
userid: z.string().optional().describe("Project owner's username. Required when accessing a shared project where you are a writer. Defaults to the authenticated user."),
|
|
964
|
-
}, async ({ project, file, key, record: recordStr, records: recordsStr, userid }) => withBaaCheck(async () => {
|
|
965
|
-
const record = recordStr ? (typeof recordStr === 'string' ? JSON.parse(recordStr) : recordStr) : undefined;
|
|
966
|
-
const records = recordsStr ? (typeof recordsStr === 'string' ? JSON.parse(recordsStr) : recordsStr) : undefined;
|
|
967
|
-
const { username } = getCredentials();
|
|
968
|
-
const body = { userid: userid || username, project, file, key };
|
|
969
|
-
if (record)
|
|
970
|
-
body.record = record;
|
|
971
|
-
if (records)
|
|
972
|
-
body.records = records;
|
|
973
|
-
const res = await authedFetch("/upsert-record", body);
|
|
974
|
-
return textResult(res);
|
|
975
|
-
}));
|
|
976
957
|
server.tool("chaprola_consolidate", "Merge a .MRG file into its parent .DA, producing a clean sorted data file. Deletes .MRG and .IGN after success. Aborts if .MRG was modified during the operation.", {
|
|
977
958
|
project: z.string().describe("Project name"),
|
|
978
959
|
file: z.string().describe("Data file name (without extension)"),
|
|
@@ -1043,6 +1024,45 @@ server.tool("chaprola_app_upload", "Get a presigned URL to upload a single file
|
|
|
1043
1024
|
const res = await authedFetch("/app/upload", { userid: username, project, path });
|
|
1044
1025
|
return textResult(res);
|
|
1045
1026
|
}));
|
|
1027
|
+
server.tool("chaprola_app_upload_inline", "Upload a single file's contents inline (no presigned PUT, no curl step). Use this for hot-fixes to one HTML/JS/CSS file. Max 3 MB raw payload. For larger files, use chaprola_app_upload.", {
|
|
1028
|
+
project: z.string().describe("Project name for the app"),
|
|
1029
|
+
path: z.string().describe("File path within the app (e.g. 'css/app.css', 'results.html')"),
|
|
1030
|
+
content: z.string().describe("File contents. Plain text by default; pass encoding='base64' for binary files."),
|
|
1031
|
+
encoding: z.enum(["text", "base64"]).optional().describe("Content encoding: 'text' (default) or 'base64' for binary files"),
|
|
1032
|
+
content_type: z.string().optional().describe("MIME type override. Inferred from path extension if omitted."),
|
|
1033
|
+
userid: z.string().optional().describe("Project owner's username. Required when deploying to a shared project where you are a writer. Defaults to the authenticated user."),
|
|
1034
|
+
}, async ({ project, path, content, encoding, content_type, userid }) => withBaaCheck(async () => {
|
|
1035
|
+
const { username } = getCredentials();
|
|
1036
|
+
const body = {
|
|
1037
|
+
userid: userid || username,
|
|
1038
|
+
project,
|
|
1039
|
+
path,
|
|
1040
|
+
content,
|
|
1041
|
+
};
|
|
1042
|
+
if (encoding)
|
|
1043
|
+
body.encoding = encoding;
|
|
1044
|
+
if (content_type)
|
|
1045
|
+
body.content_type = content_type;
|
|
1046
|
+
const res = await authedFetch("/app/upload/inline", body);
|
|
1047
|
+
return textResult(res);
|
|
1048
|
+
}));
|
|
1049
|
+
server.tool("chaprola_app_deploy_inline", "Deploy a base64-encoded tar.gz or zip archive in one call — no presigned PUT, no curl step. Max 3 MB raw (~4 MB base64). For larger bundles use chaprola_app_deploy.", {
|
|
1050
|
+
project: z.string().describe("Project name for the app"),
|
|
1051
|
+
archive: z.string().describe("Base64-encoded tar.gz or zip archive of the app directory"),
|
|
1052
|
+
archive_format: z.enum(["tar.gz", "zip"]).optional().describe("Archive format. Auto-detected from magic bytes if omitted."),
|
|
1053
|
+
userid: z.string().optional().describe("Project owner's username. Required when deploying to a shared project where you are a writer. Defaults to the authenticated user."),
|
|
1054
|
+
}, async ({ project, archive, archive_format, userid }) => withBaaCheck(async () => {
|
|
1055
|
+
const { username } = getCredentials();
|
|
1056
|
+
const body = {
|
|
1057
|
+
userid: userid || username,
|
|
1058
|
+
project,
|
|
1059
|
+
archive,
|
|
1060
|
+
};
|
|
1061
|
+
if (archive_format)
|
|
1062
|
+
body.archive_format = archive_format;
|
|
1063
|
+
const res = await authedFetch("/app/deploy/inline", body);
|
|
1064
|
+
return textResult(res);
|
|
1065
|
+
}));
|
|
1046
1066
|
// --- Start server ---
|
|
1047
1067
|
async function main() {
|
|
1048
1068
|
const transport = new StdioServerTransport();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chaprola/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "MCP server for Chaprola — agent-first data platform. Gives AI agents tools for structured data storage, record CRUD, querying, schema inspection, documentation lookup, web search, URL fetching, scheduled jobs, scoped site keys, and execution via plain HTTP.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|