Get the FREE Ultimate OpenClaw Setup Guide →

mcp-nexus

An MCP Server for the Nexus blockchain

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio nexus-xyz-mcp-nexus-server node server.js \
  --env PORT="Port to run the MCP server (default 3000)" \
  --env REDIS_URL="Redis connection string for SSE transport (e.g., redis://localhost:6379)"

How to use

The Nexus MCP Server exposes Nexus blockchain functionality through the Model Context Protocol (MCP), making common blockchain operations accessible to any MCP-enabled AI system. It provides tools for querying network data, balances, blocks, and logs, as well as interacting with smart contracts and submitting transactions. This enables AI agents to reason about on-chain state and perform actions on the Nexus network in a structured, tool-based way. You can connect to the server with a standard MCP client and discover the available tools, then invoke them with the appropriate arguments.

Once running, you can list available tools, inspect their input schemas, and call specific tools such as getNetworkInfo, getBalance, getBlock, callContract, getLogs, and sendRawTransaction. The included test client demonstrates connecting over SSE transport and exercising several tools. For integration with AI systems like Claude or other MCP-capable agents, you can fetch tool definitions, present them to the agent, and handle tool calls by routing the input to the mcp client and returning results back to the agent.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Git installed
  • Optional Redis installed and running if you plan to use Server-Sent Events (SSE) transport

Installation steps:

  1. Clone the repository git clone https://github.com/nexus/mcp-for-nexus cd mcp-for-nexus

  2. Install dependencies npm install

  3. Configure environment

    • Copy example env file (if provided) and customize as needed cp .env.example .env
    • Ensure Redis is running if using SSE transport:

      macOS (with Homebrew)

      brew install redis brew services start redis redis-cli ping # should return PONG
  4. Start the server npm run dev

  5. Verify the server is up curl http://localhost:3000/health

If you prefer a different deployment method, ensure the entry point (server.js) is correctly referenced and the necessary environment variables are supplied (e.g., REDIS_URL).

Additional notes

Notes and tips:

  • The server exposes tools such as getNetworkInfo, getBalance, getBlock, callContract, getLogs, and sendRawTransaction. Review tool definitions to understand required input schemas.
  • For production deployments, configure Redis for SSE transport and consider enabling Fluid Compute for long-running operations.
  • Environment variables to consider: REDIS_URL for SSE, PORT for the HTTP server, and any Nexus-specific settings required by your deployment.
  • If you encounter port conflicts, adjust the PORT value in the environment configuration.
  • The CLI and client examples in the README assume a standard Node.js setup; adapt paths if you relocate the server entry file.

Related MCP Servers

Sponsor this space

Reach thousands of developers