midnight-devnet-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
@aaronbassett/midnight-local-devnet
A CLI and MCP (Model Context Protocol) server for managing a local Docker-based Midnight development network. It spins up a Midnight node, indexer, and proof server in Docker containers, initializes a genesis master wallet pre-loaded with NIGHT tokens and DUST, and provides commands to fund test accounts, generate wallets, and monitor network health -- all from the command line or from any MCP-compatible AI assistant.
Prerequisites
Node.js >= 22
Docker (Docker Desktop or Docker Engine with Compose v2)
Related MCP server: Docker MCP Server
Quick Start
CLI
Start the network:
npx @aaronbassett/midnight-local-devnet startOpen the dashboard in your browser to monitor your devnet:
npx @aaronbassett/midnight-local-devnet dashboardMCP Server
Add to your MCP client configuration (Claude Code, Cursor, Windsurf, etc.):
{
"mcpServers": {
"midnight-devnet": {
"command": "npx",
"args": ["-y", "-p", "@aaronbassett/midnight-local-devnet", "midnight-devnet-mcp"]
}
}
}The MCP server communicates over stdio and exposes tools and resources that an AI assistant can use to manage the devnet on your behalf.
CLI Command Reference
All commands can be run via npx @aaronbassett/midnight-local-devnet <command>.
Global Options
Option | Description |
| Output results as machine-parseable JSON on stdout |
| Show version number |
| Show help |
When --json is active, only valid JSON is written to stdout. All progress messages and logs are redirected to stderr so the output can be piped directly to tools like jq.
Commands
Command | Description | Options |
| Start the local Midnight devnet |
|
| Stop the devnet |
|
| Restart the network |
|
| Show network status and per-service info | |
| Show network service logs |
|
| Check health of all services | |
| Show master wallet NIGHT/DUST balances | |
| Fund a Bech32 address with NIGHT tokens |
|
| Fund all accounts from an accounts.json file | |
| Generate random test accounts |
|
| Open browser dashboard |
|
| Start interactive menu mode |
Running with no arguments displays help.
JSON Output
Use the --json flag for scripting and automation:
# Get network status as JSON
npx @aaronbassett/midnight-local-devnet status --json
# Pipe to jq for filtering
npx @aaronbassett/midnight-local-devnet health --json | jq '.allHealthy'
# Generate accounts and capture output
npx @aaronbassett/midnight-local-devnet generate-accounts --count 3 --json > accounts.jsonErrors in --json mode produce {"error": "message"} on stdout with a non-zero exit code.
Dashboard
The dashboard command starts a local server and opens a browser-based dashboard that displays the state of all local devnet services in real time.
npx @aaronbassett/midnight-local-devnet dashboardThis starts a server on http://localhost:31780 and opens your default browser. Press Ctrl+C in the terminal to stop.
Options:
--port <n>-- Use a specific port (default: 31780, auto-increments if in use)--no-open-- Start the server without opening the browser
The dashboard shows:
Node -- Block height, average block time, chain, peers, sync status, version
Indexer -- Ready status, response time
Proof Server -- Version, proof versions, job processing/pending/capacity gauge
Wallet -- Master wallet NIGHT (unshielded + shielded) and DUST balances
Response Times -- SVG sparkline charts of per-service response times
Logs -- Combined color-coded log stream from all services, filterable by service, level, or text search
The dashboard connects to the server via WebSocket for live updates. If the connection drops, it auto-reconnects. You can start and stop the network directly from the dashboard using the action buttons.
The layout is responsive and adapts to your browser window width.
MCP Tool Reference
Tool | Description | Parameters |
| Start the devnet (node, indexer, proof-server) |
|
| Stop the devnet and close wallets |
|
| Restart the network |
|
| Get current network and per-service status | |
| Get recent logs from services |
|
| Check health of all service endpoints | |
| Get endpoint URLs, network ID, image versions | |
| Get NIGHT and DUST balances of master wallet | |
| Transfer NIGHT to a Bech32 address |
|
| Derive wallet from mnemonic, fund NIGHT, register DUST |
|
| Batch fund accounts from accounts.json |
|
| Generate random test accounts |
|
MCP Resource Reference
URI | Description |
| Current network configuration: endpoints, network ID, Docker image versions |
| Live network status including per-service container state |
Resources are read-only and can be accessed by any MCP client to display context to an AI assistant.
accounts.json Format
The fund-file CLI command and fund-accounts-from-file MCP tool accept a JSON file describing accounts to fund. Each account is identified by a mnemonic; the tool derives its wallet, transfers NIGHT tokens, and registers DUST.
{
"accounts": [
{
"name": "Alice",
"mnemonic": "abandon abandon abandon ... art"
},
{
"name": "Bob",
"mnemonic": "zoo zoo zoo ... vote"
}
]
}See accounts.example.json for a complete example with valid 24-word BIP39 mnemonics.
Each account entry requires:
name -- A display label for the account.
mnemonic -- A 24-word BIP39 mnemonic phrase.
Docker Services
The devnet runs three containers managed via Docker Compose:
Service | Container Name | Image | Port | URL |
Node | midnight-node |
| 9944 |
|
Indexer | midnight-indexer |
| 8088 |
|
Proof Server | midnight-proof-server |
| 6300 |
|
The indexer also exposes a WebSocket endpoint at ws://127.0.0.1:8088/api/v3/graphql/ws.
The network ID is undeployed (development mode).
Network Endpoints for DApp Development
When connecting a Midnight DApp to the local devnet, use the following configuration:
const config = {
indexer: 'http://127.0.0.1:8088/api/v3/graphql',
indexerWS: 'ws://127.0.0.1:8088/api/v3/graphql/ws',
node: 'http://127.0.0.1:9944',
proofServer: 'http://127.0.0.1:6300',
networkId: 'undeployed',
};You can also retrieve this configuration at runtime via the get-network-config MCP tool or the devnet://config MCP resource.
Development
To work on this project locally:
git clone https://github.com/devrelaicom/midnight-local-devnet.git
cd midnight-local-devnet
npm install
npm run buildRun the CLI from source:
node --enable-source-maps dist/cli.js startRun the MCP server from source:
node --enable-source-maps dist/index.jsRun tests:
npm testTroubleshooting
Docker containers fail to start
Make sure Docker is running and your user has permissions to use it:
docker infoIf you see a permission error, add your user to the docker group or use sudo.
Port conflicts
The devnet uses ports 9944, 8088, and 6300. If another process is using one of these ports, stop it before starting the devnet:
lsof -i :9944
lsof -i :8088
lsof -i :6300Containers are unhealthy
Run the health check to see which service is not responding:
npx @aaronbassett/midnight-local-devnet healthCheck the logs for the failing service:
npx @aaronbassett/midnight-local-devnet logs --service node
npx @aaronbassett/midnight-local-devnet logs --service indexer
npx @aaronbassett/midnight-local-devnet logs --service proof-serverClean restart
If the network is in a broken state, do a clean restart that removes all volumes:
npx @aaronbassett/midnight-local-devnet restart --remove-volumesThis removes all chain data and starts fresh.
Wallet sync takes too long
The master wallet must synchronize with the chain on first start. This can take 10--30 seconds depending on your machine. The CLI and MCP server wait for synchronization automatically.
"Network is not running" error
The tool detects running containers on startup. If you stopped the containers externally (e.g. via docker compose down), run start again:
npx @aaronbassett/midnight-local-devnet startAcknowledgments
This project is based on midnight-local-network by @hbulgarini. Thank you for the initial version that made this possible.
License
MIT
This project extends the Midnight Network with additional developer tooling.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Private networking for AI agents: networks, nodes, commands, files, services via hosted MCP.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Remote MCP server for AI.TV creators — delegate account operations to your AI agent over MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceAllows Claude and other AI assistants to interact with Docker through the MCP protocol, enabling container and image management including listing, running, stopping, and pulling Docker resources.64MIT
- AlicenseAqualityCmaintenanceUniversal Docker MCP server for AI assistants (Cursor, Claude Desktop). Manage Docker containers, execute commands, query databases, and handle environment configurations — all through natural language.10228 npm1MIT
- AlicenseBqualityCmaintenanceEnables AI agents to manage Docker containers, images, Compose stacks, health checks, and logs through a unified MCP interface, ensuring containers stay running with self-healing capabilities.31119 npm4MIT
- AlicenseNot gradedqualityDmaintenanceMCP server exposing the Dockhand API as MCP tools. Enables AI assistants to manage Docker infrastructure including containers, stacks, images, networks, and volumes across multiple hosts.MIT