Skip to main content
Glama
AbdurRaahimm

MCP Terminal & Git Server

by AbdurRaahimm

install_react_project

Create and set up a new React project using Vite, then open it in VSCode for immediate development.

Instructions

Create a new React project using Vite and open it in VSCode

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNameYesName of the React project
destinationYesDirectory where to create the project (e.g., ~/Desktop)
templateNoVite template to use
installDependenciesNoInstall dependencies after creating project (default: true)

Implementation Reference

  • src/index.ts:117-143 (registration)
    Registration of the 'install_react_project' tool, including its name, description, and input schema in the ListTools response.
    {
      name: "install_react_project",
      description: "Create a new React project using Vite and open it in VSCode",
      inputSchema: {
        type: "object",
        properties: {
          projectName: {
            type: "string",
            description: "Name of the React project",
          },
          destination: {
            type: "string",
            description: "Directory where to create the project (e.g., ~/Desktop)",
          },
          template: {
            type: "string",
            description: "Vite template to use",
            enum: ["react", "react-ts", "react-swc", "react-swc-ts"],
          },
          installDependencies: {
            type: "boolean",
            description: "Install dependencies after creating project (default: true)",
          },
        },
        required: ["projectName", "destination"],
      },
    },
  • The handler implementation for 'install_react_project' within the CallToolRequestSchema switch statement. Creates a Vite React project using npm, optionally installs dependencies, and opens it in VSCode.
    case "install_react_project": {
      const { 
        projectName, 
        destination, 
        template = "react-ts",
        installDependencies = true 
      } = args as {
        projectName: string;
        destination: string;
        template?: string;
        installDependencies?: boolean;
      };
      
      const destPath = resolvePath(destination);
      await ensureDirectory(destPath);
      
      // Create Vite React project
      const createCommand = `npm create vite@latest ${projectName} -- --template ${template}`;
      
      const { stdout: createOutput } = await execa(createCommand, {
        shell: true,
        cwd: destPath,
      });
      
      const projectPath = path.join(destPath, projectName);
      
      // Install dependencies if requested
      if (installDependencies) {
        const installCommand = "npm install";
        const { stdout: installOutput } = await execa(installCommand, {
          shell: true,
          cwd: projectPath,
        });
      }
      
      // Open in VSCode
      await openInVSCode(projectPath);
      
      return {
        content: [
          {
            type: "text",
            text: `React project "${projectName}" created successfully with Vite at ${projectPath}\n\n` +
                  `Template: ${template}\n` +
                  `Dependencies: ${installDependencies ? "Installed" : "Not installed (run npm install manually)"}\n` +
                  `VSCode: Opened\n\n` +
                  `To start development:\n` +
                  `  cd ${projectPath}\n` +
                  `  ${installDependencies ? "" : "npm install\n  "}npm run dev`,
          },
        ],
      };
    }
  • Helper function 'openInVSCode' used by the install_react_project handler to open the created project in VSCode, with fallback paths.
    async function openInVSCode(projectPath: string): Promise<void> {
      try {
        await execa("code", [projectPath]);
      } catch (error) {
        // If 'code' command fails, try common VSCode executable paths
        const vscodePaths = [
          "code",
          "/usr/local/bin/code",
          "/usr/bin/code",
          "C:\\Program Files\\Microsoft VS Code\\Code.exe",
          "C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe",
        ];
    
        for (const codePath of vscodePaths) {
          try {
            await execa(codePath, [projectPath]);
            return;
          } catch {
            // Continue to next path
          }
        }
        
        throw new Error("VSCode not found. Please ensure VSCode is installed and 'code' command is available in PATH");
      }
  • Helper function 'resolvePath' used to resolve user-provided paths, handling '~' for home directory.
    function resolvePath(inputPath: string): string {
      if (inputPath.startsWith("~")) {
        return path.join(os.homedir(), inputPath.slice(1));
      }
      return path.resolve(inputPath);
  • Helper function 'ensureDirectory' used to create the destination directory if it doesn't exist.
    async function ensureDirectory(dirPath: string): Promise<void> {
      try {
        await fs.mkdir(dirPath, { recursive: true });
      } catch (error) {
        console.error(`Error creating directory ${dirPath}:`, error);
      }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions creating and opening a project but lacks details on behavioral traits such as whether it overwrites existing directories, requires specific permissions, handles errors, or has side effects like installing dependencies (implied but not explicit).

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 front-loads the core action and includes key details (Vite, VSCode) without unnecessary words. Every part earns its place.

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?

Given the complexity of a project creation tool with no annotations and no output schema, the description is incomplete. It lacks information on success/failure outcomes, error handling, and behavioral details needed for safe and effective use, leaving significant gaps.

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 baseline is 3. The description does not add meaning beyond the schema, as it does not explain parameter interactions, defaults, or usage examples (e.g., how destination interacts with projectName).

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

Purpose5/5

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

The description clearly states the specific action ('Create a new React project') with the technology stack ('using Vite') and the subsequent action ('open it in VSCode'). It distinguishes from siblings like install_next_project and install_vue_project by specifying React and Vite.

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 does not mention prerequisites, compare with siblings like install_next_project or git_clone, or indicate when not to use it (e.g., for existing projects).

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/AbdurRaahimm/mcp-git-terminal-server'

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