pinata-mcp

pinata-mcp

site icon
2025.03.13 3
JavaScript文件管理IPFS 服务内容生成
pinata-mcp 是一个 Model Context Protocol (MCP) 服务器,为 Claude 提供与 Pinata 交互的能力。通过 Pinata 的 API,Claude 可以访问公共和私有 IPFS,实现文件上传、搜索、管理等功能。
View on GitHub

Overview

基本能力

产品定位

pinata-mcp 是一个连接 Claude 和 Pinata 服务的中间件,主要用于文件存储和管理,特别是基于 IPFS 的文件操作。

核心功能

  • 文件操作:上传文件到 Pinata(公共或私有 IPFS)、按名称、CID 或 MIME 类型搜索文件、获取文件详情、更新文件元数据、删除文件。
  • 分组操作:列出分组(支持过滤)、创建分组、获取分组详情、更新分组信息、删除分组、向分组添加/移除文件。
  • 内容访问:创建私有下载链接、从 IPFS 网关获取内容并保存到本地。

适用场景

  • 需要将文件存储到 IPFS 的场景。
  • 需要管理 IPFS 上的文件,包括搜索、更新和删除。
  • 需要对文件进行分组管理。
  • 需要从 IPFS 下载内容到本地。

使用教程

使用依赖

  • Node.js 18+ 已安装。
  • 拥有 Pinata 账户和 API 密钥(JWT)。

安装教程

Claude Code 运行以下命令并按照提示填写信息:

claude mcp add

填写信息示例:

Server Name: pinata
Server Scope: Project or Global
Server Command: npx
Command Arguments: pinata-mcp /path/to/allowed/directories /another/path/to/allowed/directories
Environment Variables: PINATA_JWT=<YOUR_JWT>,GATEWAY_URL=example.mypinata.cloud

Claude Desktopclaude_desktop_config.json 中添加以下配置:

{
  "mcpServers": {
    "pinata": {
      "command": "npx",
      "args": [
        "pinata-mcp",
        "/path/to/allowed/directory"
      ],
      "env": {
        "PINATA_JWT": "<YOUR_JWT>",
        "GATEWAY_URL": "example.mypinata.cloud"
      }
    }
  }
}

调试方式

启动 Claude Code 或 Claude Desktop 后,可以使用以下示例指令测试功能:

Upload an image to Pinata:
"Please upload the file at ~/Pictures/example.jpg to my Pinata account as a private file named 'My Example Image'"

Search for files:
"Search my Pinata account for all PNG files"

Create a group and add files:
"Create a new group called 'Project Assets' on Pinata, then find all my JSON files and add them to this group"

Download content from IPFS:
"Fetch the content with CID QmX... from IPFS and save it to my Downloads folder"

常见问题解答

如有问题,可以发送邮件至 [email protected] 寻求帮助。

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。