Skip to main content

Python toolkit for IPFS with high-level API, cluster management, tiered storage, and AI/ML integration

Project description

IPFS Kit Python - Production Ready MCP Server

Production Ready Python 3.12+ Docker MCP Compatible Files Organized

IPFS Kit is a comprehensive, production-ready Python toolkit for working with IPFS (InterPlanetary File System) technologies. It provides a unified Model Context Protocol (MCP) server for IPFS operations, cluster management, tiered storage, and AI/ML integration.

🎉 Now Production Ready! This project has been transformed from 700+ cluttered files to a clean, organized structure with comprehensive documentation. See FINAL_PRODUCTION_STATUS.md for complete details.

🚀 Quick Start

Production MCP Server

Start the production MCP server in seconds:

# Direct execution
python3 final_mcp_server_enhanced.py --host 0.0.0.0 --port 9998

# Docker deployment
docker-compose up -d

# Development mode with debug logging
python3 final_mcp_server_enhanced.py --debug

Installation

# Development installation
git clone https://github.com/your-repo/ipfs_kit_py.git
cd ipfs_kit_py
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -r requirements.txt

# Package installation (when published)
pip install ipfs_kit_py[full]

🌟 Key Features

Production MCP Server

  • FastAPI-based REST API with comprehensive IPFS operations
  • JSON-RPC 2.0 protocol support for Model Context Protocol compatibility
  • Mock IPFS implementation for reliable testing and development
  • Health monitoring with /health endpoint and metrics
  • Comprehensive logging with structured output and debug modes
  • Docker deployment with optimized containers and compose configuration

IPFS Operations

  • Content Management: Add, retrieve, pin, and list IPFS content
  • Mock Storage: Realistic IPFS behavior for testing without requiring IPFS daemon
  • CID Generation: Proper content addressing with SHA-256 based CIDs
  • Error Handling: Robust error handling with detailed error messages

Developer Experience

  • Command-line Interface: Easy-to-use CLI with configurable options
  • Auto-generated Documentation: Interactive API docs at /docs endpoint
  • Validation Tools: Built-in server validation and testing utilities
  • Hot Reload: Development mode with automatic code reloading

📋 API Endpoints

The MCP server provides the following endpoints:

Health & Status

  • GET /health - Health check and server status
  • GET /metrics - Server metrics and statistics
  • GET /docs - Interactive API documentation

JSON-RPC Interface

  • POST /jsonrpc - MCP protocol endpoint for tool execution

IPFS Operations (via JSON-RPC)

  • ipfs_add - Add content to IPFS storage
  • ipfs_cat - Retrieve content by CID
  • ipfs_pin_add - Pin content for persistence
  • ipfs_pin_ls - List pinned content
  • ipfs_refs - List references and links

🐳 Docker Deployment

Using Docker Compose (Recommended)

# Start the service
docker-compose up -d

# View logs
docker-compose logs -f

# Stop the service
docker-compose down

Manual Docker Build

# Build the image
docker build -t ipfs-kit-mcp .

# Run the container
docker run -p 9998:9998 ipfs-kit-mcp

🔧 Configuration

Environment Variables

  • IPFS_KIT_HOST - Server host (default: 127.0.0.1)
  • IPFS_KIT_PORT - Server port (default: 9998)
  • IPFS_KIT_DEBUG - Enable debug mode (default: false)
  • PYTHONUNBUFFERED - Ensure unbuffered output for Docker

Command Line Options

python3 final_mcp_server_enhanced.py --help

Options:

  • --host HOST - Host to bind to (default: 127.0.0.1)
  • --port PORT - Port to bind to (default: 9998)
  • --debug - Enable debug mode with detailed logging

Examples

For practical examples of using IPFS Kit, see the examples directory, which includes:

  • Basic usage examples
  • FSSpec integration examples
  • Cluster management examples
  • Performance profiling examples
  • Filesystem journal examples
  • Journal monitoring and visualization examples
  • AI/ML integration examples
  • AI/ML visualization examples
  • Data science workflow examples
  • High-level API usage examples
  • Tiered cache performance examples
  • Probabilistic data structures examples
  • Practical integration examples

Contributing to Documentation

We welcome contributions to improve the documentation! If you find errors, have suggestions, or want to add examples, please submit a pull request or open an issue.

When contributing to documentation:

  1. Follow the existing style and formatting
  2. Provide practical examples where appropriate
  3. Explain concepts clearly with diagrams when appropriate
  4. Link related documentation
  5. Test examples before submitting

Getting Help

If you need help with IPFS Kit:

  • Check the README.md for quick start guides
  • Search the documentation for specific topics
  • Look at the examples in the examples directory
  • Open an issue on GitHub if you find a bug or have a feature request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipfs_kit_py-0.3.0.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ipfs_kit_py-0.3.0-py3-none-any.whl (3.7 MB view details)

Uploaded Python 3

File details

Details for the file ipfs_kit_py-0.3.0.tar.gz.

File metadata

  • Download URL: ipfs_kit_py-0.3.0.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ipfs_kit_py-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d8982e6e2ac933d12c826c541871e12dd76a2a3a61d54c426ade9abce8d543c8
MD5 ea162318dec2dab1e27e088472a07955
BLAKE2b-256 021f026084b2129380ba25adb09d7e6064a765e112d0eec9bba609295f652dd4

See more details on using hashes here.

File details

Details for the file ipfs_kit_py-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ipfs_kit_py-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ipfs_kit_py-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39198071fc39f3a3882d8fd61dae1480b85ad70f7684de86ec6303a30001bbde
MD5 39c0012a4cff92e5917d0de52d9f06e3
BLAKE2b-256 08118b776a5841940f3433db5e07e72f002f0fe70fed8ea9ee0f2136483d8b20

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page