mcp-wtit
Version:
A Model Context Protocol (MCP) server that provides current time in ISO8601 format with timezone support
44 lines • 1.39 kB
JavaScript
import { TimeService } from '../domain/services/time.service.js';
import { GetCurrentTimeUseCase } from '../application/usecases/get-current-time.usecase.js';
import { TimeServer } from '../infrastructure/mcp/time.server.js';
export class Container {
static instance;
_timeService = null;
_getCurrentTimeUseCase = null;
_timeServer = null;
constructor() {
// Private constructor for singleton pattern
}
static getInstance() {
if (!Container.instance) {
Container.instance = new Container();
}
return Container.instance;
}
get timeService() {
if (!this._timeService) {
this._timeService = new TimeService();
}
return this._timeService;
}
get getCurrentTimeUseCase() {
if (!this._getCurrentTimeUseCase) {
this._getCurrentTimeUseCase = new GetCurrentTimeUseCase(this.timeService);
}
return this._getCurrentTimeUseCase;
}
get timeServer() {
if (!this._timeServer) {
this._timeServer = new TimeServer({
getCurrentTimeUseCase: this.getCurrentTimeUseCase,
});
}
return this._timeServer;
}
reset() {
this._timeService = null;
this._getCurrentTimeUseCase = null;
this._timeServer = null;
}
}
//# sourceMappingURL=container.js.map