@fil-b/foc-storage-mcp 0.1.1 → 0.1.2
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/mcp-server.js +8 -3
- package/package.json +1 -1
package/dist/mcp-server.js
CHANGED
|
@@ -404,7 +404,9 @@ var getDatasets = async (withCDN = false, includeAll = false, onlyDatasetId = vo
|
|
|
404
404
|
if (dataset.withCDN) {
|
|
405
405
|
return `https://${userAddress}.calibration.filbeam.io/${pieceCid}`;
|
|
406
406
|
} else {
|
|
407
|
-
|
|
407
|
+
const endsWithSlash = serviceURL.endsWith("/");
|
|
408
|
+
const serviceURLWithoutSlash = endsWithSlash ? serviceURL.slice(0, -1) : serviceURL;
|
|
409
|
+
return `${serviceURLWithoutSlash}/piece/${pieceCid}`;
|
|
408
410
|
}
|
|
409
411
|
};
|
|
410
412
|
const datasetSizeInfo = data.pieces.reduce((acc, piece) => {
|
|
@@ -716,7 +718,10 @@ var uploadFile = createTool2({
|
|
|
716
718
|
if (context.withCDN) {
|
|
717
719
|
return `https://${await synapse.getSigner().getAddress()}.calibration.filbeam.io/${pieceCid2}`;
|
|
718
720
|
} else {
|
|
719
|
-
|
|
721
|
+
const serviceURL = (await storageService.getProviderInfo()).products.PDP?.data.serviceURL || "";
|
|
722
|
+
const endsWithSlash = serviceURL.endsWith("/");
|
|
723
|
+
const serviceURLWithoutSlash = endsWithSlash ? serviceURL.slice(0, -1) : serviceURL;
|
|
724
|
+
return `${serviceURLWithoutSlash}/piece/${pieceCid2}`;
|
|
720
725
|
}
|
|
721
726
|
};
|
|
722
727
|
const retrievalUrl = await getRetrievalUrl(pieceCid.toV1().toString());
|
|
@@ -1352,7 +1357,7 @@ var focStorageResources = {
|
|
|
1352
1357
|
// src/mastra/index.ts
|
|
1353
1358
|
var mcpServer = new MCPServer({
|
|
1354
1359
|
name: "FOC Storage MCP",
|
|
1355
|
-
version: "0.1.
|
|
1360
|
+
version: "0.1.1",
|
|
1356
1361
|
description: "Professional-grade MCP server for decentralized file storage on Filecoin Onchain Cloud. Powered by the FOC-Synapse SDK, this server provides AI agents with seamless access to Filecoin's distributed storage network. Upload files with automatic payment handling, organize content in datasets, monitor storage balances, and manage providers - all through intuitive MCP tools. Supports both standard storage and CDN-enabled fast retrieval. Perfect for building AI applications that need persistent, censorship-resistant storage.",
|
|
1357
1362
|
tools: focStorageTools,
|
|
1358
1363
|
repository: {
|