Midnight MCP Server
A Model Context Protocol (MCP) server implementation with STDIO transport for the Midnight network.
Overview
This server implements the Model Context Protocol for integration with the Midnight cryptocurrency network. It provides a standard interface for AI models to interact with the Midnight blockchain, wallet functionality, and other network services.
The architecture consists of two main components:
- Wallet Server (
server.ts
) - An Express.js HTTP server that runs the wallet logic and exposes REST API endpoints - STDIO Server (
stdio-server.ts
) - An MCP-compliant server that acts as a proxy, forwarding tool calls to the wallet server via HTTP requests
Quick Start
Prerequisites
- Node.js (v18.20.5)
- Yarn package manager
- Docker and Docker Compose (for production deployment)
Basic Setup
Note: The setup scripts support both hex seeds (32-byte entropy) and BIP39 mnemonic phrases. The hex seed is the actual entropy used by the Midnight wallet, while the mnemonic is a human-readable representation of the same cryptographic material.
For detailed setup instructions, see docs/setup-guide.md.
Project Structure
Architecture
The Midnight MCP server follows a layered architecture:
- MCP Protocol Layer: STDIO server implementing the Model Context Protocol
- HTTP Communication Layer: HTTP client for wallet server communication
- Wallet Server Layer: Express.js server with wallet logic and REST API
- Storage Layer: File-based storage for seeds, transactions, and backups
- External Services: Integration with Midnight blockchain services
For detailed architecture diagrams and API flows, see docs/system-design.md.
Documentation
For complete documentation, including setup guides, API reference, testing, and integration examples, see docs/index.md.
License
This project is licensed under the MIT License.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
An MCP server with comprehensive CI/CD workflows including unit tests, integration tests, and end-to-end validation. Features automated testing across multiple Node.js versions with coverage reporting and linting validation.