@agenticmail/mcp 0.5.40 → 0.5.42

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.
Files changed (2) hide show
  1. package/dist/index.js +148 -0
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -934,6 +934,50 @@ var toolDefinitions = [
934
934
  required: ["emailBody"]
935
935
  }
936
936
  },
937
+ {
938
+ name: "storage",
939
+ description: "Full database management system for agents. 28 actions: DDL (create/alter/drop/clone/rename tables & columns), DML (insert/upsert/query/aggregate/update/delete/truncate), indexing (create/list/drop/reindex), import/export (JSON/CSV, conflict handling), raw SQL, maintenance (stats/vacuum/analyze/explain), archiving. WHERE supports operators: $gt, $gte, $lt, $lte, $ne, $like, $ilike, $in, $not_in, $is_null, $between. Works on SQLite, Postgres, MySQL, Turso.",
940
+ inputSchema: {
941
+ type: "object",
942
+ properties: {
943
+ action: { type: "string", description: "create_table, list_tables, describe_table, insert, upsert, query, aggregate, update, delete_rows, truncate, drop_table, clone_table, rename_table, rename_column, add_column, drop_column, create_index, list_indexes, drop_index, reindex, archive_table, unarchive_table, export, import, sql, stats, vacuum, analyze, explain" },
944
+ table: { type: "string", description: "Table name" },
945
+ description: { type: "string", description: "For create_table: human-readable description" },
946
+ columns: { type: "array", description: "For create_table: [{name, type, required?, default?, unique?, primaryKey?, references?: {table, column, onDelete?}, check?}]" },
947
+ indexes: { type: "array", description: "For create_table: [{columns, unique?, name?, where?}]" },
948
+ shared: { type: "boolean", description: "For create_table: shared across agents" },
949
+ timestamps: { type: "boolean", description: "For create_table: auto-add created_at/updated_at (default: true)" },
950
+ rows: { type: "array", description: "For insert/upsert/import: row objects" },
951
+ where: { type: "object", description: "Filter conditions with operator support" },
952
+ set: { type: "object", description: "For update: {column: newValue}" },
953
+ orderBy: { type: "string", description: "ORDER BY clause" },
954
+ limit: { type: "number", description: "Max rows" },
955
+ offset: { type: "number", description: "Skip rows" },
956
+ selectColumns: { type: "array", description: "Specific columns to select" },
957
+ distinct: { type: "boolean", description: "SELECT DISTINCT" },
958
+ groupBy: { type: "string", description: "GROUP BY clause" },
959
+ having: { type: "string", description: "HAVING clause" },
960
+ operations: { type: "array", description: "For aggregate: [{fn: count|sum|avg|min|max|count_distinct, column?, alias?}]" },
961
+ column: { type: "object", description: "For add_column: {name, type, ...}" },
962
+ columnName: { type: "string", description: "For drop_column" },
963
+ indexName: { type: "string", description: "For create/drop_index" },
964
+ indexColumns: { type: "array", description: "For create_index" },
965
+ indexUnique: { type: "boolean", description: "For create_index" },
966
+ indexWhere: { type: "string", description: "Partial index condition" },
967
+ newName: { type: "string", description: "For rename_table/rename_column/clone_table" },
968
+ oldName: { type: "string", description: "For rename_column" },
969
+ conflictColumn: { type: "string", description: "For upsert/import" },
970
+ onConflict: { type: "string", description: "For import: skip|replace|error" },
971
+ includeData: { type: "boolean", description: "For clone_table" },
972
+ format: { type: "string", description: "For export: json|csv" },
973
+ sql: { type: "string", description: "For sql/explain: raw SQL" },
974
+ params: { type: "array", description: "For sql/explain: query params" },
975
+ includeShared: { type: "boolean", description: "For list_tables" },
976
+ includeArchived: { type: "boolean", description: "For list_tables" }
977
+ },
978
+ required: ["action"]
979
+ }
980
+ },
937
981
  {
938
982
  name: "sms_config",
939
983
  description: "Get the current SMS/phone number configuration for this agent. Shows whether SMS is enabled, the phone number, and forwarding email.",
@@ -2085,6 +2129,110 @@ ${result.summary}`);
2085
2129
  });
2086
2130
  return JSON.stringify(result, null, 2);
2087
2131
  }
2132
+ case "storage": {
2133
+ const act = args.action;
2134
+ const tbl = args.table ? encodeURIComponent(args.table) : "";
2135
+ let result;
2136
+ switch (act) {
2137
+ // DDL
2138
+ case "create_table":
2139
+ result = await apiRequest("POST", "/storage/tables", { name: args.table, columns: args.columns, indexes: args.indexes, shared: args.shared, description: args.description, timestamps: args.timestamps });
2140
+ break;
2141
+ case "list_tables":
2142
+ result = await apiRequest("GET", `/storage/tables?includeShared=${args.includeShared !== false}&includeArchived=${args.includeArchived === true}`);
2143
+ break;
2144
+ case "describe_table":
2145
+ result = await apiRequest("GET", `/storage/tables/${tbl}/describe`);
2146
+ break;
2147
+ case "add_column":
2148
+ result = await apiRequest("POST", `/storage/tables/${tbl}/columns`, { column: args.column });
2149
+ break;
2150
+ case "drop_column":
2151
+ result = await apiRequest("DELETE", `/storage/tables/${tbl}/columns/${encodeURIComponent(args.columnName)}`);
2152
+ break;
2153
+ case "rename_table":
2154
+ result = await apiRequest("POST", `/storage/tables/${tbl}/rename`, { newName: args.newName });
2155
+ break;
2156
+ case "rename_column":
2157
+ result = await apiRequest("POST", `/storage/tables/${tbl}/rename-column`, { oldName: args.oldName, newName: args.newName });
2158
+ break;
2159
+ case "drop_table":
2160
+ result = await apiRequest("DELETE", `/storage/tables/${tbl}`);
2161
+ break;
2162
+ case "clone_table":
2163
+ result = await apiRequest("POST", `/storage/tables/${tbl}/clone`, { newName: args.newName, includeData: args.includeData });
2164
+ break;
2165
+ case "truncate":
2166
+ result = await apiRequest("POST", `/storage/tables/${tbl}/truncate`);
2167
+ break;
2168
+ // Indexes
2169
+ case "create_index":
2170
+ result = await apiRequest("POST", `/storage/tables/${tbl}/indexes`, { columns: args.indexColumns || args.columns, unique: args.indexUnique, name: args.indexName, where: args.indexWhere });
2171
+ break;
2172
+ case "list_indexes":
2173
+ result = await apiRequest("GET", `/storage/tables/${tbl}/indexes`);
2174
+ break;
2175
+ case "drop_index":
2176
+ result = await apiRequest("DELETE", `/storage/tables/${tbl}/indexes/${encodeURIComponent(args.indexName)}`);
2177
+ break;
2178
+ case "reindex":
2179
+ result = await apiRequest("POST", `/storage/tables/${tbl}/reindex`);
2180
+ break;
2181
+ // DML
2182
+ case "insert":
2183
+ result = await apiRequest("POST", "/storage/insert", { table: args.table, rows: args.rows });
2184
+ break;
2185
+ case "upsert":
2186
+ result = await apiRequest("POST", "/storage/upsert", { table: args.table, rows: args.rows, conflictColumn: args.conflictColumn });
2187
+ break;
2188
+ case "query":
2189
+ result = await apiRequest("POST", "/storage/query", { table: args.table, where: args.where, orderBy: args.orderBy, limit: args.limit, offset: args.offset, columns: args.selectColumns, distinct: args.distinct, groupBy: args.groupBy, having: args.having });
2190
+ break;
2191
+ case "aggregate":
2192
+ result = await apiRequest("POST", "/storage/aggregate", { table: args.table, where: args.where, operations: args.operations, groupBy: args.groupBy });
2193
+ break;
2194
+ case "update":
2195
+ result = await apiRequest("POST", "/storage/update", { table: args.table, where: args.where, set: args.set });
2196
+ break;
2197
+ case "delete_rows":
2198
+ result = await apiRequest("POST", "/storage/delete-rows", { table: args.table, where: args.where });
2199
+ break;
2200
+ // Archive
2201
+ case "archive_table":
2202
+ result = await apiRequest("POST", `/storage/tables/${tbl}/archive`);
2203
+ break;
2204
+ case "unarchive_table":
2205
+ result = await apiRequest("POST", `/storage/tables/${tbl}/unarchive`);
2206
+ break;
2207
+ // Import/Export
2208
+ case "export":
2209
+ result = await apiRequest("POST", `/storage/tables/${tbl}/export`, { format: args.format, where: args.where, limit: args.limit });
2210
+ break;
2211
+ case "import":
2212
+ result = await apiRequest("POST", `/storage/tables/${tbl}/import`, { rows: args.rows, onConflict: args.onConflict, conflictColumn: args.conflictColumn });
2213
+ break;
2214
+ // Raw SQL
2215
+ case "sql":
2216
+ result = await apiRequest("POST", "/storage/sql", { sql: args.sql, params: args.params });
2217
+ break;
2218
+ case "explain":
2219
+ result = await apiRequest("POST", "/storage/explain", { sql: args.sql, params: args.params });
2220
+ break;
2221
+ // Maintenance
2222
+ case "stats":
2223
+ result = await apiRequest("GET", "/storage/stats");
2224
+ break;
2225
+ case "vacuum":
2226
+ result = await apiRequest("POST", "/storage/vacuum");
2227
+ break;
2228
+ case "analyze":
2229
+ result = await apiRequest("POST", `/storage/tables/${tbl}/analyze`);
2230
+ break;
2231
+ default:
2232
+ result = { error: `Unknown action "${act}". 28 actions available: create_table, list_tables, describe_table, insert, upsert, query, aggregate, update, delete_rows, truncate, drop_table, clone_table, rename_table, rename_column, add_column, drop_column, create_index, list_indexes, drop_index, reindex, archive_table, unarchive_table, export, import, sql, stats, vacuum, analyze, explain` };
2233
+ }
2234
+ return JSON.stringify(result, null, 2);
2235
+ }
2088
2236
  case "sms_config": {
2089
2237
  const result = await apiRequest("GET", "/sms/config");
2090
2238
  return JSON.stringify(result, null, 2);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agenticmail/mcp",
3
- "version": "0.5.40",
4
- "description": "MCP server for AgenticMail \u2014 give any AI client real email and SMS capabilities",
3
+ "version": "0.5.42",
4
+ "description": "MCP server for AgenticMail give any AI client real email and SMS capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -63,4 +63,4 @@
63
63
  },
64
64
  "author": "Ope Olatunji",
65
65
  "license": "MIT"
66
- }
66
+ }