Walrus MCP Server

Walrus MCP Server

Enables AI assistants to store and retrieve data using the Walrus decentralized storage network. Supports blob storage operations, retrieval by ID, and blockchain-verified availability through the Sui network.

Category
访问服务器

README

🦭 Walrus MCP Server

<div align="center">

MCP Server for Walrus Decentralized Storage Protocol

Built with ❤️ by Motion Labs

License: MIT Node.js Version TypeScript

🌐 Walrus Docs📚 MCP Documentation

</div>

✨ Features

🗄️ Decentralized Storage Operations

  • Store blobs in Walrus decentralized storage network
  • Retrieve blobs by blob ID with high availability
  • Get blob information including size and certification status
  • Check blob availability and network health

🔗 Blockchain Integration

  • Sui blockchain coordination for storage metadata
  • Storage epoch management for blob lifecycle
  • Proof of availability through blockchain verification
  • Storage resource management

🛠️ Developer Experience

  • Simple MCP tools for AI assistants and automation
  • Base64 encoding for binary data handling
  • File path support for direct file uploads
  • Comprehensive error handling with clear messages

🚀 Quick Start

Prerequisites

  • Node.js >= 18.0.0
  • npm >= 8.0.0
  • Claude Desktop or compatible MCP client

Installation

  1. Clone the repository

    git clone https://github.com/MotionEcosystem/walrus-mcp.git
    cd walrus-mcp
    
  2. Install dependencies

    npm install
    
  3. Build the server

    npm run build
    

MCP Setup

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "walrus": {
      "command": "node",
      "args": ["path/to/walrus-mcp/dist/index.js"],
      "env": {
        "WALRUS_AGGREGATOR_URL": "https://aggregator-devnet.walrus.space",
        "WALRUS_PUBLISHER_URL": "https://publisher-devnet.walrus.space"
      }
    }
  }
}

🛠️ Available Tools

store_blob

Store data in Walrus decentralized storage.

  • data: Base64 encoded data or file path
  • epochs (optional): Number of epochs to store (default: 5)

get_blob

Retrieve a blob from Walrus storage.

  • blobId: The blob ID to retrieve

get_blob_info

Get information about a blob.

  • blobId: The blob ID to get information about

list_blobs

List stored blobs (requires local indexing).

  • limit (optional): Maximum number of blobs to list

delete_blob

Attempt to delete a blob (note: Walrus blobs expire automatically).

  • blobId: The blob ID to delete

📊 Resources

walrus://status

Current status and health of the Walrus network

walrus://config

Current Walrus client configuration

🔧 Development

Available Scripts

Script Description
npm run dev Start development server
npm run build Build for production
npm run start Start production server
npm run lint Run ESLint
npm run type-check Run TypeScript type checking
npm run format Format code with Prettier

Tech Stack

🏗️ Architecture

The Walrus MCP Server provides a bridge between AI assistants and the Walrus decentralized storage network through the Model Context Protocol (MCP).

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   AI Assistant  │    │  Walrus MCP     │    │ Walrus Network  │
│  (Claude, etc.) │◄──►│     Server      │◄──►│   (DevNet)      │
└─────────────────┘    └─────────────────┘    └─────────────────┘
                              │
                              ▼
                       ┌─────────────────┐
                       │  Sui Blockchain │
                       │   (Metadata)    │
                       └─────────────────┘

Components

  • MCP Server: Handles tool calls and resource requests from AI assistants
  • Walrus Client: Manages HTTP communication with Walrus aggregator and publisher
  • Aggregator: Provides blob retrieval functionality
  • Publisher: Handles blob storage operations
  • Sui Integration: Manages storage metadata and epochs

📚 Detailed Documentation

Environment Configuration

Create a .env file based on .env.example:

# Required: Walrus network endpoints
WALRUS_AGGREGATOR_URL=https://aggregator-devnet.walrus.space
WALRUS_PUBLISHER_URL=https://publisher-devnet.walrus.space

# Optional: Custom system object ID
WALRUS_SYSTEM_OBJECT=0x37c0e4d7b36a2f64d51bba262a1791f844cfd88f19c35b5ca709e1a6991e90dc

# Optional: Wallet for transaction signing
WALRUS_WALLET_PATH=/path/to/your/wallet.json

Tool Usage Examples

Storing a Blob

// Store text data
await tool_call("store_blob", {
  data: "SGVsbG8sIFdhbHJ1cyE=", // Base64 encoded "Hello, Walrus!"
  epochs: 10
})

// Store a file
await tool_call("store_blob", {
  data: "/path/to/file.jpg",
  epochs: 5
})

Retrieving a Blob

// Get blob content as Base64
const blob = await tool_call("get_blob", {
  blobId: "0xabc123..."
})

Getting Blob Information

// Get blob metadata
const info = await tool_call("get_blob_info", {
  blobId: "0xabc123..."
})

console.log(info.size, info.certified, info.endEpoch)

Resource Usage Examples

Check Network Status

// Get Walrus network health
const status = await resource_read("walrus://status")
console.log(status.epoch, status.networkSize)

View Configuration

// Get current client configuration
const config = await resource_read("walrus://config")
console.log(config.aggregatorUrl, config.publisherUrl)

Error Handling

The server provides comprehensive error handling for common scenarios:

  • Blob not found: Clear error message with blob ID
  • Network issues: Timeout and connectivity error details
  • Invalid data: Validation errors for malformed inputs
  • Storage limits: Epoch and capacity constraint messages

Data Format Support

Supported Input Formats

  • Base64 encoded strings: For binary data transmission
  • File paths: Direct file reading (relative or absolute)
  • Text content: Automatically encoded for storage

Output Format

All retrieved blobs are returned as Base64 encoded strings for consistent handling across different data types.

Security Considerations

⚠️ Important Security Notes:

  • All blobs stored in Walrus are public and discoverable
  • Do not store sensitive or confidential information without encryption
  • Consider client-side encryption for private data
  • Validate all inputs before processing

Network Information

DevNet Configuration

  • Aggregator: https://aggregator-devnet.walrus.space
  • Publisher: https://publisher-devnet.walrus.space
  • System Object: 0x37c0e4d7b36a2f64d51bba262a1791f844cfd88f19c35b5ca709e1a6991e90dc

TestNet Configuration

For TestNet usage, update environment variables:

WALRUS_AGGREGATOR_URL=https://aggregator-testnet.walrus.space
WALRUS_PUBLISHER_URL=https://publisher-testnet.walrus.space

Storage Economics

Epochs and Pricing

  • Epoch Duration: Fixed time periods for storage commitment
  • Minimum Storage: 5 epochs (configurable)
  • Cost Calculation: Based on blob size and storage duration
  • Payment: Handled through Sui blockchain transactions

Troubleshooting

Common Issues

  1. Connection Errors

    • Verify network connectivity
    • Check aggregator/publisher URLs
    • Ensure DevNet/TestNet endpoints are accessible
  2. Storage Failures

    • Check blob size limits
    • Verify sufficient SUI tokens for storage fees
    • Ensure proper epoch configuration
  3. Retrieval Issues

    • Confirm blob ID format and validity
    • Check if blob has expired (past end epoch)
    • Verify aggregator availability

Debug Mode

Enable detailed logging:

DEBUG=walrus-mcp:* npm run dev

Contributing

We welcome contributions! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Update documentation
  5. Submit a pull request

Roadmap

  • [ ] Enhanced blob management: Batch operations and metadata indexing
  • [ ] Encryption support: Client-side encryption for private data
  • [ ] WebSocket support: Real-time blob status updates
  • [ ] CLI tool: Standalone command-line interface
  • [ ] Performance metrics: Storage and retrieval analytics
  • [ ] MainNet support: Production network integration

📄 License

MIT License - see LICENSE file for details.

🤝 Support


<div align="center"> <sub>Built with 🦭 for the decentralized future</sub> </div>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选