Skip to main content
Glama
bsmi021

Node Omnibus MCP Server

by bsmi021

create_project

Create a new Node.js project with enhanced configuration for React, Node, Next, Express, or Fastify applications, including TypeScript support.

Instructions

Create a new Node.js project with enhanced configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesProject name
typeYesProject type
pathYesProject directory path
typescriptNoEnable TypeScript support

Implementation Reference

  • The handler function that implements the core logic of the 'create_project' tool. It creates the project directory, initializes the project using appropriate templates (create-react-app, create-next-app, etc.), installs dependencies and devDependencies, sets up TypeScript configuration if requested, generates a README.md, and stores documentation in memory.
    private async handleCreateProject(args: CreateProjectArgs) {
        try {
            // Create the project directory first
            const projectPath = path.join(args.path, args.name);
            await fs.mkdir(projectPath, { recursive: true });
    
            const typescript = args.typescript !== false;
            const template = this.getProjectTemplate(args.type, args.name, typescript);
    
            // Execute project creation command in the project directory
            const { stdout: createOutput } = await execAsync(template.command, {
                cwd: projectPath
            });
    
            // Install dependencies directly in the project directory
            if (template.dependencies.length > 0) {
                const installCmd = `npm install ${template.dependencies.join(' ')}`;
                await execAsync(installCmd, { cwd: projectPath });
            }
    
            // Install dev dependencies
            if (template.devDependencies.length > 0) {
                const installDevCmd = `npm install --save-dev ${template.devDependencies.join(' ')}`;
                await execAsync(installDevCmd, { cwd: projectPath });
            }
    
            // Setup TypeScript configuration if needed
            if (typescript) {
                const tsConfig = {
                    compilerOptions: {
                        target: "es2020",
                        module: "commonjs",
                        outDir: "./dist",
                        rootDir: "./src",
                        strict: true,
                        esModuleInterop: true,
                        skipLibCheck: true,
                        forceConsistentCasingInFileNames: true,
                        jsx: args.type === 'react' || args.type === 'next' ? "react-jsx" : undefined,
                    },
                    include: ["src/**/*"],
                    exclude: ["node_modules", "dist"]
                };
    
                await fs.mkdir(path.join(projectPath, 'src'), { recursive: true });
                await fs.writeFile(
                    path.join(projectPath, 'tsconfig.json'),
                    JSON.stringify(tsConfig, null, 2)
                );
            }
    
            // Create initial documentation
            const readmeContent = this.generateReadme(args.name, args.type, typescript);
            await fs.writeFile(
                path.join(projectPath, 'README.md'),
                readmeContent
            );
    
            // Store documentation in memory
            this.projectDocs.set(args.name, readmeContent);
    
            return {
                content: [
                    {
                        type: 'text',
                        text: `Project ${args.name} created successfully with ${typescript ? 'TypeScript' : 'JavaScript'} configuration`,
                    },
                ],
            };
        } catch (error: unknown) {
            throw new McpError(
                ErrorCode.InternalError,
                `Failed to create project: ${error instanceof Error ? error.message : String(error)}`
            );
        }
    }
  • JSON schema definition for the 'create_project' tool inputs, registered in the ListToolsRequestSchema handler. Defines properties, types, enum for project type, descriptions, and required fields.
        name: 'create_project',
        description: 'Create a new Node.js project with enhanced configuration',
        inputSchema: {
            type: 'object',
            properties: {
                name: {
                    type: 'string',
                    description: 'Project name',
                },
                type: {
                    type: 'string',
                    enum: ['react', 'node', 'next', 'express', 'fastify'],
                    description: 'Project type',
                },
                path: {
                    type: 'string',
                    description: 'Project directory path',
                },
                typescript: {
                    type: 'boolean',
                    description: 'Enable TypeScript support',
                    default: true,
                },
            },
            required: ['name', 'type', 'path'],
        },
    },
  • src/index.ts:394-396 (registration)
    Registration and dispatch logic in the CallToolRequestSchema handler. The switch statement routes calls to 'create_project' to the handleCreateProject method.
    switch (request.params.name) {
        case 'create_project':
            return await this.handleCreateProject(args as CreateProjectArgs);
  • TypeScript interface defining the shape of arguments expected by the create_project handler, used for type safety.
    interface CreateProjectArgs extends Record<string, unknown> {
        name: string;
        type: 'react' | 'node' | 'next' | 'express' | 'fastify';
        path: string;
        typescript?: boolean;
    }
  • Helper function that provides project creation templates, including commands and dependency lists for different project types (react, next, express, etc.), used by the handler.
    private getProjectTemplate(type: string, name: string, typescript: boolean): {
        command: string;
        dependencies: string[];
        devDependencies: string[];
    } {
        const templates: Record<string, {
            command: string;
            dependencies: string[];
            devDependencies: string[];
        }> = {
            react: {
                command: typescript
                    ? `npx create-react-app ./ --template typescript`
                    : `npx create-react-app ./`,
                dependencies: ['react', 'react-dom'],
                devDependencies: typescript
                    ? ['@types/react', '@types/react-dom', '@types/node']
                    : [],
            },
            next: {
                command: `npx create-next-app@latest ./ ${typescript ? '--typescript' : ''} --tailwind --eslint`,
                dependencies: ['next', 'react', 'react-dom'],
                devDependencies: typescript
                    ? ['@types/node', '@types/react', '@types/react-dom']
                    : [],
            },
            express: {
                command: `npm init -y`,
                dependencies: ['express', 'cors', 'dotenv'],
                devDependencies: typescript
                    ? ['typescript', '@types/node', '@types/express', '@types/cors', 'ts-node', 'nodemon']
                    : ['nodemon'],
            },
            fastify: {
                command: `npm init -y`,
                dependencies: ['fastify', '@fastify/cors', '@fastify/env'],
                devDependencies: typescript
                    ? ['typescript', '@types/node', 'ts-node', 'nodemon']
                    : ['nodemon'],
            },
            node: {
                command: `npm init -y`,
                dependencies: [],
                devDependencies: typescript
                    ? ['typescript', '@types/node', 'ts-node', 'nodemon']
                    : ['nodemon'],
            },
        };
    
        const template = templates[type];
        if (!template) {
            throw new McpError(ErrorCode.InvalidParams, `Unsupported project type: ${type}`);
        }
    
        return template;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but lacks behavioral details. It implies a write operation ('Create') but doesn't disclose permissions needed, whether it overwrites existing projects, what 'enhanced configuration' entails, or any side effects like file generation or dependencies installation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized, earning its place by clearly conveying the core function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a creation tool with no annotations and no output schema, the description is incomplete. It doesn't address what 'enhanced configuration' means, what gets created (e.g., files, folders), or the response format, leaving significant gaps for the agent to infer behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds no additional parameter semantics beyond implying 'enhanced configuration' might relate to the parameters, but it doesn't explain how. Baseline 3 is appropriate as the schema handles the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create') and resource ('new Node.js project'), specifying it's for Node.js projects with enhanced configuration. However, it doesn't explicitly differentiate from sibling tools like 'generate_component' or 'create_documentation', which might also create project-related artifacts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, when not to use it, or how it relates to siblings like 'add_script' or 'install_packages', leaving the agent without contextual usage cues.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/bsmi021/mcp-node-omnibus-server'

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