Observed since 20 Oct, 22:11 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0gfoundation/0g-cc
0G Code to Coin - MCP server for decentralized AI compute and storage on 0G Network
Decentralized AI Coding Assistant - MCP server bridging 0G's decentralized compute network for AI inference, fine-tuning, storage, and VIBEZ token marketplace.
0G Code to Coin enables AI assistants like Claude Code, Cursor, and Windsurf to leverage 0G's decentralized AI infrastructure:
New to 0G? Check out the User Guide for a complete walkthrough with natural language examples.
npm install @0gfoundation/0g-cc
# 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
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
By default, logs are written to stderr. For debugging or monitoring, you can configure file logging:
| Variable | Description | Default |
|---|---|---|
LOG_FILE | Path to write logs (in addition to stderr) | Not set (stderr only) |
LOG_LEVEL | Minimum log level: debug, info, warn, error | info |
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"
}
}
}
}
| Tool | Status | Description |
|---|---|---|
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 |
| Tool | Status | Description |
|---|---|---|
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 |
| Tool | Status | Description |
|---|---|---|
finetune_create | ❌ | Start a fine-tuning job |
finetune_status | ❌ | Check job status |
finetune_list | ❌ | List fine-tuned models |
| Tool | Status | Description |
|---|---|---|
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 |
| Tool | Status | Description |
|---|---|---|
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 |
| Tool | Status | Description |
|---|---|---|
zerog_explain | 🔮 | Explain any 0G concept |
zerog_docs | 🔮 | Fetch specific documentation |
zerog_examples | 🔮 | Show code examples |
zerog_best_practices | 🔮 | Get recommended patterns |
| Tool | Status | Description |
|---|---|---|
wallet_status | 🔮 | Check current wallet connection |
wallet_connect | 🔮 | Connect via WalletConnect |
wallet_balance | 🔮 | Check 0G balance |
wallet_transactions | 🔮 | View recent transactions |
| Tool | Status | Description |
|---|---|---|
system_ping | ✅ | Health check |
system_session_info | ❌ | Get detailed session info |
system_switch_network | ❌ | Switch network |
Legend: ✅ Implemented | ⚠️ Partial | ❌ Planned | 🔮 Future Vision
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
| Provider | Input $/MTok | Output $/MTok | vs Cloud |
|---|---|---|---|
| 0G DeepSeek V3 | $0.30 | $0.48 | -90% |
| 0G Qwen 7B | $0.05 | $0.10 | -97% |
| Claude Sonnet (Cloud) | $3.00 | $15.00 | baseline |
Example: 1M tokens of coding assistance
┌─────────────────────────────────────────────────────────────────┐
│ 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 │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
npm install
npm run build
npm run start:dev
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)
Foundation: Basic MCP server with 0G compute
compute_inference toolcompute_list_providers toolsystem_ping tool@0glabs/0g-serving-broker)Strategic priority: Features that differentiate from competitors
Inference Receipts
Hybrid Routing
Response Caching
Infrastructure
Complete the compute toolkit
Cost Management
compute_estimate_cost - Estimate before runningcompute_set_preferences - User routing configLedger Integration
compute_get_balance - Check 0G balancecompute_deposit - Add funds to ledgerTEE Features
0G decentralized storage for AI workflows
Core Storage
storage_upload - Upload files to 0Gstorage_download - Download from 0Gstorage_list - List user's filesstorage_info - Real SDK integration (replace mock)storage_delete - Remove filesAI Workflow Integration
Complete the 0G compute suite
Fine-tuning
finetune_create - Start fine-tuning jobsfinetune_status - Check job progressfinetune_list - List fine-tuned modelsfinetune_deploy - Deploy fine-tuned modelSystem Tools
system_session_info - Detailed session infosystem_switch_network - Network switching (testnet/mainnet)Enable vibecoders to launch tokens for their apps
Launch Tools
vibez_launch_wizard - Guided token creation
vibez_launch_quick - Quick launch for experienced users
vibez_estimate_fees - Show expected trading feesvibez_preview_curve - Interactive curve previewLaunch 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
Full marketplace integration: read, trade, earn
Market Data
vibez_get_token - Token details (price, mcap, health, volume)vibez_trending - Trending tokens listvibez_search - Search by name, category, creatorvibez_health_check - Check app health statusTrading
vibez_quote - Get price quote before tradingvibez_buy - Buy tokens with slippage protectionvibez_sell - Sell tokensvibez_portfolio - View all holdings with P&LCreator Dashboard
vibez_my_tokens - List tokens you createdvibez_earnings - See creator fee earningsvibez_health_alerts - Alerts for struggling tokensvibez_fund_compute - Add funds to compute treasuryExample 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"
Built-in 0G expertise for vibecoders
Knowledge Tools
zerog_explain - Explain any 0G concept
zerog_docs - Fetch specific documentationzerog_examples - Show code exampleszerog_best_practices - Recommended patternsProactive Education
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?"
Multiple auth methods for different use cases
Wallet Tools
wallet_status - Current connection statuswallet_balance - Check 0G balancewallet_connect - WalletConnect integrationwallet_transactions - Recent transaction historyAuth Methods
Onboarding Flow
Production-ready vibecoder toolkit
Polish
Analytics
Enterprise
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.
MIT License - see LICENSE for details.
Contributions welcome! Please read CONTRIBUTING.md for:
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
zodEnvironment{
"local_name": "zod",
"alias": false,
"peer_metadata": null
} | ^3.23.0 | runtime |
jszipEnvironment{
"local_name": "jszip",
"alias": false,
"peer_metadata": null
} | ^3.10.1 | runtime |
ethersEnvironment{
"local_name": "ethers",
"alias": false,
"peer_metadata": null
} | ^6.13.0 | runtime |
nanoidEnvironment{
"local_name": "nanoid",
"alias": false,
"peer_metadata": null
} | ^5.0.0 | runtime |
@0glabs/0g-ts-sdkEnvironment{
"local_name": "@0glabs/0g-ts-sdk",
"alias": false,
"peer_metadata": null
} | ^0.3.3 | runtime |
@0glabs/0g-serving-brokerEnvironment{
"local_name": "@0glabs/0g-serving-broker",
"alias": false,
"peer_metadata": null
} | ^0.6.6 | runtime |
@modelcontextprotocol/sdkEnvironment{
"local_name": "@modelcontextprotocol/sdk",
"alias": false,
"peer_metadata": null
} | ^1.0.0 | runtime |
mswEnvironment{
"local_name": "msw",
"alias": false,
"peer_metadata": null
} | ^2.12.7 | development |
tsxEnvironment{
"local_name": "tsx",
"alias": false,
"peer_metadata": null
} | ^4.19.0 | development |
huskyEnvironment{
"local_name": "husky",
"alias": false,
"peer_metadata": null
} | ^9.1.7 | development |
dotenvEnvironment{
"local_name": "dotenv",
"alias": false,
"peer_metadata": null
} | ^17.2.3 | development |
eslintEnvironment{
"local_name": "eslint",
"alias": false,
"peer_metadata": null
} | ^9.0.0 | development |
vitestEnvironment{
"local_name": "vitest",
"alias": false,
"peer_metadata": null
} | ^2.0.0 | development |
@eslint/jsEnvironment{
"local_name": "@eslint/js",
"alias": false,
"peer_metadata": null
} | ^9.39.2 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^5.6.0 | development |
@types/nodeEnvironment{
"local_name": "@types/node",
"alias": false,
"peer_metadata": null
} | ^22.0.0 | development |
typescript-eslintEnvironment{
"local_name": "typescript-eslint",
"alias": false,
"peer_metadata": null
} | ^8.54.0 | development |
@vitest/coverage-v8Environment{
"local_name": "@vitest/coverage-v8",
"alias": false,
"peer_metadata": null
} | ^2.1.9 | development |
@typescript-eslint/parserEnvironment{
"local_name": "@typescript-eslint/parser",
"alias": false,
"peer_metadata": null
} | ^8.0.0 | development |
@typescript-eslint/eslint-pluginEnvironment{
"local_name": "@typescript-eslint/eslint-plugin",
"alias": false,
"peer_metadata": null
} | ^8.0.0 | development |
Source distribution
{
"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
}Observed since 20 Oct, 22:11 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:0bbe7a354d7bcc2f8bb6a10f267bdeb2273adc0b67d0a1ba7172598a2f7ea87e