@mseep/atlas-mcp-server
Version:
A Model Context Protocol (MCP) server for ATLAS, a Neo4j-powered task management system for LLM Agents - implementing a three-tier architecture (Projects, Tasks, Knowledge) to manage complex workflows.
200 lines (199 loc) • 8.85 kB
TypeScript
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
import { ToolContext } from "../utils/security.js";
import { McpToolResponse } from "./mcp.js";
export interface ToolExample {
input: Record<string, unknown>;
output: string;
description?: string;
}
export type EntityType = 'project' | 'task' | 'knowledge';
export type TaskType = 'research' | 'generation' | 'analysis' | 'integration' | string;
export type ProjectStatus = 'active' | 'pending' | 'in-progress' | 'completed' | 'archived';
export type TaskStatus = 'backlog' | 'todo' | 'in-progress' | 'completed';
export type PriorityLevel = 'low' | 'medium' | 'high' | 'critical';
export type KnowledgeDomain = 'technical' | 'business' | 'scientific' | string;
export interface ToolMetadata {
examples?: ToolExample[];
returnSchema?: z.ZodType<any>;
requiredPermission?: string;
entityType?: EntityType | EntityType[];
rateLimit?: {
windowMs: number;
maxRequests: number;
};
supportsBulkOperations?: boolean;
}
type BaseToolHandler = (input: unknown, context: ToolContext) => Promise<McpToolResponse>;
export declare const registerTool: (server: McpServer, name: string, description: string, schema: z.ZodRawShape, handler: BaseToolHandler, metadata?: ToolMetadata) => void;
export declare const createToolExample: (input: Record<string, unknown>, output: string, description?: string) => ToolExample;
export declare const createToolMetadata: (metadata: ToolMetadata) => ToolMetadata;
/**
* Atlas Platform specific interfaces to represent the core data model
* These interfaces match the database objects described in the Atlas Platform Reference Guide
*/
export interface Project {
/** Optional client-generated ID; system will generate if not provided */
id?: string;
/** Descriptive project name (1-100 characters) */
name: string;
/** Comprehensive project overview explaining purpose and scope */
description: string;
/** Current project state */
status: ProjectStatus;
/** Relevant URLs with descriptive titles for reference materials */
urls?: Array<{
title: string;
url: string;
}>;
/** Specific, measurable criteria that indicate project completion */
completionRequirements: string;
/** Array of existing project IDs that must be completed before this project can begin */
dependencies?: string[];
/** Required format specification for final project deliverables */
outputFormat: string;
/** Classification of project purpose */
taskType: TaskType;
/** Timestamp when the project was created */
createdAt: string;
/** Timestamp when the project was last updated */
updatedAt: string;
}
export interface Task {
/** Optional client-generated ID; system will generate if not provided */
id?: string;
/** ID of the parent project this task belongs to */
projectId: string;
/** Concise task title clearly describing the objective (5-150 characters) */
title: string;
/** Detailed explanation of the task requirements and context */
description: string;
/** Importance level */
priority: PriorityLevel;
/** Current task state */
status: TaskStatus;
/** ID of entity responsible for task completion */
assignedTo?: string;
/** Relevant URLs with descriptive titles for reference materials */
urls?: Array<{
title: string;
url: string;
}>;
/** Categorical labels for organization and filtering */
tags?: string[];
/** Specific, measurable criteria that indicate task completion */
completionRequirements: string;
/** Array of existing task IDs that must be completed before this task can begin */
dependencies?: string[];
/** Required format specification for task deliverables */
outputFormat: string;
/** Classification of task purpose */
taskType: TaskType;
/** Timestamp when the task was created */
createdAt: string;
/** Timestamp when the task was last updated */
updatedAt: string;
}
export interface Knowledge {
/** Optional client-generated ID; system will generate if not provided */
id?: string;
/** ID of the parent project this knowledge belongs to */
projectId: string;
/** Main content of the knowledge item (can be structured or unstructured) */
text: string;
/** Categorical labels for organization and filtering */
tags?: string[];
/** Primary knowledge area or discipline */
domain: KnowledgeDomain;
/** Array of reference sources supporting this knowledge (URLs, DOIs, etc.) */
citations?: string[];
/** Timestamp when the knowledge item was created */
createdAt: string;
/** Timestamp when the knowledge item was last updated */
updatedAt: string;
}
/**
* Operation request interfaces based on the API Reference
* These interfaces can be used as a foundation for building tool input schemas
*/
export interface ProjectCreateRequest {
/** Operation mode - 'single' for one project, 'bulk' for multiple projects */
mode?: 'single' | 'bulk';
/** Optional client-generated project ID (required for mode='single') */
id?: string;
/** Descriptive project name (1-100 characters) (required for mode='single') */
name?: string;
/** Comprehensive project overview explaining purpose and scope (required for mode='single') */
description?: string;
/** Current project state (Default: active) */
status?: ProjectStatus;
/** Array of relevant URLs with descriptive titles for reference materials */
urls?: Array<{
title: string;
url: string;
}>;
/** Specific, measurable criteria that indicate project completion (required for mode='single') */
completionRequirements?: string;
/** Array of existing project IDs that must be completed before this project can begin */
dependencies?: string[];
/** Required format specification for final project deliverables (required for mode='single') */
outputFormat?: string;
/** Classification of project purpose (required for mode='single') */
taskType?: TaskType;
/** Array of project objects with the above fields (required for mode='bulk') */
projects?: Partial<Project>[];
}
export interface TaskCreateRequest {
/** Operation mode - 'single' for one task, 'bulk' for multiple tasks */
mode?: 'single' | 'bulk';
/** Optional client-generated task ID */
id?: string;
/** ID of the parent project this task belongs to (required for mode='single') */
projectId?: string;
/** Concise task title clearly describing the objective (5-150 characters) (required for mode='single') */
title?: string;
/** Detailed explanation of the task requirements and context (required for mode='single') */
description?: string;
/** Importance level (Default: medium) */
priority?: PriorityLevel;
/** Current task state (Default: todo) */
status?: TaskStatus;
/** ID of entity responsible for task completion */
assignedTo?: string;
/** Array of relevant URLs with descriptive titles for reference materials */
urls?: Array<{
title: string;
url: string;
}>;
/** Array of categorical labels for organization and filtering */
tags?: string[];
/** Specific, measurable criteria that indicate task completion (required for mode='single') */
completionRequirements?: string;
/** Array of existing task IDs that must be completed before this task can begin */
dependencies?: string[];
/** Required format specification for task deliverables (required for mode='single') */
outputFormat?: string;
/** Classification of task purpose (required for mode='single') */
taskType?: TaskType;
/** Array of task objects with the above fields (required for mode='bulk') */
tasks?: Partial<Task>[];
}
export interface KnowledgeAddRequest {
/** Operation mode - 'single' for one knowledge item, 'bulk' for multiple items */
mode?: 'single' | 'bulk';
/** Optional client-generated knowledge ID */
id?: string;
/** ID of the parent project this knowledge belongs to (required for mode='single') */
projectId?: string;
/** Main content of the knowledge item (can be structured or unstructured) (required for mode='single') */
text?: string;
/** Array of categorical labels for organization and filtering */
tags?: string[];
/** Primary knowledge area or discipline (required for mode='single') */
domain?: KnowledgeDomain;
/** Array of reference sources supporting this knowledge (URLs, DOIs, etc.) */
citations?: string[];
/** Array of knowledge objects with the above fields (required for mode='bulk') */
knowledge?: Partial<Knowledge>[];
}
export {};