Catalog npm
Back to packageRELEASE DETAILS

1.0.0

npm

@0gfoundation/0g-cc

0G Code to Coin - MCP server for decentralized AI compute and storage on 0G Network

0gaidecentralizedinferencemcpstoragezerog
Published30 Jan 2026
Direct dependencies20
Transitive dependenciesNot calculated

README

Current package documentation

0G Code to Coin (0g-cc)

Decentralized AI Coding Assistant - MCP server bridging 0G's decentralized compute network for AI inference, fine-tuning, storage, and VIBEZ token marketplace.

npm version License: MIT TypeScript

Overview

0G Code to Coin enables AI assistants like Claude Code, Cursor, and Windsurf to leverage 0G's decentralized AI infrastructure:

  • Decentralized Inference - Route AI requests to 0G's compute network
  • Up to 96% Cost Savings - Intelligent routing between 0G and cloud providers
  • TEE Verification - Trusted Execution Environment for sensitive workloads
  • Decentralized Storage - Store context, RAG data, and model artifacts on 0G Storage
  • Fine-tuning - Fine-tune models on 0G's compute network
  • VIBEZ Integration - Launch tokens, trade, and earn from your AI apps (coming soon)

Quick Start

New to 0G? Check out the User Guide for a complete walkthrough with natural language examples.

Installation

npm install @0gfoundation/0g-cc

Add to Claude Code

# Minimal setup (free testnet)
claude mcp add 0g-cc npx @0gfoundation/0g-cc

# Full setup (with wallet and cloud fallback)
claude mcp add 0g-cc npx @0gfoundation/0g-cc \
  -e ZEROG_NETWORK=mainnet \
  -e ZEROG_PRIVATE_KEY=0x_your_private_key \
  -e OPENROUTER_API_KEY=sk-or-v1-_your_key \
  -e OPENROUTER_MODEL=deepseek/deepseek-chat

Configuration

Create .env with your settings:

# Network (testnet or mainnet)
ZEROG_NETWORK=testnet

# Optional: Cloud fallback (OpenRouter)
# Both are required for cloud fallback to work
OPENROUTER_API_KEY=your-key-here
OPENROUTER_MODEL=deepseek/deepseek-chat

# Optional: 0G Wallet (for paid operations)
ZEROG_PRIVATE_KEY=your-private-key

# Optional: Logging (see Logging section below)
LOG_FILE=/path/to/logfile.log
LOG_LEVEL=info

Logging

By default, logs are written to stderr. For debugging or monitoring, you can configure file logging:

VariableDescriptionDefault
LOG_FILEPath to write logs (in addition to stderr)Not set (stderr only)
LOG_LEVELMinimum log level: debug, info, warn, errorinfo

Example: Enable file logging for debugging

# In your MCP server config or .env
LOG_FILE=/tmp/0g-cc.log
LOG_LEVEL=debug

Then monitor logs in real-time:

tail -f /tmp/0g-cc.log

Claude Code MCP configuration with logging:

{
  "mcpServers": {
    "0g-cc": {
      "command": "npx",
      "args": ["@0gfoundation/0g-cc"],
      "env": {
        "ZEROG_NETWORK": "mainnet",
        "ZEROG_PRIVATE_KEY": "your-key",
        "LOG_FILE": "/tmp/0g-cc.log",
        "LOG_LEVEL": "info"
      }
    }
  }
}

MCP Tools

Compute

ToolStatusDescription
compute_inference✅Run AI inference via 0G or cloud providers
compute_list_providers✅List available inference providers
compute_verify_provider✅Verify provider TEE attestation
compute_get_balance✅Check wallet and ledger balances
compute_deposit✅Deposit funds to compute ledger
compute_estimate_cost❌Estimate cost before running inference
compute_set_preferences❌Set routing preferences

Storage

ToolStatusDescription
storage_info⚠️Get file info from 0G Storage (mock)
storage_upload❌Upload files to 0G Storage
storage_download❌Download files from 0G Storage
storage_list❌List stored files

Fine-tuning

ToolStatusDescription
finetune_create❌Start a fine-tuning job
finetune_status❌Check job status
finetune_list❌List fine-tuned models

VIBEZ Token Launch (Coming v0.6+)

ToolStatusDescription
vibez_launch_wizard🔮Guided token creation flow
vibez_launch_quick🔮Quick launch with parameters
vibez_estimate_fees🔮Estimate trading fees
vibez_preview_curve🔮Visualize bonding curve

VIBEZ Marketplace (Coming v0.7+)

ToolStatusDescription
vibez_get_token🔮Get token details (price, mcap, health)
vibez_trending🔮List trending tokens
vibez_search🔮Search tokens by name/category
vibez_buy🔮Buy tokens
vibez_sell🔮Sell tokens
vibez_quote🔮Get price quote before trading
vibez_portfolio🔮View all holdings
vibez_my_tokens🔮List tokens you created
vibez_earnings🔮See creator fee earnings
vibez_health_alerts🔮Get alerts for struggling tokens
vibez_fund_compute🔮Add funds to token's compute treasury

0G Knowledge (Coming v0.8+)

ToolStatusDescription
zerog_explain🔮Explain any 0G concept
zerog_docs🔮Fetch specific documentation
zerog_examples🔮Show code examples
zerog_best_practices🔮Get recommended patterns

Wallet (Coming v0.9+)

ToolStatusDescription
wallet_status🔮Check current wallet connection
wallet_connect🔮Connect via WalletConnect
wallet_balance🔮Check 0G balance
wallet_transactions🔮View recent transactions

System

ToolStatusDescription
system_ping✅Health check
system_session_info❌Get detailed session info
system_switch_network❌Switch network

Legend: ✅ Implemented | ⚠️ Partial | ❌ Planned | 🔮 Future Vision

Intelligent Routing

0G Code to Coin uses an LLM Router inspired by agentic-flow to automatically select the best provider:

User Request
     │
     ▼
┌─────────────┐
│  LLM Router │
└─────────────┘
     │
     ├─── Local? ────────▶ Ollama (free, private)
     │                         │
     ├─── Prefer 0G? ───▶ 0G Compute (up to 96% cheaper)
     │                         │
     │                    TEE Verified ✓
     │                         │
     └─── Fallback ─────▶ Cloud (OpenRouter)
                              │
                         High reliability

Routing Criteria

  • Cost: Prefer cheaper providers
  • Latency: Stay within acceptable limits
  • Capability: Match required features (code, chat, vision)
  • TEE: Use verified compute for sensitive data
  • Availability: Automatic fallback if provider down
  • Local: Detect and use local Ollama when available

Cost Savings

ProviderInput $/MTokOutput $/MTokvs Cloud
0G DeepSeek V3$0.30$0.48-90%
0G Qwen 7B$0.05$0.10-97%
Claude Sonnet (Cloud)$3.00$15.00baseline

Example: 1M tokens of coding assistance

  • Cloud: ~$18.00
  • 0G: ~$0.78
  • Savings: 96%

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                     0G Code to Coin MCP Server                   │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐        │
│  │ Compute  │  │ Storage  │  │Fine-tune │  │  VIBEZ   │        │
│  │  Tools   │  │  Tools   │  │  Tools   │  │  Tools   │        │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘  └────┬─────┘        │
│       │             │             │             │                │
│       ▼             ▼             ▼             ▼                │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │                   Router Service                         │   │
│  │    (Intelligent provider selection + fallback)          │   │
│  └─────────────────────────────────────────────────────────┘   │
│       │             │             │             │                │
│       ▼             ▼             ▼             ▼                │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐        │
│  │0G Serving│  │0G Storage│  │OpenRouter│  │  VIBEZ   │        │
│  │  Broker  │  │   SDK    │  │(Fallback)│  │Contracts │        │
│  └──────────┘  └──────────┘  └──────────┘  └──────────┘        │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Development

Build

npm install
npm run build

Run locally

npm run start:dev

Test

npm test                    # Watch mode
npm run test:run            # Unit + integration tests

# E2E Tests
npm run test:e2e:mock       # Fully mocked (no network)
npm run test:e2e:testnet    # Real 0G testnet
npm run test:e2e:mainnet    # Real 0G mainnet (requires funded wallet)

Resources


Roadmap

v0.1.0 - MVP ✅ Complete

Foundation: Basic MCP server with 0G compute

  • Project structure and MCP server core
  • Tool registry with Zod validation
  • Session manager with capabilities
  • Router service with provider selection
  • compute_inference tool
  • compute_list_providers tool
  • system_ping tool
  • Real 0G SDK integration (@0glabs/0g-serving-broker)
  • Cloud fallback (OpenRouter with configurable model)
  • E2E test suite (mock/testnet/mainnet modes)

v0.2.0 - Differentiation & Core Value

Strategic priority: Features that differentiate from competitors

Inference Receipts

  • Cryptographic audit trails for compliance
  • Store receipts in 0G Storage (optional)
  • Receipt verification tool

Hybrid Routing

  • Detect local Ollama installation
  • Route intelligently: local → 0G → cloud
  • User preferences for routing priority

Response Caching

  • Cache deterministic responses (temperature=0)
  • Configurable cache duration
  • Cache invalidation controls

Infrastructure

  • Provider health checks (auto-exclude unhealthy)
  • Streaming responses support
  • Better error messages and recovery

v0.3.0 - Enhanced Compute

Complete the compute toolkit

Cost Management

  • compute_estimate_cost - Estimate before running
  • compute_set_preferences - User routing config
  • Cost comparison across providers

Ledger Integration

  • compute_get_balance - Check 0G balance
  • compute_deposit - Add funds to ledger
  • Balance alerts (low balance warning)

TEE Features

  • TEE attestation capture and storage
  • Verification proof generation
  • Compliance reporting

v0.4.0 - Storage Integration

0G decentralized storage for AI workflows

Core Storage

  • storage_upload - Upload files to 0G
  • storage_download - Download from 0G
  • storage_list - List user's files
  • storage_info - Real SDK integration (replace mock)
  • storage_delete - Remove files

AI Workflow Integration

  • RAG document storage
  • Model artifact storage
  • Context persistence across sessions

v0.5.0 - Fine-tuning & System

Complete the 0G compute suite

Fine-tuning

  • finetune_create - Start fine-tuning jobs
  • finetune_status - Check job progress
  • finetune_list - List fine-tuned models
  • finetune_deploy - Deploy fine-tuned model

System Tools

  • system_session_info - Detailed session info
  • system_switch_network - Network switching (testnet/mainnet)
  • Usage analytics dashboard
  • Performance metrics

v0.6.0 - VIBEZ Token Launch

Enable vibecoders to launch tokens for their apps

Launch Tools

  • vibez_launch_wizard - Guided token creation
    • Step-by-step: name, symbol, curve, description
    • Curve visualization
    • Fee explanation
  • vibez_launch_quick - Quick launch for experienced users
    • Single command with parameters
    • Sensible defaults
  • vibez_estimate_fees - Show expected trading fees
  • vibez_preview_curve - Interactive curve preview

Launch Flow

User: "Launch my app as a token called MYAPP"
     │
     ▼
┌─────────────────────────────────────────┐
│  VIBEZ Launch Wizard                    │
│                                         │
│  1. Name: My App                        │
│  2. Symbol: MYAPP                       │
│  3. Curve: Quadratic (recommended)      │
│  4. Description: An AI assistant app    │
│                                         │
│  Quadratic curves reward early          │
│  supporters 2-3x more                   │
│                                         │
│  [Launch] [Preview Curve] [Cancel]      │
└─────────────────────────────────────────┘
     │
     ▼
Token MYAPP deployed to VIBEZ marketplace!

Educational Tips

  • Explain bonding curves during launch
  • Show fee breakdown
  • Explain health tiers

v0.7.0 - VIBEZ Marketplace

Full marketplace integration: read, trade, earn

Market Data

  • vibez_get_token - Token details (price, mcap, health, volume)
  • vibez_trending - Trending tokens list
  • vibez_search - Search by name, category, creator
  • vibez_health_check - Check app health status

Trading

  • vibez_quote - Get price quote before trading
  • vibez_buy - Buy tokens with slippage protection
  • vibez_sell - Sell tokens
  • vibez_portfolio - View all holdings with P&L

Creator Dashboard

  • vibez_my_tokens - List tokens you created
  • vibez_earnings - See creator fee earnings
  • vibez_health_alerts - Alerts for struggling tokens
  • vibez_fund_compute - Add funds to compute treasury

Example Interactions

User: "How's my MYAPP token doing?"

Claude: "MYAPP Status:
  Price: 0.0023 0G ($0.012)
  Market Cap: $12,450
  Health: HEALTHY (94 days runway)
  24h Volume: $2,340

  Your Holdings: 50,000 MYAPP ($115)
  Creator Earnings: 45.2 0G ($226) lifetime"

v0.8.0 - 0G Knowledge & Education

Built-in 0G expertise for vibecoders

Knowledge Tools

  • zerog_explain - Explain any 0G concept
    • TEE, DA, Storage, Compute, Serving Broker
    • Bonding curves, health tiers, graduation
  • zerog_docs - Fetch specific documentation
  • zerog_examples - Show code examples
  • zerog_best_practices - Recommended patterns

Proactive Education

  • Contextual tips during operations
  • Explain concepts when relevant
  • Warn about common mistakes
  • Suggest optimizations

Example

User: "What is TEE?"

Claude: "TEE (Trusted Execution Environment) is a secure area
of a processor that guarantees code and data are protected.

In 0G Compute, TEE verification means:
• Your inference runs in an isolated enclave
• Even the provider can't see your data
• Results are cryptographically verified

Use `compute_inference` with `tee: true` for sensitive workloads.

Would you like to see an example?"

v0.9.0 - Wallet & Authentication

Multiple auth methods for different use cases

Wallet Tools

  • wallet_status - Current connection status
  • wallet_balance - Check 0G balance
  • wallet_connect - WalletConnect integration
  • wallet_transactions - Recent transaction history

Auth Methods

  • Private key in env (current)
  • WalletConnect support
  • Hardware wallet support (Ledger)
  • Social login (Privy integration)

Onboarding Flow

  • Guided wallet creation for new users
  • Import existing wallet
  • Security best practices tips

v1.0.0 - Full Integration

Production-ready vibecoder toolkit

Polish

  • Comprehensive error handling
  • Retry logic with backoff
  • Offline mode (queue operations)
  • Multi-language support

Analytics

  • Usage tracking (opt-in)
  • Cost analytics dashboard
  • ROI calculations for creators

Enterprise

  • Team wallet support
  • Role-based permissions
  • Audit logging
  • SLA monitoring

Vision

0G Code to Coin aims to be the command center for vibecoders - enabling anyone to:

┌─────────────┐      ┌─────────────┐      ┌─────────────┐
│             │      │             │      │             │
│    BUILD    │ ───▶ │   LAUNCH    │ ───▶ │    EARN     │
│             │      │             │      │             │
└─────────────┘      └─────────────┘      └─────────────┘

 • 0G Compute        • Token wizard       • Portfolio view
 • 0G Storage        • VIBEZ deploy       • Fee tracking
 • BYOK routing      • Health setup       • Alerts
 • Cost savings      • Curve selection    • Trading

See docs/VISION.md for the complete product vision.


License

MIT License - see LICENSE for details.

Contributing

Contributions welcome! Please read CONTRIBUTING.md for:

  • Test-driven development practices
  • Test pyramid (unit/integration/E2E)
  • Code quality standards
  • Documentation requirements
  • Pre-commit hooks and CI/CD

Built with ❤️ by 0G Labs | Powered by VIBEZ

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 20

Native requirements
20 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
zod
Environment
{
  "local_name": "zod",
  "alias": false,
  "peer_metadata": null
}
^3.23.0runtime
jszip
Environment
{
  "local_name": "jszip",
  "alias": false,
  "peer_metadata": null
}
^3.10.1runtime
ethers
Environment
{
  "local_name": "ethers",
  "alias": false,
  "peer_metadata": null
}
^6.13.0runtime
nanoid
Environment
{
  "local_name": "nanoid",
  "alias": false,
  "peer_metadata": null
}
^5.0.0runtime
@0glabs/0g-ts-sdk
Environment
{
  "local_name": "@0glabs/0g-ts-sdk",
  "alias": false,
  "peer_metadata": null
}
^0.3.3runtime
@0glabs/0g-serving-broker
Environment
{
  "local_name": "@0glabs/0g-serving-broker",
  "alias": false,
  "peer_metadata": null
}
^0.6.6runtime
@modelcontextprotocol/sdk
Environment
{
  "local_name": "@modelcontextprotocol/sdk",
  "alias": false,
  "peer_metadata": null
}
^1.0.0runtime
msw
Environment
{
  "local_name": "msw",
  "alias": false,
  "peer_metadata": null
}
^2.12.7development
tsx
Environment
{
  "local_name": "tsx",
  "alias": false,
  "peer_metadata": null
}
^4.19.0development
husky
Environment
{
  "local_name": "husky",
  "alias": false,
  "peer_metadata": null
}
^9.1.7development
dotenv
Environment
{
  "local_name": "dotenv",
  "alias": false,
  "peer_metadata": null
}
^17.2.3development
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^9.0.0development
vitest
Environment
{
  "local_name": "vitest",
  "alias": false,
  "peer_metadata": null
}
^2.0.0development
@eslint/js
Environment
{
  "local_name": "@eslint/js",
  "alias": false,
  "peer_metadata": null
}
^9.39.2development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.6.0development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^22.0.0development
typescript-eslint
Environment
{
  "local_name": "typescript-eslint",
  "alias": false,
  "peer_metadata": null
}
^8.54.0development
@vitest/coverage-v8
Environment
{
  "local_name": "@vitest/coverage-v8",
  "alias": false,
  "peer_metadata": null
}
^2.1.9development
@typescript-eslint/parser
Environment
{
  "local_name": "@typescript-eslint/parser",
  "alias": false,
  "peer_metadata": null
}
^8.0.0development
@typescript-eslint/eslint-plugin
Environment
{
  "local_name": "@typescript-eslint/eslint-plugin",
  "alias": false,
  "peer_metadata": null
}
^8.0.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "d394ef9785594f9c189bb1235aa418e864309154",
  "tarball": "https://registry.npmjs.org/@0gfoundation/0g-cc/-/0g-cc-1.0.0.tgz",
  "fileCount": 213,
  "integrity": "sha512-2eJG3QItrPg47qmHdcLsT9tWapJxmJX/Cg43c9CcwzBR6KCfHCP5IWj/Egt7XCAIryTD/Xa5m9h451FY6DEp/w==",
  "signatures": [
    {
      "sig": "MEUCIHw3H2xEWLUzCci2yPCTzWvytnWsX+EawYn2fixr25EVAiEA+3dhfXv6a69Z7ygpGXwvNLDTrJHIj67UiuDOnK4jS48=",
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
    }
  ],
  "unpackedSize": 960423
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:11 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:0bbe7a354d7bcc2f8bb6a10f267bdeb2273adc0b67d0a1ba7172598a2f7ea87e

Other collected versions

1.0.230 JanView all collected versions →