Skip to main content
Glama

init_project

Creates and sets up new projects using Starwind UI, allowing specification of package managers like npm, yarn, or pnpm for streamlined development.

Instructions

Initializes a new project with Starwind UI

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageManagerNoPackage manager to use (npm, yarn, pnpm)

Implementation Reference

  • The core handler function for the 'init_project' tool. It constructs an initialization command based on the specified package manager (npm, yarn, pnpm) and returns structured instructions including the command to run.
    handler: async (args: InitProjectArgs = {}) => { const packageManager = args.packageManager || "npx"; // Build the init command based on the package manager let initCommand: string; switch (packageManager) { case "npm": initCommand = "npx starwind@latest init --defaults"; break; case "yarn": initCommand = "yarn dlx starwind@latest init --defaults"; break; case "pnpm": initCommand = "pnpm dlx starwind@latest init --defaults"; break; default: initCommand = "npx starwind@latest init --defaults"; } return { packageManager, command: initCommand, timestamp: new Date().toISOString(), instructions: "Run this command in your project directory to initialize Starwind UI", note: "This will create or modify files in your project directory. Make sure to review the changes and have a clean git working tree before running.", }; },
  • The input schema definition for the 'init_project' tool, specifying the optional packageManager parameter with allowed values.
    inputSchema: { type: "object", properties: { packageManager: { type: "string", description: "Package manager to use (npm, yarn, pnpm)", enum: ["npm", "yarn", "pnpm"], }, }, required: [],
  • Registration of the initProjectTool into the tools Map, making it available to the MCP server.
    // Register init project tool tools.set(initProjectTool.name, initProjectTool);
  • TypeScript interface defining the arguments for the init_project handler, used for type safety.
    export interface InitProjectArgs { /** Package manager to use (npm, yarn, pnpm) */ packageManager?: "npm" | "yarn" | "pnpm"; /** Additional options for initialization */ options?: string[]; }

Other Tools

Related 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/starwind-ui/starwind-ui-mcp'

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