MCP Server
The Model Context Protocol lets AI assistants like Claude interact with w3stor directly. Upload files, check status, and create attestations without leaving the conversation.
What is MCP?
The Model Context Protocol is an open standard that allows AI models to securely interact with external tools and data sources. Instead of copy-pasting CIDs or switching between apps, your AI assistant can store and retrieve files directly.
w3stor implements MCP over stdio transport, exposing 4 tools that map to the REST API. Payment is handled automatically via x402 -- the AI decides when to store, and the protocol handles the rest.
Setup
Claude Desktop
Add the w3stor server to your Claude Desktop configuration:
// ~/Library/Application Support/Claude/claude_desktop_config.json{ "mcpServers": { "w3stor": { "command": "w3stor", "args": ["--mcp"], "env": { "FILECOIN_PRIVATE_KEY": "0x...", "PINATA_JWT": "your-jwt-token" } } }}Claude Code
Register w3stor as an MCP server with a single command:
Custom MCP Client
Connect any MCP-compatible client using the SDK:
import { Client } from "@modelcontextprotocol/sdk/client/index.js";import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
const transport = new StdioClientTransport({ command: "w3stor", args: ["--mcp"],});
const client = new Client({ name: "my-app", version: "1.0.0" }, {});await client.connect(transport);
// List available toolsconst tools = await client.listTools();console.log(tools);
// Upload a fileconst result = await client.callTool({ name: "web3_storage_upload", arguments: { file: "/path/to/data.json", tags: "dataset,v1", },});console.log(result);Available Tools
Each tool maps to a REST API endpoint. Tools marked x402 trigger a micropayment.
web3_storage_upload
x402Upload a file to IPFS and replicate across Filecoin storage providers.
Absolute path to the file to upload
Comma-separated tags for organization
Number of SP replicas (default: 3)
Content identifier (CIDv1)
File size in bytes
IPFS gateway URL
web3_storage_list
freeList files stored by the authenticated wallet.
Filter: pinned | storing | stored
Max results (default: 50)
Array of file objects with CID, size, status, tags
Total count
web3_storage_status
freeCheck replication and storage status for a specific CID.
Content identifier
The queried CID
pinned | storing | stored | failed
SP providers storing this CID
Confirmed replicas
web3_storage_attest
x402Create an on-chain attestation proving data integrity and storage.
CID to attest
On-chain attestation ID
Transaction hash
Unix timestamp