$ -weight: 500;">npm -weight: 500;">install -g midnight-mcp
-weight: 500;">npm -weight: 500;">install -g midnight-mcp
-weight: 500;">npm -weight: 500;">install -g midnight-mcp
-weight: 500;">npm -weight: 500;">install --save-dev midnight-mcp
-weight: 500;">npm -weight: 500;">install --save-dev midnight-mcp
-weight: 500;">npm -weight: 500;">install --save-dev midnight-mcp
midnight-mcp --version
midnight-mcp --version
midnight-mcp --version
# Add to ~/.zshrc or ~/.bashrc
export PATH="$(-weight: 500;">npm root -g)/../bin:$PATH"
# Add to ~/.zshrc or ~/.bashrc
export PATH="$(-weight: 500;">npm root -g)/../bin:$PATH"
# Add to ~/.zshrc or ~/.bashrc
export PATH="$(-weight: 500;">npm root -g)/../bin:$PATH"
{ "mcpServers": { "midnight": { "command": "midnight-mcp", "args": [], "env": { "MIDNIGHT_PROJECT_ROOT": "/path/to/your/midnight/project" } } }
}
{ "mcpServers": { "midnight": { "command": "midnight-mcp", "args": [], "env": { "MIDNIGHT_PROJECT_ROOT": "/path/to/your/midnight/project" } } }
}
{ "mcpServers": { "midnight": { "command": "midnight-mcp", "args": [], "env": { "MIDNIGHT_PROJECT_ROOT": "/path/to/your/midnight/project" } } }
}
{ "mcpServers": { "midnight": { "command": "node", "args": ["/path/to/your/project/node_modules/.bin/midnight-mcp"] } }
}
{ "mcpServers": { "midnight": { "command": "node", "args": ["/path/to/your/project/node_modules/.bin/midnight-mcp"] } }
}
{ "mcpServers": { "midnight": { "command": "node", "args": ["/path/to/your/project/node_modules/.bin/midnight-mcp"] } }
}
pragma language_version >= 0.14.0; import CompactStandardLibrary; export ledger counter: Cell<Uint<64>>; export circuit increment(new_value: Uint<64>): [] { assert counter.value < new_value "Counter must increase"; counter.value = new_value;
} export circuit get_count(): Uint<64> { return counter.value;
}
pragma language_version >= 0.14.0; import CompactStandardLibrary; export ledger counter: Cell<Uint<64>>; export circuit increment(new_value: Uint<64>): [] { assert counter.value < new_value "Counter must increase"; counter.value = new_value;
} export circuit get_count(): Uint<64> { return counter.value;
}
pragma language_version >= 0.14.0; import CompactStandardLibrary; export ledger counter: Cell<Uint<64>>; export circuit increment(new_value: Uint<64>): [] { assert counter.value < new_value "Counter must increase"; counter.value = new_value;
} export circuit get_count(): Uint<64> { return counter.value;
}
npx compactc src/myContract.compact
npx compactc src/myContract.compact
npx compactc src/myContract.compact
Error: type mismatch: expected Field, got Uint<64> at line 12
Error: type mismatch: expected Field, got Uint<64> at line 12
Error: type mismatch: expected Field, got Uint<64> at line 12
-weight: 500;">npm -weight: 500;">install -g midnight-mcp
-weight: 500;">npm -weight: 500;">install -g midnight-mcp
-weight: 500;">npm -weight: 500;">install -g midnight-mcp - Read and understand Compact contract source files
- Access Midnight API documentation and type definitions
- Scaffold new Compact contracts from templates
- Query ledger state or contract deployment information
- Provide context-aware suggestions for ZK circuit design - Node.js 18+ (the Midnight SDK requires modern Node)
- -weight: 500;">npm or yarn package manager
- Claude Desktop app or another MCP-compatible Claude interface
- Basic familiarity with Compact — Midnight's smart contract language
- (Optional) An existing Midnight project created with npx @midnight-ntwrk/midnight-js-cli - macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: %APPDATA%\Claude\claude_desktop_config.json
- Linux: ~/.config/Claude/claude_desktop_config.json - Token contracts (mint/burn/transfer)
- Access control contracts
- Private voting contracts
- Escrow patterns with ZK proofs - Keep contracts small and focused — Claude (and ZK proofs) handle simpler, single-purpose circuits better than monolithic contracts.
- Always review generated code — AI scaffolding gives you a fast starting point, but the security implications of ZK circuit design require human review.
- Ask Claude to explain, not just generate — "Explain why this circuit constraint is needed" builds your own understanding.
- Use Claude for documentation — "Write Compact-style doc comments for this circuit" can save significant time.
- Feed errors immediately — The most value comes from pasting compiler or proof errors directly into the Claude session while midnight-mcp has file context. - Context-aware contract scaffolding
- Live access to Midnight SDK documentation
- Intelligent debugging assistance for Compact type errors and ZK proof failures
- A dramatically faster iteration cycle