open-mcp-app 0.0.13 → 0.0.15
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/core/index.js +23 -11
- package/dist/core/index.js.map +1 -1
- package/dist/react/index.js +23 -11
- package/dist/react/index.js.map +1 -1
- package/dist/server/index.d.ts +448 -4
- package/dist/server/index.js +1036 -247
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
package/dist/server/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import * as express from 'express';
|
|
2
|
+
import express__default from 'express';
|
|
3
|
+
import { z } from 'zod';
|
|
3
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
5
|
import { CreateMessageRequestParams, CreateMessageResult, CreateMessageResultWithTools } from '@modelcontextprotocol/sdk/types.js';
|
|
5
6
|
|
|
@@ -320,6 +321,35 @@ interface TransportSessionInfo {
|
|
|
320
321
|
/** The transport type for this session */
|
|
321
322
|
transport: TransportType;
|
|
322
323
|
}
|
|
324
|
+
type ServerlessTransportMode = "stateful" | "stateless";
|
|
325
|
+
interface StateAdapter {
|
|
326
|
+
get: (instanceId: string) => Promise<unknown | undefined>;
|
|
327
|
+
set: (instanceId: string, state: unknown) => Promise<void>;
|
|
328
|
+
delete: (instanceId: string) => Promise<void>;
|
|
329
|
+
}
|
|
330
|
+
interface ServerlessAdapterOptions {
|
|
331
|
+
/**
|
|
332
|
+
* Controls whether MCP transport sessions are persisted between requests.
|
|
333
|
+
*
|
|
334
|
+
* - `"stateful"` keeps normal MCP session semantics and expects sticky routing.
|
|
335
|
+
* - `"stateless"` disables MCP transport session IDs so each request stands alone.
|
|
336
|
+
*
|
|
337
|
+
* For AWS Lambda and other serverless deployments, `"stateless"` is usually the
|
|
338
|
+
* safest default because requests may land on different warm instances.
|
|
339
|
+
*/
|
|
340
|
+
transportMode?: ServerlessTransportMode;
|
|
341
|
+
/**
|
|
342
|
+
* Enables JSON POST responses for stateless streamable-http mode.
|
|
343
|
+
* This avoids relying on SSE session continuity in serverless environments.
|
|
344
|
+
*/
|
|
345
|
+
enableJsonResponse?: boolean;
|
|
346
|
+
/**
|
|
347
|
+
* Optional backing store for `context.getState()` / `context.setState()`.
|
|
348
|
+
* This is only needed for tools that rely on server-side state across requests.
|
|
349
|
+
*/
|
|
350
|
+
stateAdapter?: StateAdapter;
|
|
351
|
+
}
|
|
352
|
+
type AwsLambdaHandler = (...args: unknown[]) => Promise<unknown>;
|
|
323
353
|
/**
|
|
324
354
|
* App configuration.
|
|
325
355
|
*/
|
|
@@ -614,12 +644,26 @@ declare class App {
|
|
|
614
644
|
* Get all resource definitions.
|
|
615
645
|
*/
|
|
616
646
|
getResourceDefinitions(): Map<string, ResourceDefinition>;
|
|
647
|
+
/**
|
|
648
|
+
* Get the Express application for serverless wrapping (e.g. Lambda).
|
|
649
|
+
* Does NOT start listening on a port.
|
|
650
|
+
*/
|
|
651
|
+
toExpressApp(options?: ServerlessAdapterOptions): express__default.Express;
|
|
652
|
+
toAwsLambda(options?: ServerlessAdapterOptions): AwsLambdaHandler;
|
|
617
653
|
/**
|
|
618
654
|
* Close a specific transport session.
|
|
619
655
|
*/
|
|
620
656
|
closeTransportSession(sessionId: string): boolean;
|
|
621
657
|
private getPort;
|
|
622
658
|
private getCallerDir;
|
|
659
|
+
private lambdaEventToRequest;
|
|
660
|
+
private handleLambdaHttpRequest;
|
|
661
|
+
private writeLambdaResponse;
|
|
662
|
+
private isStatelessTransport;
|
|
663
|
+
private getStateAdapter;
|
|
664
|
+
private loadInstanceState;
|
|
665
|
+
private persistInstanceState;
|
|
666
|
+
private deleteInstanceState;
|
|
623
667
|
/**
|
|
624
668
|
* Handle an MCP JSON-RPC request directly.
|
|
625
669
|
* Used for testing without starting a server.
|
|
@@ -786,6 +830,26 @@ declare function htmlLoader(htmlOrPath: string, basePath?: string): () => string
|
|
|
786
830
|
*/
|
|
787
831
|
declare function wrapServer<T extends McpServer>(server: T): T;
|
|
788
832
|
|
|
833
|
+
/**
|
|
834
|
+
* Storage RPC Client
|
|
835
|
+
*
|
|
836
|
+
* Provides storage operations via RPC to the Creature host.
|
|
837
|
+
* Used by experimental.ts to route KV and blob operations through the host
|
|
838
|
+
* instead of direct file I/O, ensuring consistent behavior for both local
|
|
839
|
+
* and hosted MCPs.
|
|
840
|
+
*/
|
|
841
|
+
|
|
842
|
+
interface KvSearchResult {
|
|
843
|
+
key: string;
|
|
844
|
+
snippet?: string;
|
|
845
|
+
score?: number;
|
|
846
|
+
}
|
|
847
|
+
interface VectorSearchResult {
|
|
848
|
+
key: string;
|
|
849
|
+
score: number;
|
|
850
|
+
metadata?: unknown;
|
|
851
|
+
}
|
|
852
|
+
|
|
789
853
|
/**
|
|
790
854
|
* Experimental Server APIs
|
|
791
855
|
*
|
|
@@ -801,7 +865,7 @@ declare function wrapServer<T extends McpServer>(server: T): T;
|
|
|
801
865
|
* import { exp } from "open-mcp-app/server";
|
|
802
866
|
*
|
|
803
867
|
* const dir = exp.getWritableDirectory();
|
|
804
|
-
*
|
|
868
|
+
* await exp.kvSet("key", "value");
|
|
805
869
|
* ```
|
|
806
870
|
*/
|
|
807
871
|
|
|
@@ -1032,6 +1096,348 @@ declare function experimental_rmdir(relativePath: string): Promise<void>;
|
|
|
1032
1096
|
* @throws Error if storage unavailable or path escapes sandbox
|
|
1033
1097
|
*/
|
|
1034
1098
|
declare function experimental_rmdirSync(relativePath: string): void;
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* Check if KV storage is available.
|
|
1102
|
+
*
|
|
1103
|
+
* Returns true if running inside Creature with storage enabled.
|
|
1104
|
+
* Use this to implement graceful fallbacks.
|
|
1105
|
+
*
|
|
1106
|
+
* @returns true if KV storage is available
|
|
1107
|
+
*
|
|
1108
|
+
* @example
|
|
1109
|
+
* ```typescript
|
|
1110
|
+
* import { experimental_kvIsAvailable } from "open-mcp-app/server";
|
|
1111
|
+
*
|
|
1112
|
+
* if (experimental_kvIsAvailable()) {
|
|
1113
|
+
* // Use persistent KV storage
|
|
1114
|
+
* } else {
|
|
1115
|
+
* // Fall back to in-memory storage
|
|
1116
|
+
* }
|
|
1117
|
+
* ```
|
|
1118
|
+
*/
|
|
1119
|
+
declare function experimental_kvIsAvailable(): boolean;
|
|
1120
|
+
/**
|
|
1121
|
+
* Get a value from the KV store.
|
|
1122
|
+
*
|
|
1123
|
+
* Uses RPC to communicate with the Creature host for storage operations.
|
|
1124
|
+
* This ensures consistent behavior for both local and hosted MCPs.
|
|
1125
|
+
*
|
|
1126
|
+
* @param key - The key to retrieve
|
|
1127
|
+
* @returns The value, or null if not found or storage unavailable
|
|
1128
|
+
*
|
|
1129
|
+
* @example
|
|
1130
|
+
* ```typescript
|
|
1131
|
+
* import { experimental_kvGet } from "open-mcp-app/server";
|
|
1132
|
+
*
|
|
1133
|
+
* const value = await experimental_kvGet("user:preferences");
|
|
1134
|
+
* if (value) {
|
|
1135
|
+
* const prefs = JSON.parse(value);
|
|
1136
|
+
* }
|
|
1137
|
+
* ```
|
|
1138
|
+
*/
|
|
1139
|
+
declare function experimental_kvGet(key: string): Promise<string | null>;
|
|
1140
|
+
/**
|
|
1141
|
+
* Get a value from the KV store synchronously.
|
|
1142
|
+
*
|
|
1143
|
+
* Note: Sync variants are not supported with RPC and will return null.
|
|
1144
|
+
* Use the async version for reliable cross-platform behavior.
|
|
1145
|
+
*
|
|
1146
|
+
* @param key - The key to retrieve
|
|
1147
|
+
* @returns The value, or null if not found or storage unavailable
|
|
1148
|
+
* @deprecated Use experimental_kvGet instead for cross-platform support
|
|
1149
|
+
*/
|
|
1150
|
+
declare function experimental_kvGetSync(key: string): string | null;
|
|
1151
|
+
/**
|
|
1152
|
+
* Set a value in the KV store.
|
|
1153
|
+
*
|
|
1154
|
+
* Uses RPC to communicate with the Creature host for storage operations.
|
|
1155
|
+
* This ensures consistent behavior for both local and hosted MCPs.
|
|
1156
|
+
*
|
|
1157
|
+
* @param key - The key to set
|
|
1158
|
+
* @param value - The value to store (string)
|
|
1159
|
+
* @returns true if successful, false if storage unavailable
|
|
1160
|
+
*
|
|
1161
|
+
* @example
|
|
1162
|
+
* ```typescript
|
|
1163
|
+
* import { experimental_kvSet } from "open-mcp-app/server";
|
|
1164
|
+
*
|
|
1165
|
+
* await experimental_kvSet("user:preferences", JSON.stringify(prefs));
|
|
1166
|
+
* ```
|
|
1167
|
+
*/
|
|
1168
|
+
declare function experimental_kvSet(key: string, value: string): Promise<boolean>;
|
|
1169
|
+
/**
|
|
1170
|
+
* Set a value in the KV store synchronously.
|
|
1171
|
+
*
|
|
1172
|
+
* Note: Sync variants are not supported with RPC and will return false.
|
|
1173
|
+
* Use the async version for reliable cross-platform behavior.
|
|
1174
|
+
*
|
|
1175
|
+
* @param key - The key to set
|
|
1176
|
+
* @param value - The value to store (string)
|
|
1177
|
+
* @returns true if successful, false if storage unavailable
|
|
1178
|
+
* @deprecated Use experimental_kvSet instead for cross-platform support
|
|
1179
|
+
*/
|
|
1180
|
+
declare function experimental_kvSetSync(key: string, value: string): boolean;
|
|
1181
|
+
/**
|
|
1182
|
+
* Delete a key from the KV store.
|
|
1183
|
+
*
|
|
1184
|
+
* Uses RPC to communicate with the Creature host for storage operations.
|
|
1185
|
+
* This ensures consistent behavior for both local and hosted MCPs.
|
|
1186
|
+
*
|
|
1187
|
+
* @param key - The key to delete
|
|
1188
|
+
* @returns true if the key existed and was deleted, false otherwise
|
|
1189
|
+
*
|
|
1190
|
+
* @example
|
|
1191
|
+
* ```typescript
|
|
1192
|
+
* import { experimental_kvDelete } from "open-mcp-app/server";
|
|
1193
|
+
*
|
|
1194
|
+
* const deleted = await experimental_kvDelete("user:preferences");
|
|
1195
|
+
* ```
|
|
1196
|
+
*/
|
|
1197
|
+
declare function experimental_kvDelete(key: string): Promise<boolean>;
|
|
1198
|
+
/**
|
|
1199
|
+
* Delete a key from the KV store synchronously.
|
|
1200
|
+
*
|
|
1201
|
+
* Note: Sync variants are not supported with RPC and will return false.
|
|
1202
|
+
* Use the async version for reliable cross-platform behavior.
|
|
1203
|
+
*
|
|
1204
|
+
* @param key - The key to delete
|
|
1205
|
+
* @returns true if the key existed and was deleted, false otherwise
|
|
1206
|
+
* @deprecated Use experimental_kvDelete instead for cross-platform support
|
|
1207
|
+
*/
|
|
1208
|
+
declare function experimental_kvDeleteSync(key: string): boolean;
|
|
1209
|
+
/**
|
|
1210
|
+
* List keys in the KV store.
|
|
1211
|
+
*
|
|
1212
|
+
* Uses RPC to communicate with the Creature host for storage operations.
|
|
1213
|
+
* This ensures consistent behavior for both local and hosted MCPs.
|
|
1214
|
+
*
|
|
1215
|
+
* @param prefix - Optional prefix to filter keys
|
|
1216
|
+
* @returns Array of matching keys, or null if storage unavailable
|
|
1217
|
+
*
|
|
1218
|
+
* @example
|
|
1219
|
+
* ```typescript
|
|
1220
|
+
* import { experimental_kvList } from "open-mcp-app/server";
|
|
1221
|
+
*
|
|
1222
|
+
* const userKeys = await experimental_kvList("user:");
|
|
1223
|
+
* ```
|
|
1224
|
+
*/
|
|
1225
|
+
declare function experimental_kvList(prefix?: string): Promise<string[] | null>;
|
|
1226
|
+
/**
|
|
1227
|
+
* List key-value pairs from the KV store.
|
|
1228
|
+
*
|
|
1229
|
+
* This is more efficient than calling kvList + kvGet for each key,
|
|
1230
|
+
* as it fetches all data in a single RPC call.
|
|
1231
|
+
*
|
|
1232
|
+
* @param prefix - Optional prefix to filter keys
|
|
1233
|
+
* @returns Array of key-value pairs, or null if storage unavailable
|
|
1234
|
+
*
|
|
1235
|
+
* @example
|
|
1236
|
+
* ```typescript
|
|
1237
|
+
* import { exp } from "open-mcp-app/server";
|
|
1238
|
+
*
|
|
1239
|
+
* const entries = await exp.kvListWithValues("todos:");
|
|
1240
|
+
* for (const { key, value } of entries ?? []) {
|
|
1241
|
+
* console.log(key, JSON.parse(value));
|
|
1242
|
+
* }
|
|
1243
|
+
* ```
|
|
1244
|
+
*/
|
|
1245
|
+
declare function experimental_kvListWithValues(prefix?: string): Promise<Array<{
|
|
1246
|
+
key: string;
|
|
1247
|
+
value: string;
|
|
1248
|
+
}> | null>;
|
|
1249
|
+
/**
|
|
1250
|
+
* List keys in the KV store synchronously.
|
|
1251
|
+
*
|
|
1252
|
+
* Note: Sync variants are not supported with RPC and will return null.
|
|
1253
|
+
* Use the async version for reliable cross-platform behavior.
|
|
1254
|
+
*
|
|
1255
|
+
* @param prefix - Optional prefix to filter keys
|
|
1256
|
+
* @returns Array of matching keys, or null if storage unavailable
|
|
1257
|
+
* @deprecated Use experimental_kvList instead for cross-platform support
|
|
1258
|
+
*/
|
|
1259
|
+
declare function experimental_kvListSync(prefix?: string): string[] | null;
|
|
1260
|
+
/**
|
|
1261
|
+
* Search values in the KV store using full-text search.
|
|
1262
|
+
*
|
|
1263
|
+
* Uses SQLite FTS5 on the Creature host for efficient full-text search.
|
|
1264
|
+
* Returns results ranked by relevance with optional snippets.
|
|
1265
|
+
*
|
|
1266
|
+
* @param query - The search query (uses SQLite FTS5 syntax)
|
|
1267
|
+
* @param options - Search options
|
|
1268
|
+
* @param options.prefix - Optional key prefix to filter results
|
|
1269
|
+
* @param options.limit - Maximum number of results (default 50, max 100)
|
|
1270
|
+
* @returns Array of search results, or null if storage unavailable
|
|
1271
|
+
*
|
|
1272
|
+
* @example
|
|
1273
|
+
* ```typescript
|
|
1274
|
+
* import { experimental_kvSearch } from "open-mcp-app/server";
|
|
1275
|
+
*
|
|
1276
|
+
* // Search for notes containing "meeting"
|
|
1277
|
+
* const results = await experimental_kvSearch("meeting");
|
|
1278
|
+
*
|
|
1279
|
+
* // Search with prefix filter
|
|
1280
|
+
* const todoResults = await experimental_kvSearch("urgent", { prefix: "todos:" });
|
|
1281
|
+
*
|
|
1282
|
+
* for (const result of results ?? []) {
|
|
1283
|
+
* console.log(result.key, result.snippet, result.score);
|
|
1284
|
+
* }
|
|
1285
|
+
* ```
|
|
1286
|
+
*/
|
|
1287
|
+
declare function experimental_kvSearch(query: string, options?: {
|
|
1288
|
+
prefix?: string;
|
|
1289
|
+
limit?: number;
|
|
1290
|
+
}): Promise<KvSearchResult[] | null>;
|
|
1291
|
+
declare function experimental_vectorIsAvailable(): boolean;
|
|
1292
|
+
declare function experimental_vectorUpsert(key: string, text: string, metadata?: unknown): Promise<boolean>;
|
|
1293
|
+
declare function experimental_vectorSearch(query: string, options?: {
|
|
1294
|
+
prefix?: string;
|
|
1295
|
+
limit?: number;
|
|
1296
|
+
}): Promise<VectorSearchResult[] | null>;
|
|
1297
|
+
declare function experimental_vectorDelete(key: string): Promise<boolean>;
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* Check if blob storage is available.
|
|
1301
|
+
*
|
|
1302
|
+
* Returns true if running inside Creature with storage enabled.
|
|
1303
|
+
* Use this to implement graceful fallbacks.
|
|
1304
|
+
*
|
|
1305
|
+
* @returns true if blob storage is available
|
|
1306
|
+
*/
|
|
1307
|
+
declare function experimental_blobIsAvailable(): boolean;
|
|
1308
|
+
/**
|
|
1309
|
+
* Store a blob.
|
|
1310
|
+
*
|
|
1311
|
+
* Uses RPC to communicate with the Creature host for storage operations.
|
|
1312
|
+
* This ensures consistent behavior for both local and hosted MCPs.
|
|
1313
|
+
*
|
|
1314
|
+
* @param name - The blob name (acts as a path within the blobs directory)
|
|
1315
|
+
* @param data - The blob data as a Buffer or Uint8Array
|
|
1316
|
+
* @param mimeType - Optional MIME type metadata
|
|
1317
|
+
* @returns Object with success and size, or null if storage unavailable
|
|
1318
|
+
*
|
|
1319
|
+
* @example
|
|
1320
|
+
* ```typescript
|
|
1321
|
+
* import { experimental_blobPut } from "open-mcp-app/server";
|
|
1322
|
+
*
|
|
1323
|
+
* const imageData = fs.readFileSync("image.png");
|
|
1324
|
+
* await experimental_blobPut("images/photo.png", imageData, "image/png");
|
|
1325
|
+
* ```
|
|
1326
|
+
*/
|
|
1327
|
+
declare function experimental_blobPut(name: string, data: Buffer | Uint8Array, mimeType?: string): Promise<{
|
|
1328
|
+
success: true;
|
|
1329
|
+
size: number;
|
|
1330
|
+
} | null>;
|
|
1331
|
+
/**
|
|
1332
|
+
* Store a blob synchronously.
|
|
1333
|
+
*
|
|
1334
|
+
* Note: Sync variants are not supported with RPC and will return null.
|
|
1335
|
+
* Use the async version for reliable cross-platform behavior.
|
|
1336
|
+
*
|
|
1337
|
+
* @param name - The blob name
|
|
1338
|
+
* @param data - The blob data
|
|
1339
|
+
* @param mimeType - Optional MIME type metadata
|
|
1340
|
+
* @returns Object with success and size, or null if storage unavailable
|
|
1341
|
+
* @deprecated Use experimental_blobPut instead for cross-platform support
|
|
1342
|
+
*/
|
|
1343
|
+
declare function experimental_blobPutSync(name: string, data: Buffer | Uint8Array, mimeType?: string): {
|
|
1344
|
+
success: true;
|
|
1345
|
+
size: number;
|
|
1346
|
+
} | null;
|
|
1347
|
+
/**
|
|
1348
|
+
* Retrieve a blob.
|
|
1349
|
+
*
|
|
1350
|
+
* Uses RPC to communicate with the Creature host for storage operations.
|
|
1351
|
+
* This ensures consistent behavior for both local and hosted MCPs.
|
|
1352
|
+
*
|
|
1353
|
+
* @param name - The blob name
|
|
1354
|
+
* @returns Object with data and optional mimeType, or null if not found
|
|
1355
|
+
*
|
|
1356
|
+
* @example
|
|
1357
|
+
* ```typescript
|
|
1358
|
+
* import { experimental_blobGet } from "open-mcp-app/server";
|
|
1359
|
+
*
|
|
1360
|
+
* const result = await experimental_blobGet("images/photo.png");
|
|
1361
|
+
* if (result) {
|
|
1362
|
+
* // result.data is a Buffer
|
|
1363
|
+
* // result.mimeType is optional string
|
|
1364
|
+
* }
|
|
1365
|
+
* ```
|
|
1366
|
+
*/
|
|
1367
|
+
declare function experimental_blobGet(name: string): Promise<{
|
|
1368
|
+
data: Buffer;
|
|
1369
|
+
mimeType?: string;
|
|
1370
|
+
} | null>;
|
|
1371
|
+
/**
|
|
1372
|
+
* Retrieve a blob synchronously.
|
|
1373
|
+
*
|
|
1374
|
+
* Note: Sync variants are not supported with RPC and will return null.
|
|
1375
|
+
* Use the async version for reliable cross-platform behavior.
|
|
1376
|
+
*
|
|
1377
|
+
* @param name - The blob name
|
|
1378
|
+
* @returns Object with data and optional mimeType, or null if not found
|
|
1379
|
+
* @deprecated Use experimental_blobGet instead for cross-platform support
|
|
1380
|
+
*/
|
|
1381
|
+
declare function experimental_blobGetSync(name: string): {
|
|
1382
|
+
data: Buffer;
|
|
1383
|
+
mimeType?: string;
|
|
1384
|
+
} | null;
|
|
1385
|
+
/**
|
|
1386
|
+
* Delete a blob.
|
|
1387
|
+
*
|
|
1388
|
+
* Uses RPC to communicate with the Creature host for storage operations.
|
|
1389
|
+
* This ensures consistent behavior for both local and hosted MCPs.
|
|
1390
|
+
*
|
|
1391
|
+
* @param name - The blob name
|
|
1392
|
+
* @returns true if deleted, false if not found or storage unavailable
|
|
1393
|
+
*
|
|
1394
|
+
* @example
|
|
1395
|
+
* ```typescript
|
|
1396
|
+
* import { experimental_blobDelete } from "open-mcp-app/server";
|
|
1397
|
+
*
|
|
1398
|
+
* await experimental_blobDelete("images/old-photo.png");
|
|
1399
|
+
* ```
|
|
1400
|
+
*/
|
|
1401
|
+
declare function experimental_blobDelete(name: string): Promise<boolean>;
|
|
1402
|
+
/**
|
|
1403
|
+
* Delete a blob synchronously.
|
|
1404
|
+
*
|
|
1405
|
+
* Note: Sync variants are not supported with RPC and will return false.
|
|
1406
|
+
* Use the async version for reliable cross-platform behavior.
|
|
1407
|
+
*
|
|
1408
|
+
* @param name - The blob name
|
|
1409
|
+
* @returns true if deleted, false if not found or storage unavailable
|
|
1410
|
+
* @deprecated Use experimental_blobDelete instead for cross-platform support
|
|
1411
|
+
*/
|
|
1412
|
+
declare function experimental_blobDeleteSync(name: string): boolean;
|
|
1413
|
+
/**
|
|
1414
|
+
* List blobs.
|
|
1415
|
+
*
|
|
1416
|
+
* Uses RPC to communicate with the Creature host for storage operations.
|
|
1417
|
+
* This ensures consistent behavior for both local and hosted MCPs.
|
|
1418
|
+
*
|
|
1419
|
+
* @param prefix - Optional prefix to filter blob names
|
|
1420
|
+
* @returns Array of blob names, or null if storage unavailable
|
|
1421
|
+
*
|
|
1422
|
+
* @example
|
|
1423
|
+
* ```typescript
|
|
1424
|
+
* import { experimental_blobList } from "open-mcp-app/server";
|
|
1425
|
+
*
|
|
1426
|
+
* const images = await experimental_blobList("images/");
|
|
1427
|
+
* ```
|
|
1428
|
+
*/
|
|
1429
|
+
declare function experimental_blobList(prefix?: string): Promise<string[] | null>;
|
|
1430
|
+
/**
|
|
1431
|
+
* List blobs synchronously.
|
|
1432
|
+
*
|
|
1433
|
+
* Note: Sync variants are not supported with RPC and will return null.
|
|
1434
|
+
* Use the async version for reliable cross-platform behavior.
|
|
1435
|
+
*
|
|
1436
|
+
* @param prefix - Optional prefix to filter blob names
|
|
1437
|
+
* @returns Array of blob names, or null if storage unavailable
|
|
1438
|
+
* @deprecated Use experimental_blobList instead for cross-platform support
|
|
1439
|
+
*/
|
|
1440
|
+
declare function experimental_blobListSync(prefix?: string): string[] | null;
|
|
1035
1441
|
declare function experimental_sampleMessage(params: CreateMessageRequestParams): Promise<CreateMessageResult | CreateMessageResultWithTools>;
|
|
1036
1442
|
/**
|
|
1037
1443
|
* Experimental APIs namespace.
|
|
@@ -1044,7 +1450,13 @@ declare function experimental_sampleMessage(params: CreateMessageRequestParams):
|
|
|
1044
1450
|
* import { exp } from "open-mcp-app/server";
|
|
1045
1451
|
*
|
|
1046
1452
|
* // Environment
|
|
1047
|
-
*
|
|
1453
|
+
* if (exp.isCreatureHost()) {
|
|
1454
|
+
* const dir = exp.getWritableDirectory();
|
|
1455
|
+
* }
|
|
1456
|
+
*
|
|
1457
|
+
* // KV Store
|
|
1458
|
+
* await exp.kvSet("user:prefs", JSON.stringify(prefs));
|
|
1459
|
+
* const value = await exp.kvGet("user:prefs");
|
|
1048
1460
|
*
|
|
1049
1461
|
* // File I/O
|
|
1050
1462
|
* await exp.writeFile("config.json", JSON.stringify(config));
|
|
@@ -1069,7 +1481,39 @@ declare const exp: {
|
|
|
1069
1481
|
mkdirSync: typeof experimental_mkdirSync;
|
|
1070
1482
|
readdirSync: typeof experimental_readdirSync;
|
|
1071
1483
|
rmdirSync: typeof experimental_rmdirSync;
|
|
1484
|
+
kvIsAvailable: typeof experimental_kvIsAvailable;
|
|
1485
|
+
kvGet: typeof experimental_kvGet;
|
|
1486
|
+
kvSet: typeof experimental_kvSet;
|
|
1487
|
+
kvDelete: typeof experimental_kvDelete;
|
|
1488
|
+
kvList: typeof experimental_kvList;
|
|
1489
|
+
kvListWithValues: typeof experimental_kvListWithValues;
|
|
1490
|
+
kvSearch: typeof experimental_kvSearch;
|
|
1491
|
+
vectorIsAvailable: typeof experimental_vectorIsAvailable;
|
|
1492
|
+
vectorUpsert: typeof experimental_vectorUpsert;
|
|
1493
|
+
vectorSearch: typeof experimental_vectorSearch;
|
|
1494
|
+
vectorDelete: typeof experimental_vectorDelete;
|
|
1495
|
+
/** @deprecated Use kvGet instead */
|
|
1496
|
+
kvGetSync: typeof experimental_kvGetSync;
|
|
1497
|
+
/** @deprecated Use kvSet instead */
|
|
1498
|
+
kvSetSync: typeof experimental_kvSetSync;
|
|
1499
|
+
/** @deprecated Use kvDelete instead */
|
|
1500
|
+
kvDeleteSync: typeof experimental_kvDeleteSync;
|
|
1501
|
+
/** @deprecated Use kvList instead */
|
|
1502
|
+
kvListSync: typeof experimental_kvListSync;
|
|
1503
|
+
blobIsAvailable: typeof experimental_blobIsAvailable;
|
|
1504
|
+
blobPut: typeof experimental_blobPut;
|
|
1505
|
+
blobGet: typeof experimental_blobGet;
|
|
1506
|
+
blobDelete: typeof experimental_blobDelete;
|
|
1507
|
+
blobList: typeof experimental_blobList;
|
|
1508
|
+
/** @deprecated Use blobPut instead */
|
|
1509
|
+
blobPutSync: typeof experimental_blobPutSync;
|
|
1510
|
+
/** @deprecated Use blobGet instead */
|
|
1511
|
+
blobGetSync: typeof experimental_blobGetSync;
|
|
1512
|
+
/** @deprecated Use blobDelete instead */
|
|
1513
|
+
blobDeleteSync: typeof experimental_blobDeleteSync;
|
|
1514
|
+
/** @deprecated Use blobList instead */
|
|
1515
|
+
blobListSync: typeof experimental_blobListSync;
|
|
1072
1516
|
sampleMessage: typeof experimental_sampleMessage;
|
|
1073
1517
|
};
|
|
1074
1518
|
|
|
1075
|
-
export { App, type AppConfig, type DisplayMode, type IconConfig, type InstanceDestroyContext, MIME_TYPES, type ResourceConfig, type ServerLogLevel, type ServerLogger, type ToolAnnotations, type ToolCallInfo, type ToolCallResultInfo, type ToolConfig, type ToolContext, type ToolHandler, type ToolResult, type ToolVisibility, type TransportSessionInfo, type TransportType, type WebSocketConnection, createApp, exp, experimental_deleteFile, experimental_deleteFileSync, experimental_exists, experimental_existsSync, experimental_getProjectId, experimental_getServerName, experimental_getWritableDirectory, experimental_mkdir, experimental_mkdirSync, experimental_readFile, experimental_readFileSync, experimental_readdir, experimental_readdirSync, experimental_rmdir, experimental_rmdirSync, experimental_sampleMessage, experimental_writeFile, experimental_writeFileSync, htmlLoader, isHtmlContent, loadHtml, svgToDataUri, wrapServer };
|
|
1519
|
+
export { App, type AppConfig, type AwsLambdaHandler, type DisplayMode, type IconConfig, type InstanceDestroyContext, type KvSearchResult, MIME_TYPES, type ResourceConfig, type ServerLogLevel, type ServerLogger, type ServerlessAdapterOptions, type ServerlessTransportMode, type StateAdapter, type ToolAnnotations, type ToolCallInfo, type ToolCallResultInfo, type ToolConfig, type ToolContext, type ToolHandler, type ToolResult, type ToolVisibility, type TransportSessionInfo, type TransportType, type VectorSearchResult, type WebSocketConnection, createApp, exp, experimental_blobDelete, experimental_blobDeleteSync, experimental_blobGet, experimental_blobGetSync, experimental_blobIsAvailable, experimental_blobList, experimental_blobListSync, experimental_blobPut, experimental_blobPutSync, experimental_deleteFile, experimental_deleteFileSync, experimental_exists, experimental_existsSync, experimental_getProjectId, experimental_getServerName, experimental_getWritableDirectory, experimental_kvDelete, experimental_kvDeleteSync, experimental_kvGet, experimental_kvGetSync, experimental_kvIsAvailable, experimental_kvList, experimental_kvListSync, experimental_kvSearch, experimental_kvSet, experimental_kvSetSync, experimental_mkdir, experimental_mkdirSync, experimental_readFile, experimental_readFileSync, experimental_readdir, experimental_readdirSync, experimental_rmdir, experimental_rmdirSync, experimental_sampleMessage, experimental_vectorDelete, experimental_vectorIsAvailable, experimental_vectorSearch, experimental_vectorUpsert, experimental_writeFile, experimental_writeFileSync, htmlLoader, isHtmlContent, loadHtml, svgToDataUri, wrapServer };
|