关于 MCP Server
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
暂未收录安装方式
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
还没有获取到工具列表
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
MCP 服务
1. 什么是 MCP(模型上下文协议)?
模型上下文协议(MCP)是一种用于模型、Agent 和上下文数据交互的标准。它由社区开发和维护。更多详情请参阅官方代码库:MCP GitHub。
2. 什么是 IPFS?
星际文件系统(IPFS)是一种分布式文件系统,支持去中心化的数据存储与共享。MCP 使用它来存储数据并与数据交互,确保可靠性和容错能力。
3. MCP 服务架构概览
组件:
- MCP 节点 — 处理 MCP 请求的核心服务组件。
- IPFS — 用于处理内容的去中心化存储系统。
- 客户端 — 与 MCP 服务交互,以发送和接收数据。
- Claude AI — 用于处理和增强 MCP 交互。
组件交互:
- 客户端向 MCP 节点发送请求。
- MCP 节点处理请求,并在必要时与 IPFS 交互。
- Claude AI 协助处理并优化响应。
- 响应返回给客户端。
4. 部署 MCP 服务
要求:
- Node.js(推荐版本 18+)
- NPM 或 Yarn
安装
安装方式取决于你使用的是 Claude Code 还是 Claude Desktop。
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"
]
}
}
}
自动安装和部署
使用以下 bash 脚本自动部署服务:
#!/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
使用方法
要开始使用 MCP,请运行命令 claude 启动 Claude Code,或启动 Claude Desktop。以下是可用操作:
文件操作
- upload-file 上传到 IPFS
- get-file 根据 CID 获取文件
- pin-file 根据 CID 固定文件
- list-folder 根据 CID 获取目录列表
- unpin-file- 根据 CID 取消固定文件
Claude 提示词示例
以下是一些 instruct Claude 使用 ipfs-mcp 的示例:
Upload an image to IPFS:
"Please upload the file at ~/Pictures/example.jpg to my Pinata account as a private file named 'My Example Image'"
Get a file from IPFS:
"Get the file from IPFS using the CID""
Pin a file to IPFS:
"Pin the file by it's CID"
Unpin a file to IPFS:
"Unpin the file based on the CID"
问题
如有任何问题,请给我们发送电子邮件!
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。