Skip to main content
Glama
bswa006
by bswa006

complete_setup_workflow

Analyze codebase, create context files, and configure automation for AI agent projects to enhance coding capabilities.

Instructions

Complete MCP setup workflow: analyze codebase, create all context files, and configure automation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the project directory
projectNameYesName of the project
teamSizeNoNumber of developers on the team
updateScheduleNoHow often to update context files
ideNoWhich IDE configurations to create
includeAllNoInclude all optional features

Implementation Reference

  • Main handler function that orchestrates the entire setup workflow by sequentially calling analysis, initialization, conversation starters, token optimization, IDE configs, persistence automation, and maintenance workflows.
    export async function completeSetupWorkflow(config: SetupConfig): Promise<SetupResult> { const result: SetupResult = { success: false, message: '', steps: {}, filesCreated: [], recommendations: [], }; try { console.log('šŸš€ Starting Complete Setup Workflow...'); // Step 1: Deep Analysis console.log('\nšŸ“Š Step 1/7: Analyzing codebase deeply...'); const analysisResult = await analyzeCodebaseDeeply({ projectPath: config.projectPath }); result.steps.analysis = { success: analysisResult.success, analysisId: analysisResult.analysisId, message: analysisResult.success ? `Analyzed ${analysisResult.summary.totalFiles} files` : 'Analysis failed', }; if (!analysisResult.success || !analysisResult.analysisId) { throw new Error('Deep analysis failed. Cannot proceed with setup.'); } const analysisId = analysisResult.analysisId; // Step 2: Initialize Workspace console.log('\nšŸŽÆ Step 2/7: Initializing agent workspace...'); const initResult = await initializeAgentWorkspace({ projectPath: config.projectPath, projectName: config.projectName, techStack: { language: analysisResult.summary.primaryLanguage, framework: analysisResult.summary.frameworks[0], uiLibrary: analysisResult.summary.frameworks.find(f => ['React', 'Vue', 'Angular', 'Svelte'].includes(f) ), testFramework: analysisResult.summary.testingFrameworks[0], }, }); result.steps.initialization = { success: initResult.success, message: initResult.message, }; result.filesCreated.push(...initResult.filesCreated); // Step 3: Create Conversation Starters console.log('\nšŸ’¬ Step 3/7: Creating conversation starters...'); const conversationResult = await createConversationStarters({ projectPath: config.projectPath, analysisId, includeQuickTasks: true, includeCurrentWork: true, }); result.steps.conversationStarters = { success: conversationResult.success, message: conversationResult.message, }; result.filesCreated.push(...conversationResult.filesCreated); // Step 4: Create Token Optimizer console.log('\nšŸ’Ž Step 4/7: Creating token optimization tiers...'); const tokenResult = await createTokenOptimizer({ projectPath: config.projectPath, analysisId, tiers: ['minimal', 'standard', 'comprehensive'], trackUsage: true, generateMetrics: true, }); result.steps.tokenOptimizer = { success: tokenResult.success, message: tokenResult.message, }; result.filesCreated.push(...tokenResult.filesCreated); // Step 5: Create IDE Configurations console.log('\nšŸ› ļø Step 5/7: Creating IDE configurations...'); const ideResult = await createIDEConfigs({ projectPath: config.projectPath, analysisId, ide: config.ide || 'all', autoLoadContext: true, includeDebugConfigs: true, }); result.steps.ideConfigs = { success: ideResult.success, message: ideResult.message, }; result.filesCreated.push(...ideResult.filesCreated); // Step 6: Setup Persistence Automation console.log('\nšŸ”„ Step 6/7: Setting up persistence automation...'); const persistenceResult = await setupPersistenceAutomation({ projectPath: config.projectPath, analysisId, updateSchedule: config.updateSchedule || 'weekly', gitHooks: true, monitoring: true, }); result.steps.persistence = { success: persistenceResult.success, message: persistenceResult.message, }; result.filesCreated.push(...persistenceResult.filesCreated); // Step 7: Create Maintenance Workflows console.log('\nšŸ“‹ Step 7/7: Creating maintenance workflows...'); const maintenanceResult = await createMaintenanceWorkflows({ projectPath: config.projectPath, analysisId, teamSize: config.teamSize || 1, updateFrequency: config.updateSchedule === 'daily' ? 'daily' : 'weekly', includeChecklists: true, includeMetrics: true, includeTraining: !!(config.teamSize && config.teamSize > 1), }); result.steps.maintenance = { success: maintenanceResult.success, message: maintenanceResult.message, }; result.filesCreated.push(...maintenanceResult.filesCreated); // Generate recommendations result.recommendations = generateSetupRecommendations( analysisResult, config, result.steps ); // Final summary const successfulSteps = Object.values(result.steps).filter(s => s.success).length; result.success = successfulSteps === 7; result.message = result.success ? `āœ… Complete setup successful! Created ${result.filesCreated.length} files.` : `āš ļø Setup completed with issues. ${successfulSteps}/7 steps successful.`; // Print summary console.log('\n' + '='.repeat(60)); console.log('šŸ“Š SETUP SUMMARY'); console.log('='.repeat(60)); console.log(`Status: ${result.success ? 'āœ… SUCCESS' : 'āš ļø PARTIAL SUCCESS'}`); console.log(`Files Created: ${result.filesCreated.length}`); console.log('\nSteps:'); Object.entries(result.steps).forEach(([step, status]) => { console.log(` ${status.success ? 'āœ…' : 'āŒ'} ${step}: ${status.message}`); }); if (result.recommendations.length > 0) { console.log('\nšŸ“Œ Recommendations:'); result.recommendations.forEach((rec, i) => { console.log(` ${i + 1}. ${rec}`); }); } console.log('\nšŸŽ‰ Setup workflow complete!'); } catch (error) { result.success = false; result.message = `Setup failed: ${error}`; console.error('\nāŒ Setup failed:', error); } return result; }
  • Tool schema definition including name, description, and inputSchema for validation.
    { name: 'complete_setup_workflow', description: 'Complete MCP setup workflow: analyze codebase, create all context files, and configure automation', inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'Path to the project directory', }, projectName: { type: 'string', description: 'Name of the project', }, teamSize: { type: 'number', description: 'Number of developers on the team', }, updateSchedule: { type: 'string', enum: ['daily', 'weekly', 'on-change', 'manual'], description: 'How often to update context files', }, ide: { type: 'string', enum: ['cursor', 'vscode', 'intellij', 'all'], description: 'Which IDE configurations to create', }, includeAll: { type: 'boolean', description: 'Include all optional features', }, }, required: ['projectPath', 'projectName'], }, },
  • Registration and dispatch handler in the main tool switch statement, with Zod input validation and call to the handler function.
    case 'complete_setup_workflow': { const params = z.object({ projectPath: z.string(), projectName: z.string(), teamSize: z.number().optional(), updateSchedule: z.enum(['daily', 'weekly', 'on-change', 'manual']).optional(), ide: z.enum(['cursor', 'vscode', 'intellij', 'all']).optional(), includeAll: z.boolean().optional(), }).parse(args); const result = await completeSetupWorkflow(params); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • TypeScript interfaces defining input (SetupConfig) and output (SetupResult) types for the handler.
    interface SetupConfig { projectPath: string; projectName: string; teamSize?: number; updateSchedule?: 'daily' | 'weekly' | 'on-change' | 'manual'; ide?: 'cursor' | 'vscode' | 'intellij' | 'all'; includeAll?: boolean; } interface SetupResult { success: boolean; message: string; steps: { analysis?: { success: boolean; analysisId?: string; message: string }; initialization?: { success: boolean; message: string }; conversationStarters?: { success: boolean; message: string }; tokenOptimizer?: { success: boolean; message: string }; ideConfigs?: { success: boolean; message: string }; persistence?: { success: boolean; message: string }; maintenance?: { success: boolean; message: string }; }; filesCreated: string[]; recommendations: string[]; }
  • Import statement registering the handler function for use in the tool dispatcher.
    import { completeSetupWorkflow } from './workspace/complete-setup-workflow.js';

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bswa006/mcp-context-manager'

If you have feedback or need assistance with the MCP directory API, please join our Discord server