mcp-ipfs

mcp-ipfs is an MCP Server bridging AI models and clients with IPFS storage on storacha.network. It seamlessly integrates the w3 CLI for managing spaces, data, and delegations via the Model Context Protocol.

mcp-ipfs
mcp-ipfs Capabilities Showcase

mcp-ipfs Solution Overview

Meet mcp-ipfs, an MCP Server specifically designed to connect AI models with the decentralized storage power of storacha.network via IPFS. This Node.js server acts as a crucial bridge, simplifying interactions by wrapping the w3 command-line interface. It exposes a comprehensive suite of MCP tools, enabling AI models (through MCP clients) to directly manage storage spaces, upload/download files, control access delegations, retrieve account details, and execute numerous other storacha.network operations. mcp-ipfs solves the developer challenge of integrating complex decentralized storage workflows into AI applications, abstracting CLI commands into standardized, callable tools. By providing seamless access to IPFS capabilities, it significantly enhances AI models' ability to work with persistent, decentralized data. Integration is achieved using standard MCP client setups (NPX, Docker), requiring Node.js, a configured w3 CLI, and the W3_LOGIN_EMAIL environment variable.

mcp-ipfs Key Capabilities

Decentralized Storage Management

The mcp-ipfs server provides AI models and MCP clients with comprehensive capabilities to manage decentralized storage spaces and data on the storacha.network platform, powered by IPFS and web3.storage technologies. It achieves this by acting as a standardized MCP interface that translates client requests into corresponding w3 CLI commands. Core functionalities include listing available storage spaces (w3_space_ls), selecting a specific space to operate within (w3_space_use), retrieving detailed information about a space (w3_space_info), and adding new spaces (w3_space_add, w3_space_provision). For data operations, it enables uploading files or directories (w3_up), listing the contents of a space or specific directory (w3_ls), and removing stored items (w3_rm). This abstraction layer simplifies interaction with decentralized storage, allowing AI models to treat storacha.network as a native resource without needing direct CLI access or complex scripting.

  • Use Case: An AI agent generating research reports can use the w3_up tool via mcp-ipfs to automatically upload the final PDF report to a designated project space on storacha.network, receiving back the IPFS CID for sharing or archival. Later, it could use w3_ls to verify the upload or w3_rm to remove outdated drafts.

Secure Authentication & Delegation

mcp-ipfs facilitates secure, programmatic interaction between MCP clients (like AI models) and the storacha.network platform by managing authentication and access delegation. It leverages the w3 CLI's authentication mechanism, requiring an initial setup (w3 login <email>) and the W3_LOGIN_EMAIL environment variable for the server process. The server exposes tools like w3_login (potentially for re-authentication flows, though primarily handled by initial CLI setup) and w3_account_ls to verify the currently authorized agent. Crucially, it supports managing delegations (w3_delegation_create, w3_delegation_ls, w3_delegation_revoke) and proofs (w3_proof_add, w3_proof_ls). This allows fine-grained control over permissions, enabling AI models or applications to be granted specific capabilities (e.g., upload-only access to a particular space) for a limited time, without exposing the primary account credentials. This enhances security by adhering to the principle of least privilege.

  • Use Case: A data processing pipeline orchestrated by an AI needs to store intermediate results. Instead of giving the AI full account access, the user employs mcp-ipfs and the w3_delegation_create tool to generate a short-lived delegation granting only upload permissions to a specific 'results' space. The AI then uses this delegation for its storage tasks.

Seamless w3 CLI Abstraction

The fundamental value proposition of mcp-ipfs lies in its role as an abstraction layer over the @web3-storage/w3cli command-line interface. It acts as a dedicated MCP Server, translating standardized MCP requests from any compatible client into specific w3 command executions. This shields the AI model and the developer from the complexities of direct CLI interaction, such as command syntax, argument parsing, output handling, and managing the CLI process lifecycle. The server encapsulates a wide range of w3 commands, covering authentication, space management, data operations, delegation, proofs, key management (w3_key_create), and even billing/usage information (w3_plan_get, w3_usage_report). By adhering to the MCP specification, mcp-ipfs ensures interoperability within the MCP ecosystem, allowing developers to easily integrate decentralized storage capabilities into their AI applications using familiar MCP client configurations (like specifying the server command via NPX or Docker).

  • Use Case: A developer building an AI-powered content generation platform wants to offer users the option to store their creations decentrally. Instead of writing custom code to invoke and manage the w3 CLI, they integrate mcp-ipfs as an MCP server. The AI application can then simply send standard MCP requests (e.g., tool_use with tool_name: "w3_up") to the server, which handles the underlying w3 CLI execution seamlessly.