0g-mcp-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@0g-mcp-serverWhat's the current gas price on 0G network?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
0G MCP Server 🚀
A Model Context Protocol (MCP) server for seamless AI agent integration with the 0G blockchain network. This server enables AI assistants to query blockchain data, check balances, retrieve transactions, and perform blockchain operations through natural language.
🌟 Tested and Production Ready - Successfully connects to live 0G testnet with real-time data
✨ Features
🔍 Balance Queries - Check wallet balances on 0G mainnet/testnet
📊 Transaction Lookup - Get detailed transaction information by hash
🧱 Block Information - Retrieve block details by number or hash
📈 Network Statistics - Live gas prices and network metrics
⛽ Gas Estimation - Calculate transaction costs
🌐 Multi-network Support - Seamless mainnet/testnet switching
🤖 AI-First Design - Built specifically for AI agent interactions
Related MCP server: Ethereum RPC MPC Server
🚀 Quick Start
Prerequisites
Node.js 18+
npm or yarn
An MCP-compatible client (Claude Desktop, etc.)
1. Installation
# Clone the repository
git clone https://github.com/yourusername/0g-mcp-server.git
cd 0g-mcp-server
# Install dependencies
npm install
# Build the project
npm run build2. Test the Server
# Run the test suite
node test-server.js
# Expected output:
# ✅ Server initialization successful
# ✅ All 5 blockchain tools registered
# ✅ Live connection to 0G testnet confirmed3. Configure Your MCP Client
For Claude Desktop:
Open your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%/Claude/claude_desktop_config.json
Add the 0G MCP server:
{
"mcpServers": {
"0g-blockchain": {
"command": "node",
"args": ["/full/path/to/0g-mcp-server/dist/index.js"]
}
}
}Restart Claude Desktop
For Other MCP Clients:
Refer to your client's documentation for MCP server configuration.
4. Start Using!
Once configured, you can interact with the 0G blockchain through natural language:
"Check the balance of address 0x1234... on 0G testnet"
"Get details for transaction 0xabcd... on 0G mainnet"
"What's the current gas price on 0G network?"
"Show me block 4259504 information"🛠️ Available Tools
Tool | Description | Required Parameters | Optional Parameters |
| Get wallet balance |
|
|
| Transaction details by hash |
|
|
| Block information |
|
|
| Network statistics | - |
|
| Gas cost estimation |
|
|
💡 Usage Examples
Development Mode
npm run devProduction Mode
npm startManual Testing
# Test specific functionality
node test-server.js
# Check server health
curl -X POST http://localhost:3000/health🌐 Network Configuration
Network | RPC Endpoint | Chain ID | Explorer |
Mainnet |
| TBD | |
Testnet |
| TBD |
🔧 Advanced Configuration
Environment Variables
Create a .env file for custom configuration:
# Custom RPC endpoints (optional)
ZG_MAINNET_RPC=https://your-custom-mainnet-rpc.com
ZG_TESTNET_RPC=https://your-custom-testnet-rpc.com
# Default network
DEFAULT_NETWORK=testnet
# Request timeout (ms)
REQUEST_TIMEOUT=30000Custom Client Integration
import { ZGMCPServer } from './src/index.js';
const server = new ZGMCPServer({
defaultNetwork: 'mainnet',
customRpcEndpoints: {
mainnet: 'https://your-rpc.com',
testnet: 'https://your-testnet-rpc.com'
}
});
await server.run();🧪 Testing
The server includes comprehensive testing:
# Run all tests
npm test
# Test specific functionality
node test-server.js
# Test with live network
npm run test:liveTest Coverage:
✅ MCP protocol compliance
✅ All blockchain tools
✅ Network connectivity
✅ Error handling
✅ Live data retrieval
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
# Fork and clone the repo
git clone https://github.com/yourusername/0g-mcp-server.git
# Install dependencies
npm install
# Start development server
npm run dev
# Run tests
npm test📚 About 0G Network
0G is a modular AI-first blockchain that revolutionizes decentralized AI:
🧠 AI-Optimized Storage - Ultra-low cost data storage for AI models
⚡ High-Performance Execution - Scalable compute for AI workloads
🔒 Trustless AI Inference - Cryptographically verifiable AI operations
🏗️ Modular Architecture - Pick only the components you need
Learn More:
📄 License
MIT License - see LICENSE file for details.
🆘 Support
🐛 Issues: GitHub Issues
💬 Discussions: GitHub Discussions
📧 Email: support@yourproject.com
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
AlicenseCqualityCmaintenanceAn MCP server providing unified access to blockchain operations, bridging, swapping, and crypto trading strategies for AI agents.Last updated37178GPL 3.0- Alicense-qualityDmaintenanceAn MCP server that bridges AI models with Ethereum blockchains via all JSON-RPC calls, enabling natural language queries for block numbers, balances, transactions, and smart contract data.Last updated821MIT
- Alicense-qualityDmaintenanceProduction-ready MCP server for 0G Chain blockchain operations, enabling wallet creation, balance checks, token transfers, staking, and validator discovery through natural language.Last updatedMIT
- Alicense-qualityBmaintenanceA local MCP server that enables AI tools to query Obyte blockchain data including balances, units, autonomous agent state and dry runs, and token symbols, supporting both mainnet and testnet.Last updated19MIT
Related MCP Connectors
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/opencolin/0g-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server