MCP Server

MCP Server

site icon
2025.04.07 1
TypeScript分布式文件存储数据共享模型交互其它
MCP (Model Context Protocol) 是一种用于模型、代理和上下文数据之间交互的标准。mcp-ipfs-server 是基于 MCP 协议的服务,利用 IPFS(InterPlanetary File System)进行分布式文件存储和共享,确保数据的可靠性和容错性。该服务通过 MCP Node 处理请求,与 IPFS 交互,并利用 Claude AI 优化响应。
View on GitHub

Overview

基本能力

产品定位

mcp-ipfs-server 是一个基于 MCP 协议的服务,专注于利用 IPFS 进行分布式文件存储和共享,适用于需要高可靠性和容错性的数据交互场景。

核心功能

  1. 文件操作
  2. 上传文件到 IPFS
  3. 通过 CID 获取文件
  4. 通过 CID 固定文件
  5. 通过 CID 列出文件夹内容
  6. 通过 CID 取消固定文件

  7. 组件交互

  8. MCP Node 处理请求
  9. IPFS 存储和共享数据
  10. Claude AI 优化响应

适用场景

  1. 分布式文件存储:适用于需要高可靠性和容错性的文件存储场景。
  2. 数据共享:适用于需要跨平台、跨设备共享数据的场景。
  3. 模型交互:适用于模型、代理和上下文数据之间的交互场景。

工具列表

  1. IPFS:分布式文件系统,用于存储和共享数据。
  2. Claude AI:用于处理和优化 MCP 交互。
  3. Node.js:运行 MCP 服务器的环境。

常见问题解答

如有任何问题,可以通过邮件联系开发者:[email protected]

使用教程

使用依赖

  1. Node.js(推荐版本 18+)
  2. NPM 或 Yarn

安装教程

Claude Code 安装

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

claude mcp add

填写信息示例:

Server Name: mcp-ipfs
Server Command: node
Command Arguments: node /ABSOLUTE/PATH/TO/PARENT/FOLDER/mcp-ipfs-server/build/index.js

Claude Desktop 安装

claude_desktop_config.json 中添加以下配置:

{
  "mcpServers": {
    "ipfs-mcp": {
      "command": "node",
      "args": [
        "/Absolute/path/to/mcp-ipfs-server/build/index.js"
      ]
    }
  }
}

自动化安装和部署

运行以下脚本:

#!/bin/bash

sudo apt update
sudo apt install -y wget tar git npm

wget https://github.com/ipfs/kubo/releases/download/v0.34.1/kubo_v0.34.1_linux-amd64.tar.gz

tar -xvzf kubo_v0.34.1_linux-amd64.tar.gz

cd kubo
sudo bash install.sh

ipfs init

sudo apt install ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 4001/tcp
sudo ufw allow 8080/tcp
sudo ufw allow 22/tcp
sudo ufw allow 5001/tcp
sudo ufw enable
sudo ufw status

# Clone the MCP server repository
git clone https://github.com/AleksanStark/mcp-ipfs-server.git
cd mcp-ipfs-server

# Install dependencies
npm install
npm install @modelcontextprotocol/sdk zod
npm install -D @types/node typescript
# Build the project
npm run build
ipfs daemon

调试方式

  1. 启动 Claude Code 或 Claude Desktop。
  2. 使用以下命令进行文件操作:
  3. 上传文件:"Please upload the file at ~/Pictures/example.jpg to my Pinata account as a private file named 'My Example Image'"
  4. 获取文件:"Get the file from IPFS using the CID"
  5. 固定文件:"Pin the file by it's CID"
  6. 取消固定文件:"Unpin the file based on the CID"

许可证

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