MCP server
src/index.ts registers tools, resources, schemas, service selection, and stdio lifecycle handling.
A TypeScript application with two transports over shared blockchain, contract, wallet, validation, logging, and rate-limit services.
MCP client --stdio--> src/index.ts -----------+
|
HTTP client --HTTP--> src/http-server.ts ------+--> NeoService --> Neo RPC
+--> ContractService --> Neo RPC / optional N3Index lookup
+--> WalletService --> WALLETS_DIR
+--> validation, rate limiting, logging
The MCP entrypoint uses the Model Context Protocol SDK over stdio. The HTTP entrypoint exposes a REST-style adapter but reuses the same core services.
src/index.ts registers tools, resources, schemas, service selection, and stdio lifecycle handling.
src/http.ts resolves one network, validates host security, constructs services, and handles shutdown.
src/http-server.ts implements routes, bearer authentication, CORS allowlisting, JSON limits, health, and metrics.
src/services/neo-service.ts owns deadline-bounded RPC queries, transaction construction, fees, transfer history, and application-log enrichment.
src/contracts/contract-service.ts resolves generic references, verifies deployment, inspects manifests, and executes contract calls.
src/services/wallet-service.ts creates, imports, encrypts, persists, and sanitizes wallet records.
src/handlers/ implements tool and resource behavior shared by registrations and transports.
src/utils/ contains validation, errors, structured logging, log rotation, and process-local rate limiting.
/live and /health when a key is configured.confirm as the JSON boolean true.WALLETS_DIR with restrictive directory and file modes.| Component | Current baseline |
|---|---|
| Node.js | 22 or newer; CI also tests 24 |
| TypeScript | 5.9 |
| MCP SDK | 1.29 |
| Neo SDK | @cityofzion/neon-js 5.9 |
| Validation | Zod 3.25 plus project validation helpers |
| Testing | Jest 29 with ts-jest |
| Containers | Node.js 22 Alpine, multi-stage production build |
/live, RPC-aware /health, and a small Prometheus-text-compatible /metrics response. It does not include a collector, dashboard, alerting system, tracing backend, cache layer, connection pool, circuit breaker, or cloud orchestration manifest.