@172ai/containers-mcp-server
Version: 
MCP server for 172.ai container management platform - enables AI assistants to manage containers, builds, and files with comprehensive workflow prompts
415 lines • 10 kB
TypeScript
export interface MCPServerConfig {
    baseUrl: string;
    apiKey?: string;
    oauthToken?: string;
    clientId?: string;
    clientSecret?: string;
    environment: 'development' | 'production' | 'test';
    logLevel: 'error' | 'warn' | 'info' | 'debug';
    streaming?: {
        enableDebug: boolean;
        verboseLogging: boolean;
        enableUserNotifications?: boolean;
        autoSubscribeOnInit?: boolean;
        autoDisplayLogs?: boolean;
        logBufferSize?: number;
        logBatchInterval?: number;
        streamExtendInterval?: number;
    };
    rateLimits: {
        requestsPerMinute: number;
        requestsPerHour: number;
    };
    timeouts: {
        request: number;
        connect: number;
    };
    retryConfig: {
        maxRetries: number;
        backoffMultiplier: number;
        maxBackoffMs: number;
    };
    security: {
        validateCertificates: boolean;
        allowedScopes: string[];
    };
}
export interface AuthTokenResponse {
    access_token: string;
    token_type: string;
    expires_in: number;
    refresh_token?: string;
    scope?: string;
}
export interface ApiKeyInfo {
    id: string;
    name: string;
    scope: string[];
    isActive: boolean;
    createdAt: string;
    lastUsed?: string;
    expiresAt?: string;
}
export interface Container {
    id: string;
    name: string;
    description: string;
    dockerfile: string;
    tags: string[];
    isPrivate: boolean;
    createdAt: string;
    updatedAt: string;
    userId: string;
    envVars?: Record<string, string>;
    buildConfig?: BuildConfig;
    longDescription?: string;
    capabilities?: string[];
    useCases?: string[];
    installationInstructions?: string;
    documentationLink?: string;
    repoUrl?: string;
    iconUrl?: string;
    author?: string;
    defaultPorts?: number[];
    version?: number;
    rating?: number;
    popularity?: number;
    executionCount?: number;
}
export interface ContainerListResponse {
    containers: Container[];
    total: number;
    page: number;
    limit: number;
    hasMore: boolean;
}
export interface CreateContainerRequest {
    name: string;
    description: string;
    dockerfile: string;
    tags?: string[];
    isPrivate?: boolean;
    envVars?: Array<{
        key: string;
        value: string;
    }>;
    longDescription?: string;
    capabilities?: string[];
    useCases?: string[];
    installationInstructions?: string;
    documentationLink?: string;
    repoUrl?: string;
    iconUrl?: string;
    author?: string;
    defaultPorts?: number[];
}
export interface BuildConfig {
    context: string;
    dockerfile: string;
    buildArgs?: Record<string, string>;
    target?: string;
}
export interface BuildStatus {
    id: string;
    containerId: string;
    status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled' | 'queued' | 'working' | 'in_progress' | 'success' | 'error';
    startTime: string;
    endTime?: string;
    logs?: string[];
    error?: string;
    progress?: number;
}
export interface BuildListResponse {
    builds: BuildStatus[];
    total: number;
    page: number;
    limit: number;
    hasMore: boolean;
}
export interface BuildLogEntry {
    id: string;
    containerId: string;
    buildId: string;
    timestamp: string;
    level: 'info' | 'warn' | 'error' | 'debug';
    message: string;
    status: string;
    createdAt: string;
}
export interface ContainerFile {
    name: string;
    path: string;
    size?: number;
    type?: 'file' | 'directory';
    mimeType?: string;
    lastModified?: string;
    content?: string;
}
export interface FileListResponse {
    files: ContainerFile[];
    total: number;
    path: string;
}
export interface FileUploadRequest {
    containerId: string;
    filePath: string;
    content: string;
    mimeType?: string;
    encoding?: 'base64' | 'utf8';
}
export interface FileUploadResult {
    id: string;
    path: string;
    name: string;
    size: number;
    mimeType: string;
    uploadedAt: string;
}
export interface Capability {
    id: string;
    name: string;
    description: string;
    category: string;
    version: string;
    dependencies?: string[];
    configuration?: Record<string, any>;
    isActive: boolean;
}
export interface CapabilityListResponse {
    capabilities: Capability[];
    total: number;
    page: number;
    limit: number;
    hasMore: boolean;
}
export interface APIError {
    type: string;
    message: string;
    status: number;
    code: string;
    details?: any;
    requestId?: string;
    timestamp: string;
    context?: string;
    stack?: string;
}
export interface ProcessedError {
    type: string;
    message: string;
    status: number;
    code: string;
    details?: any;
    requestId: string;
    timestamp: string;
    context?: string;
    stack?: string;
    suggestions?: string[];
    commonCauses?: string[];
    nextSteps?: string[];
    estimatedFixTime?: string;
    documentation?: string;
    retryPossible?: boolean;
}
export interface EnhancedErrorResponse {
    success: false;
    error: {
        code: string;
        message: string;
        suggestions: string[];
        retry_possible: boolean;
        estimated_fix_time: string;
        documentation: string;
    };
    request_id: string;
    timestamp: string;
}
export interface ListContainersParams {
    scope?: 'public' | 'myCollection' | 'all';
    limit?: number;
    offset?: number;
    query?: string;
}
export interface GetContainerParams {
    containerId: string;
}
export interface CreateContainerParams {
    name: string;
    description: string;
    dockerfile: string;
    tags?: string[];
    isPrivate?: boolean;
    envVars?: Record<string, string>;
    longDescription?: string;
    capabilities?: string[];
    useCases?: string[];
    installationInstructions?: string;
    documentationLink?: string;
    repoUrl?: string;
    iconUrl?: string;
    author?: string;
    defaultPorts?: number[];
}
export interface UpdateContainerParams {
    containerId: string;
    name?: string;
    description?: string;
    dockerfile?: string;
    tags?: string[];
    isPrivate?: boolean;
    envVars?: Record<string, string>;
    longDescription?: string;
    capabilities?: string[];
    useCases?: string[];
    installationInstructions?: string;
    documentationLink?: string;
    repoUrl?: string;
    iconUrl?: string;
    author?: string;
    defaultPorts?: number[];
}
export interface DeleteContainerParams {
    containerId: string;
}
export interface BuildContainerParams {
    containerId: string;
    buildArgs?: Record<string, string>;
    target?: string;
    progressToken?: string;
}
export interface GetBuildStatusParams {
    containerId: string;
    buildId?: string;
}
export interface ListBuildsParams {
    containerId?: string;
    status?: string;
    limit?: number;
    offset?: number;
}
export interface UploadFileParams extends FileUploadRequest {
}
export interface GetFileContentParams {
    containerId: string;
    filePath: string;
}
export interface ListContainerFilesParams {
    containerId: string;
    path?: string;
}
export interface ListCapabilitiesParams {
    category?: string;
    limit?: number;
    offset?: number;
    query?: string;
}
export interface GetCapabilityParams {
    capabilityId: string;
}
export interface User {
    id: string;
    email: string;
    displayName?: string;
    roles: string[];
    createdAt: string;
    lastLoginAt?: string;
}
export interface UserBalance {
    userId: string;
    tokenBalance: number;
    lastUpdated: string;
}
export interface Transaction {
    id: string;
    userId: string;
    type: 'purchase' | 'consume';
    tokens: number;
    timestamp: string;
    description?: string;
}
export interface ExecutionStatus {
    id: string;
    containerId: string;
    containerName: string;
    userId?: string;
    status: 'starting' | 'running' | 'stopping' | 'stopped' | 'failed' | 'completed' | 'configuring';
    startTime?: string;
    endTime?: string;
    scheduledEndTime?: string;
    durationDays: number;
    accessUrl?: string;
    logs?: string[];
    progress?: number;
    error?: string;
    createdAt?: string;
    updatedAt?: string;
}
export interface ExecutionProgress {
    executionId: string;
    containerId: string;
    phase: string;
    progress: number;
    message: string;
    lastUpdated?: string;
    completedAt?: string;
}
export interface ExecutionLogEntry {
    timestamp: string;
    level: 'info' | 'warning' | 'error' | 'debug';
    message: string;
    source?: string;
}
export interface ExecutionLogs {
    executionId: string;
    containerId: string;
    logs: (string | any)[];
    timestamp: string;
    totalEntries?: number;
    status?: string;
    metadata?: {
        fallbackReason?: string;
        platformIssue?: string;
        enhancedStatusProvided?: boolean;
        debuggingHints?: string;
        errorClassification?: string;
        enhancedErrorReporting?: boolean;
        retryRecommended?: boolean;
        estimatedRetryTime?: string;
    };
}
export interface ExecutionListResponse {
    executions: ExecutionStatus[];
    total: number;
    limit?: number;
    offset?: number;
}
export interface StartExecutionParams {
    containerId: string;
    durationDays?: number;
    envVars?: Record<string, string>;
    cpu?: "1" | "2" | "4" | "8";
    memory?: "1Gi" | "2Gi" | "4Gi" | "8Gi" | "16Gi";
}
export interface StopExecutionParams {
    containerId: string;
    force?: boolean;
}
export interface GetExecutionStatusParams {
    containerId: string;
}
export interface ListExecutionsParams {
    limit?: number;
    offset?: number;
    status?: ExecutionStatus['status'];
    containerId?: string;
}
export interface GetExecutionLogsParams {
    executionId: string;
    limit?: number;
    since?: string;
    level?: ExecutionLogEntry['level'];
}
export interface ExtendExecutionParams {
    executionId: string;
    additionalDays: number;
}
//# sourceMappingURL=types.d.ts.map