Skip to main content

Installation

Prerequisites

  • Node.js 18.0 or higher
  • npm, yarn, pnpm, or bun package manager
  • Access to 0G Galileo testnet

Package Installation

Clone the repository and install dependencies:

Building the Server

Compile the TypeScript source code:
This creates the compiled JavaScript files in the dist/ directory.

Environment Configuration

Create a .env file in the project root:
Edit the .env file with your configuration:

Environment Variables

Running the Server

Development Mode

For development with auto-reload:

Production Mode

For production deployment:

Integration with Claude Desktop

To use this MCP server with Claude Desktop, you need to configure it in Claude’s settings.

Configuration File Locations

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

Configuration Setup

Add the following to your claude_desktop_config.json:
Replace /path/to/your/mcp-0g with the actual path to your project directory.

Alternative: Using npx

If you prefer to use npx (after publishing to npm):

Node.js Version Compatibility

Ensure you’re using Node.js v18+ for compatibility. You can create a wrapper script if needed:
Then use the wrapper in your configuration:

Verification

After setup, restart Claude Desktop and verify the integration:
  1. Look for the 🔌 icon in the Claude chat interface
  2. You should see “0g-chain” in the list of available MCP servers
  3. Test the connection by asking Claude to interact with the 0G testnet

Test Commands

Try these commands in Claude to verify functionality:

Troubleshooting

Common Issues

  1. Server not starting: Check Node.js version and dependencies
  2. Claude not connecting: Verify configuration file path and syntax
  3. Permission errors: Ensure proper file permissions for the server executable

Debug Mode

Enable debug logging by setting environment variables:

Log Files

Check server logs for detailed error information:

Next Steps

Once installed, explore the features and available tools to understand what you can do with the MCP 0G server.