createTanStackApplication
Scaffold a new TanStack Start application with your choice of framework, add-ons, package manager, deployment, and toolchain.
Instructions
Scaffold a new TanStack Start application with the specified add-ons and options
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectName | Yes | Name of the project directory to create | |
| framework | No | Project framework | React |
| addOns | No | Comma-separated add-on ids to include (e.g. ['drizzle','clerk']) | |
| packageManager | No | Package manager to use | |
| deployment | No | Deployment adapter | |
| toolchain | No | Linter / formatter toolchain | |
| routerOnly | No | Use router-only mode (file-based routing without TanStack Start) | |
| examples | No | Include demo/example pages | |
| targetDir | No | Target directory for the project root | |
| addOnConfig | No | JSON string with add-on configuration options |
Implementation Reference
- src/index.ts:111-191 (registration)Registration of the 'createTanStackApplication' tool with the MCP server using server.tool(), including its schema definition.
server.tool( "createTanStackApplication", "Scaffold a new TanStack Start application with the specified add-ons and options", { projectName: z.string().describe("Name of the project directory to create"), framework: z .enum(["React", "Solid"]) .default("React") .describe("Project framework"), addOns: z .array(z.string()) .optional() .describe( "Comma-separated add-on ids to include (e.g. ['drizzle','clerk'])", ), packageManager: z .enum(["npm", "yarn", "pnpm", "bun", "deno"]) .optional() .describe("Package manager to use"), deployment: z .enum(["cloudflare", "netlify", "nitro", "railway"]) .optional() .describe("Deployment adapter"), toolchain: z .enum(["biome", "eslint"]) .optional() .describe("Linter / formatter toolchain"), routerOnly: z .boolean() .optional() .describe( "Use router-only mode (file-based routing without TanStack Start)", ), examples: z .boolean() .optional() .describe("Include demo/example pages"), targetDir: z .string() .optional() .describe("Target directory for the project root"), addOnConfig: z .string() .optional() .describe("JSON string with add-on configuration options"), }, async ({ projectName, framework, addOns, packageManager, deployment, toolchain, routerOnly, examples, targetDir, addOnConfig, }) => { const args = ["create", projectName, "--framework", framework]; if (addOns && addOns.length > 0) { args.push("--add-ons", addOns.join(",")); } if (packageManager) args.push("--package-manager", packageManager); if (deployment) args.push("--deployment", deployment); if (toolchain) args.push("--toolchain", toolchain); if (routerOnly) args.push("--router-only"); if (examples === true) args.push("--examples"); if (examples === false) args.push("--no-examples"); if (targetDir) args.push("--target-dir", targetDir); if (addOnConfig) args.push("--add-on-config", addOnConfig); // Always non-interactive, no git init (the agent controls git) args.push("--no-git"); const { stdout, stderr } = await runCli(args, 120_000); return textResult( [stdout, stderr].filter(Boolean).join("\n---\n"), ); }, ); - src/index.ts:114-156 (schema)Input schema for createTanStackApplication: projectName, framework, addOns, packageManager, deployment, toolchain, routerOnly, examples, targetDir, addOnConfig.
{ projectName: z.string().describe("Name of the project directory to create"), framework: z .enum(["React", "Solid"]) .default("React") .describe("Project framework"), addOns: z .array(z.string()) .optional() .describe( "Comma-separated add-on ids to include (e.g. ['drizzle','clerk'])", ), packageManager: z .enum(["npm", "yarn", "pnpm", "bun", "deno"]) .optional() .describe("Package manager to use"), deployment: z .enum(["cloudflare", "netlify", "nitro", "railway"]) .optional() .describe("Deployment adapter"), toolchain: z .enum(["biome", "eslint"]) .optional() .describe("Linter / formatter toolchain"), routerOnly: z .boolean() .optional() .describe( "Use router-only mode (file-based routing without TanStack Start)", ), examples: z .boolean() .optional() .describe("Include demo/example pages"), targetDir: z .string() .optional() .describe("Target directory for the project root"), addOnConfig: z .string() .optional() .describe("JSON string with add-on configuration options"), }, - src/index.ts:157-191 (handler)Handler function that builds CLI args and runs npx @tanstack/cli create to scaffold a new TanStack Start application.
async ({ projectName, framework, addOns, packageManager, deployment, toolchain, routerOnly, examples, targetDir, addOnConfig, }) => { const args = ["create", projectName, "--framework", framework]; if (addOns && addOns.length > 0) { args.push("--add-ons", addOns.join(",")); } if (packageManager) args.push("--package-manager", packageManager); if (deployment) args.push("--deployment", deployment); if (toolchain) args.push("--toolchain", toolchain); if (routerOnly) args.push("--router-only"); if (examples === true) args.push("--examples"); if (examples === false) args.push("--no-examples"); if (targetDir) args.push("--target-dir", targetDir); if (addOnConfig) args.push("--add-on-config", addOnConfig); // Always non-interactive, no git init (the agent controls git) args.push("--no-git"); const { stdout, stderr } = await runCli(args, 120_000); return textResult( [stdout, stderr].filter(Boolean).join("\n---\n"), ); }, ); - src/index.ts:18-32 (helper)runCli helper used by the handler to execute the TanStack CLI via npx.
async function runCli( args: string[], timeoutMs = 60_000, ): Promise<{ stdout: string; stderr: string }> { const { stdout, stderr } = await execFileAsync( TANSTACK_CLI, [...TANSTACK_ARGS, ...args], { timeout: timeoutMs, maxBuffer: 10 * 1024 * 1024, // 10 MB env: { ...process.env, NO_COLOR: "1" }, }, ); return { stdout: stdout.trim(), stderr: stderr.trim() }; }