@todo-for-ai/mcp
Version:
Model Context Protocol server for Todo for AI task management system with Streamable HTTP transport. Provides AI assistants with access to task management, project information, and feedback submission capabilities through modern HTTP-based communication.
194 lines • 5.07 kB
TypeScript
/**
* Todo for AI MCP Server Types
*/
export interface TodoConfig {
apiBaseUrl: string;
apiTimeout: number;
apiToken?: string;
logLevel: 'debug' | 'info' | 'warn' | 'error';
transport: 'stdio' | 'http' | 'auto';
httpPort: number;
httpHost: string;
sessionTimeout: number;
enableDnsRebindingProtection: boolean;
allowedOrigins: string[];
maxConnections: number;
}
export interface Project {
id: number;
name: string;
description?: string;
status: 'active' | 'archived';
color?: string;
github_url?: string;
project_context?: string;
created_at: string;
updated_at: string;
last_activity_at?: string;
created_by: string;
total_tasks: number;
pending_tasks: number;
completed_tasks: number;
completion_rate: number;
statistics?: {
total_tasks: number;
todo_tasks: number;
in_progress_tasks: number;
review_tasks: number;
done_tasks: number;
cancelled_tasks: number;
completion_rate: number;
};
recent_tasks?: Array<{
id: number;
title: string;
status: string;
priority: string;
updated_at: string;
}>;
}
export interface Task {
id: number;
project_id: number;
title: string;
description?: string;
content?: string;
status: 'todo' | 'in_progress' | 'review' | 'done' | 'cancelled' | 'waiting_human_feedback';
priority: 'low' | 'medium' | 'high' | 'urgent';
assignee?: string;
due_date?: string;
estimated_hours?: number;
tags?: string[];
related_files?: string[];
is_ai_task: boolean;
feedback_content?: string;
feedback_at?: string;
created_at: string;
updated_at: string;
created_by: string;
is_interactive?: boolean;
ai_waiting_feedback?: boolean;
interaction_session_id?: string;
}
export interface ApiResponse<T = any> {
code?: number;
success?: boolean;
message?: string;
data?: T;
timestamp?: string;
path?: string;
error?: string;
pagination?: {
page: number;
per_page: number;
total: number;
pages: number;
has_prev: boolean;
has_next: boolean;
prev_num: number | null;
next_num: number | null;
};
}
export interface ApiError {
success: false;
error: {
message: string;
status_code: number;
timestamp: string;
path: string;
code?: string;
details?: any;
};
}
export interface GetProjectTasksArgs {
project_name: string;
status_filter?: ('todo' | 'in_progress' | 'review')[];
}
export interface GetTaskByIdArgs {
task_id: number;
}
export interface SubmitTaskFeedbackArgs {
task_id: number;
project_name: string;
feedback_content: string;
status: 'in_progress' | 'review' | 'done' | 'cancelled' | 'waiting_human_feedback';
ai_identifier?: string;
}
export interface CreateTaskArgs {
project_id: number;
title: string;
content?: string;
status?: 'todo' | 'in_progress' | 'review' | 'done' | 'cancelled';
priority?: 'low' | 'medium' | 'high' | 'urgent';
assignee?: string;
due_date?: string;
estimated_hours?: number;
tags?: string[];
related_files?: string[];
is_ai_task?: boolean;
ai_identifier?: string;
}
export interface UpdateTaskArgs {
task_id: number;
title?: string;
content?: string;
status?: 'todo' | 'in_progress' | 'review' | 'done' | 'cancelled';
priority?: 'low' | 'medium' | 'high' | 'urgent';
due_date?: string;
completion_rate?: number;
tags?: string[];
}
export interface GetProjectInfoArgs {
project_id?: number;
project_name?: string;
}
export interface WaitForNewTasksArgs {
project_name: string;
timeout_seconds?: number;
poll_interval_seconds?: number;
}
export interface WaitForHumanFeedbackArgs {
task_id: number;
session_id: string;
timeout_seconds?: number;
poll_interval_seconds?: number;
}
export interface InteractionLog {
id: number;
task_id: number;
session_id: string;
interaction_type: 'ai_feedback' | 'human_response';
content: string;
status: 'pending' | 'completed' | 'continued';
created_at: string;
created_by?: string;
metadata?: any;
}
export interface SessionInfo {
id: string;
createdAt: Date;
lastActivity: Date;
isActive: boolean;
clientInfo?: {
userAgent?: string;
origin?: string;
ip?: string;
};
}
export interface SessionManager {
createSession(): string;
getSession(sessionId: string): SessionInfo | null;
updateActivity(sessionId: string): void;
removeSession(sessionId: string): void;
cleanupExpiredSessions(): void;
getActiveSessions(): SessionInfo[];
}
export interface HttpTransportConfig {
port: number;
host: string;
sessionTimeout: number;
enableDnsRebindingProtection: boolean;
allowedOrigins: string[];
maxConnections: number;
}
//# sourceMappingURL=types.d.ts.map