MCP IPFS 服务器是一款用于与 storcha.network 网络交互的工具。它基于 Node.js 和 TypeScript 构建,旨在为用户提供强大且易用的接口,实现文件存储、检索、权限管理等功能。
MCP IPFS 服务器可帮助你轻松与 storcha.network 网络进行交互。以下将为你介绍如何安装和使用该服务器。
w3_up 命令上传文件。git clone https://github.com/alexbakers/mcp-ipfs.git
cd mcp-ipfs
npm install
npm run build
# 确保 W3_LOGIN_EMAIL 环境变量已设置
export W3_LOGIN_EMAIL="your-email@example.com"
node dist/index.js
npm publish
构建 Docker 镜像:
# 替换为你自己的用户名/仓库和所需的标签
docker build -t alexbakers/mcp-ipfs .
npx mcp-ipfs --config ./config.json
docker run -i --rm -v /path/to/your/project:/path/to/your/project -e W3_LOGIN_EMAIL alexbakers/mcp-ipfs
使用命令:w3_up
,其中
是要上传的文件路径。
w3_up ./my_file.txt
使用命令:w3_get ,其中 是文件的内容标识符。
w3_get Qmd5MvS7rg...
w3_delegation create --output ./delegation.json
w3_proof add ./my_file.txt --delegation ./delegation.json
w3_container start
w3_container stop
w3_container restart
w3 工具,并在 $PATH 中可用。W3_LOGIN_EMAIL 为你的 storcha.network 登录邮箱。w3 命令需要绝对文件路径(例如,w3_up、w3_delegation_create --output)。
-v 标志挂载主机目录到容器,并使用容器路径。src/
├── index.ts # 入口文件
├── config.ts # 配置管理
├── commands/ # 命令处理模块
│ ├── up.ts # 文件上传命令
│ └── get.ts # 文件获取命令
└── utils/ # 工具函数
└── ipfs.ts # IPFS 操作工具
MCP 服务器在 MIT 许可证下发布。有关详细信息,请参阅 LICENSE 文件。