Storacha MCP 存储服务器
Storacha 热存储的模型上下文协议 (MCP) 服务器实现,允许 AI 应用程序通过标准化接口存储和检索文件。它使用 IPFS 和 CID 实现去信任化、去中心化的数据交换,确保数据主权、可验证性以及与代理框架和 AI 系统的无缝集成。
免费存储选项开始🚀
立即开启您的去中心化存储之旅!
GitHub 用户:使用您的 GitHub 帐户注册并立即获得100MB 的免费存储空间- 无需信用卡!
电子邮件用户:使用您的电子邮件注册并添加信用卡以解锁5GB 的免费存储空间。
Related MCP server: cloudinary-mcp-server
用例
文档存储和分析:安全地上传和检索 Blob 文档。
长期结构化数据存储:维护针对长寿命和可访问性进行优化的结构化数据存储。
代理和系统之间的数据共享:使用**CID(内容标识符)**轻松在多个代理和不同系统之间共享数据,实现分散、可验证和高效的数据交换。
应用程序集成:通过模型上下文协议将 Storacha 存储检索无缝集成到应用程序中。
AI 模型开发:通过提供可靠的版本控制和对存储在 Storacha 中的外部数据集的访问来支持 AI 模型。
LLM 集成:通过直接连接 Storacha Storage 实现无缝数据访问,增强大型语言模型 (LLM)。
Web 应用程序备份:可靠地存储 Web 应用程序的备份副本,以用于灾难恢复。
机器学习数据集:有效管理和访问机器学习工作流中使用的大型数据集。
快速安装指南
只需几个简单的步骤即可开始使用 Storacha MCP 存储服务器。
克隆存储库
git clone https://github.com/storacha/mcp-storage-server.git && cd mcp-storage-server安装依赖项
pnpm install生成密钥和委托
安装 CLI
npm install -g @web3-storage/w3cli登录Storacha
w3 login输出:
? How do you want to login? Via Email ❯ Via GitHub选择
创建空间
w3 space create <your_space_name>将。:warning:确保您保存恢复密钥,以便您可以在需要时从其他设备访问您的空间。
创建私钥
w3 key create输出:
AgentId: did:key:z6MkhMZRW2aoJ6BQwkpMSJu68Jgqkz1FTpr1p69cpnN43YWG PrivateKey: LMgCYLkvOc8Sm0mOL4cWFLxsWP0ZPEYrLxcQqsV93/s5RLje0BKx05muAse1Hkvh+sxUW38OcHtpiN1zxfpTJ4ht4jxV0=设置代理ID并创建委托
w3 delegation create <agent_id> \ --can 'store/add' \ --can 'filecoin/offer' \ --can 'upload/add' \ --can 'space/blob/add' \ --can 'space/index/add' --base64将 <agent_id> 替换为上一步中的 AgentId。它授予 Agent 将文件存储到最近创建的空间的权限。
配置 MCP 客户端
接下来,配置您的 MCP 客户端(例如 Cursor)以使用此服务器。大多数 MCP 客户端将配置存储为以下格式的 JSON:
{ "mcpServers": { "storacha-storage-server": { "command": "node", "args": ["./dist/index.js"], "env": { // The server supports `stdio`, `sse`, and `rest` modes, the default is `stdio`. "MCP_TRANSPORT_MODE": "stdio", // The Storacha Agent private key that is authorized to store data into the Space. "PRIVATE_KEY": "<agent_private_key>", // The base64 encoded delegation that proves the Agent is allowed to store data. If not set, MUST be provided for each upload request. "DELEGATION": "<base64_delegation>", }, "shell": true, "cwd": "./", }, }, }将
REST 模式和云托管
Storacha MCP 存储服务器支持 REST 传输模式,兼容 MCP.so 云托管。使用 REST 模式的步骤如下:
{
"mcpServers": {
"storacha-storage-server-rest": {
"url": "http://localhost:3001/rest",
},
},
}有关部署到 MCP.so 云的更多信息,请参阅integrations.md指南。
:warning: 有几种方法可以配置 MCP 客户端,请阅读
工具
Storacha MCP 存储服务器为 AI 系统与去中心化存储网络交互提供了以下工具。
存储操作
上传
将文件上传到 Storacha 网络。该文件必须以 base64 编码的字符串形式提供,并且文件名必须包含用于 MIME 类型检测的扩展名。
interface UploadParams {
// Base64 encoded file content
file: string;
// Filename with extension for MIME type detection
name: string;
// Optional: Whether to publish to Filecoin (default: false)
publishToFilecoin?: boolean;
// Optional: Custom delegation proof
delegation?: string;
// Optional: Custom gateway URL
gatewayUrl?: string;
}取回
从 Storacha 网络检索文件。支持的文件路径格式: CID/filename 、 /ipfs/CID/filename或ipfs://CID/filename 。
interface RetrieveParams {
// Path in format: CID/filename, /ipfs/CID/filename, or ipfs://CID/filename
filepath: string;
// Optional: Whether to use multiformat base64 encoding
useMultiformatBase64?: boolean;
}身份
返回从私钥存储配置加载的Storacha Agent的DIDKey 。
interface IdentityParams {
// No parameters required
}请参阅integrations.md指南,了解详细的代码示例和不同的集成模式(SDK、Docker 等)。
执照
MIT 或 Apache 2 许可证
支持
如需支持,请访问Storacha 支持或在此存储库中打开问题。
This server cannot be installed
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.