# Usage with TanStack Start

# Usage with TanStack Start

## Get started with agents

Set up your AI coding agent once, on your machine. The [MCP server](https://alpha.mantine.dev/llms/guides-llms.md#mcp-server)
lets the agent search and read Mantine documentation, and [skills](https://alpha.mantine.dev/llms/guides-llms.md#skills) teach it
Mantine patterns for forms, data grids, calendars, theming and other tasks.

The MCP server runs with `npx` and requires Node.js 22 or later. For Cursor, Claude Desktop and
other MCP clients, see the [Mantine with LLMs](https://alpha.mantine.dev/llms/guides-llms.md#mcp-server-configuration) guide.

Pick your agent and follow the installation instructions:

### Claude Code

#### 1. Install the Mantine plugin

Install the Mantine plugin. It includes all Mantine skills and the MCP server:

```bash
claude plugin install mantine --marketplace mantinedev/skills
```

Or set up the MCP server and skills separately:

```bash
claude mcp add -s user mantine -- npx -y @mantine/mcp-server
npx skills add mantinedev/skills -g -a claude-code -y
```

#### 2. Set up your project

Create new project:

```text
Create a new TanStack Start project with Mantine.

1. Read the current Mantine TanStack Start setup guide: https://mantine.dev/llms/guides-tanstack-start.md
2. Create a new React application with the TanStack Start CLI: npx @tanstack/cli@latest create. Use my requested project name if I provided one.
3. Use the package manager declared by the generated project. Install @mantine/core and @mantine/hooks. Configure PostCSS with postcss, postcss-preset-mantine and postcss-simple-vars as described in the guide. Configure src/routes/__root.tsx with MantineProvider, ColorSchemeScript and mantineHtmlProps. Import Mantine styles with the ?url suffix and add them to the root route head links before application styles. Preserve HeadContent and Scripts.
4. Add a small page using Mantine components to demonstrate that the setup works.
5. Run the available formatting, lint, type, test and build scripts. Start the dev server, verify that Mantine renders correctly without browser errors, and tell me its URL.
6. Briefly explain the project structure and the scripts available in package.json.

Use the Mantine MCP server and Mantine skills if they are installed.
```

Add to existing project:

```text
Add Mantine to my existing TanStack Start project.

1. Inspect the project structure, framework version, package manager, routing and existing styling configuration.
2. Read the current Mantine TanStack Start setup guide: https://mantine.dev/llms/guides-tanstack-start.md
3. Use the project's existing package manager. Install @mantine/core and @mantine/hooks. Configure PostCSS with postcss, postcss-preset-mantine and postcss-simple-vars as described in the guide. Configure src/routes/__root.tsx with MantineProvider, ColorSchemeScript and mantineHtmlProps. Import Mantine styles with the ?url suffix and add them to the root route head links before application styles. Preserve HeadContent and Scripts.
4. Merge the setup into the existing configuration and preserve routes, providers, styles and application behavior. Do not scaffold a new project or replace existing files wholesale.
5. Add a small Mantine example to an appropriate existing page.
6. Run the available formatting, lint, type, test and build scripts. Start the dev server, verify that Mantine renders correctly without browser errors, and tell me its URL.
7. Summarize the files changed and any follow-up steps.

Use the Mantine MCP server and Mantine skills if they are installed.
```

### Codex

#### 1. Install the Mantine plugin

Install the Mantine plugin. It includes all Mantine skills and the MCP server:

```bash
codex plugin marketplace add mantinedev/skills
codex plugin add mantine@mantine
```

Or set up the MCP server and skills separately:

```bash
codex mcp add mantine -- npx -y @mantine/mcp-server
npx skills add mantinedev/skills -g -a codex -y
```

#### 2. Set up your project

Create new project:

```text
Create a new TanStack Start project with Mantine.

1. Read the current Mantine TanStack Start setup guide: https://mantine.dev/llms/guides-tanstack-start.md
2. Create a new React application with the TanStack Start CLI: npx @tanstack/cli@latest create. Use my requested project name if I provided one.
3. Use the package manager declared by the generated project. Install @mantine/core and @mantine/hooks. Configure PostCSS with postcss, postcss-preset-mantine and postcss-simple-vars as described in the guide. Configure src/routes/__root.tsx with MantineProvider, ColorSchemeScript and mantineHtmlProps. Import Mantine styles with the ?url suffix and add them to the root route head links before application styles. Preserve HeadContent and Scripts.
4. Add a small page using Mantine components to demonstrate that the setup works.
5. Run the available formatting, lint, type, test and build scripts. Start the dev server, verify that Mantine renders correctly without browser errors, and tell me its URL.
6. Briefly explain the project structure and the scripts available in package.json.

Use the Mantine MCP server and Mantine skills if they are installed.
```

Add to existing project:

```text
Add Mantine to my existing TanStack Start project.

1. Inspect the project structure, framework version, package manager, routing and existing styling configuration.
2. Read the current Mantine TanStack Start setup guide: https://mantine.dev/llms/guides-tanstack-start.md
3. Use the project's existing package manager. Install @mantine/core and @mantine/hooks. Configure PostCSS with postcss, postcss-preset-mantine and postcss-simple-vars as described in the guide. Configure src/routes/__root.tsx with MantineProvider, ColorSchemeScript and mantineHtmlProps. Import Mantine styles with the ?url suffix and add them to the root route head links before application styles. Preserve HeadContent and Scripts.
4. Merge the setup into the existing configuration and preserve routes, providers, styles and application behavior. Do not scaffold a new project or replace existing files wholesale.
5. Add a small Mantine example to an appropriate existing page.
6. Run the available formatting, lint, type, test and build scripts. Start the dev server, verify that Mantine renders correctly without browser errors, and tell me its URL.
7. Summarize the files changed and any follow-up steps.

Use the Mantine MCP server and Mantine skills if they are installed.
```

### GitHub Copilot

#### 1. Set up Copilot CLI

In Copilot CLI, install the Mantine plugin. It includes all Mantine skills and the MCP server:

```bash
copilot plugin marketplace add mantinedev/skills
copilot plugin install mantine@mantine
```

#### 2. Set up VS Code

In VS Code, install the same plugin: run **Chat: Install Plugin from Source** from the Command
Palette and enter `https://github.com/mantinedev/skills`. To add only the MCP server, run:

```bash
code --add-mcp '{"name":"mantine","type":"stdio","command":"npx","args":["-y","@mantine/mcp-server"]}'
```

#### 3. Set up your project

Create new project:

```text
Create a new TanStack Start project with Mantine.

1. Read the current Mantine TanStack Start setup guide: https://mantine.dev/llms/guides-tanstack-start.md
2. Create a new React application with the TanStack Start CLI: npx @tanstack/cli@latest create. Use my requested project name if I provided one.
3. Use the package manager declared by the generated project. Install @mantine/core and @mantine/hooks. Configure PostCSS with postcss, postcss-preset-mantine and postcss-simple-vars as described in the guide. Configure src/routes/__root.tsx with MantineProvider, ColorSchemeScript and mantineHtmlProps. Import Mantine styles with the ?url suffix and add them to the root route head links before application styles. Preserve HeadContent and Scripts.
4. Add a small page using Mantine components to demonstrate that the setup works.
5. Run the available formatting, lint, type, test and build scripts. Start the dev server, verify that Mantine renders correctly without browser errors, and tell me its URL.
6. Briefly explain the project structure and the scripts available in package.json.

Use the Mantine MCP server and Mantine skills if they are installed.
```

Add to existing project:

```text
Add Mantine to my existing TanStack Start project.

1. Inspect the project structure, framework version, package manager, routing and existing styling configuration.
2. Read the current Mantine TanStack Start setup guide: https://mantine.dev/llms/guides-tanstack-start.md
3. Use the project's existing package manager. Install @mantine/core and @mantine/hooks. Configure PostCSS with postcss, postcss-preset-mantine and postcss-simple-vars as described in the guide. Configure src/routes/__root.tsx with MantineProvider, ColorSchemeScript and mantineHtmlProps. Import Mantine styles with the ?url suffix and add them to the root route head links before application styles. Preserve HeadContent and Scripts.
4. Merge the setup into the existing configuration and preserve routes, providers, styles and application behavior. Do not scaffold a new project or replace existing files wholesale.
5. Add a small Mantine example to an appropriate existing page.
6. Run the available formatting, lint, type, test and build scripts. Start the dev server, verify that Mantine renders correctly without browser errors, and tell me its URL.
7. Summarize the files changed and any follow-up steps.

Use the Mantine MCP server and Mantine skills if they are installed.
```

### Qwen Code

#### 1. Install the Mantine extension

Install the Mantine extension. Qwen Code converts the Mantine plugin into an extension with all
skills and the MCP server:

```bash
qwen extensions install mantinedev/skills:mantine
```

Or set up the MCP server and skills separately:

```bash
qwen mcp add mantine npx -y @mantine/mcp-server
npx skills add mantinedev/skills -g -a qwen-code -y
```

#### 2. Set up your project

Create new project:

```text
Create a new TanStack Start project with Mantine.

1. Read the current Mantine TanStack Start setup guide: https://mantine.dev/llms/guides-tanstack-start.md
2. Create a new React application with the TanStack Start CLI: npx @tanstack/cli@latest create. Use my requested project name if I provided one.
3. Use the package manager declared by the generated project. Install @mantine/core and @mantine/hooks. Configure PostCSS with postcss, postcss-preset-mantine and postcss-simple-vars as described in the guide. Configure src/routes/__root.tsx with MantineProvider, ColorSchemeScript and mantineHtmlProps. Import Mantine styles with the ?url suffix and add them to the root route head links before application styles. Preserve HeadContent and Scripts.
4. Add a small page using Mantine components to demonstrate that the setup works.
5. Run the available formatting, lint, type, test and build scripts. Start the dev server, verify that Mantine renders correctly without browser errors, and tell me its URL.
6. Briefly explain the project structure and the scripts available in package.json.

Use the Mantine MCP server and Mantine skills if they are installed.
```

Add to existing project:

```text
Add Mantine to my existing TanStack Start project.

1. Inspect the project structure, framework version, package manager, routing and existing styling configuration.
2. Read the current Mantine TanStack Start setup guide: https://mantine.dev/llms/guides-tanstack-start.md
3. Use the project's existing package manager. Install @mantine/core and @mantine/hooks. Configure PostCSS with postcss, postcss-preset-mantine and postcss-simple-vars as described in the guide. Configure src/routes/__root.tsx with MantineProvider, ColorSchemeScript and mantineHtmlProps. Import Mantine styles with the ?url suffix and add them to the root route head links before application styles. Preserve HeadContent and Scripts.
4. Merge the setup into the existing configuration and preserve routes, providers, styles and application behavior. Do not scaffold a new project or replace existing files wholesale.
5. Add a small Mantine example to an appropriate existing page.
6. Run the available formatting, lint, type, test and build scripts. Start the dev server, verify that Mantine renders correctly without browser errors, and tell me its URL.
7. Summarize the files changed and any follow-up steps.

Use the Mantine MCP server and Mantine skills if they are installed.
```

### Kimi Code

#### 1. Add the MCP server

Add the MCP server to `~/.kimi-code/mcp.json`, or run `/mcp-config` in a Kimi Code session.
If the file already lists other servers, add the `mantine` entry next to them:

```json
{
  "mcpServers": {
    "mantine": {
      "command": "npx",
      "args": ["-y", "@mantine/mcp-server"]
    }
  }
}
```

#### 2. Install Mantine skills

Install the skills for Kimi Code:

```bash
npx skills add mantinedev/skills -g -a kimi-code-cli -y
```

#### 3. Set up your project

Create new project:

```text
Create a new TanStack Start project with Mantine.

1. Read the current Mantine TanStack Start setup guide: https://mantine.dev/llms/guides-tanstack-start.md
2. Create a new React application with the TanStack Start CLI: npx @tanstack/cli@latest create. Use my requested project name if I provided one.
3. Use the package manager declared by the generated project. Install @mantine/core and @mantine/hooks. Configure PostCSS with postcss, postcss-preset-mantine and postcss-simple-vars as described in the guide. Configure src/routes/__root.tsx with MantineProvider, ColorSchemeScript and mantineHtmlProps. Import Mantine styles with the ?url suffix and add them to the root route head links before application styles. Preserve HeadContent and Scripts.
4. Add a small page using Mantine components to demonstrate that the setup works.
5. Run the available formatting, lint, type, test and build scripts. Start the dev server, verify that Mantine renders correctly without browser errors, and tell me its URL.
6. Briefly explain the project structure and the scripts available in package.json.

Use the Mantine MCP server and Mantine skills if they are installed.
```

Add to existing project:

```text
Add Mantine to my existing TanStack Start project.

1. Inspect the project structure, framework version, package manager, routing and existing styling configuration.
2. Read the current Mantine TanStack Start setup guide: https://mantine.dev/llms/guides-tanstack-start.md
3. Use the project's existing package manager. Install @mantine/core and @mantine/hooks. Configure PostCSS with postcss, postcss-preset-mantine and postcss-simple-vars as described in the guide. Configure src/routes/__root.tsx with MantineProvider, ColorSchemeScript and mantineHtmlProps. Import Mantine styles with the ?url suffix and add them to the root route head links before application styles. Preserve HeadContent and Scripts.
4. Merge the setup into the existing configuration and preserve routes, providers, styles and application behavior. Do not scaffold a new project or replace existing files wholesale.
5. Add a small Mantine example to an appropriate existing page.
6. Run the available formatting, lint, type, test and build scripts. Start the dev server, verify that Mantine renders correctly without browser errors, and tell me its URL.
7. Summarize the files changed and any follow-up steps.

Use the Mantine MCP server and Mantine skills if they are installed.
```

## Generate new application

Follow the [TanStack Start quick start guide](https://tanstack.com/start/latest/docs/framework/react/quick-start)
to create a new TanStack Start application:

```bash
npx @tanstack/cli@latest create
```

## Installation

## PostCSS setup

Install PostCSS plugins and [postcss-preset-mantine](https://alpha.mantine.dev/llms/styles-postcss-preset.md):

```bash
yarn add postcss postcss-preset-mantine postcss-simple-vars
```

```bash
npm install postcss postcss-preset-mantine postcss-simple-vars
```

Create a `postcss.config.mjs` file at the root of your application with the following content:

```js
export default {
  plugins: {
    'postcss-preset-mantine': {},
    'postcss-simple-vars': {
      variables: {
        'mantine-breakpoint-xs': '36em',
        'mantine-breakpoint-sm': '48em',
        'mantine-breakpoint-md': '62em',
        'mantine-breakpoint-lg': '75em',
        'mantine-breakpoint-xl': '88em',
      },
    },
  },
};
```

## Setup

Add styles imports, [MantineProvider](https://alpha.mantine.dev/llms/theming-mantine-provider.md) and `ColorSchemeScript`
to `src/routes/__root.tsx`. Import styles with the `?url` suffix and add them to the
`links` array of the root route, before other styles of your application:

```tsx
// Import styles of packages that you've installed.
// All packages except `@mantine/hooks` require styles imports
import mantineCoreStyles from '@mantine/core/styles.css?url';

import { createRootRoute, HeadContent, Scripts } from '@tanstack/react-router';
import { ColorSchemeScript, mantineHtmlProps, MantineProvider } from '@mantine/core';

export const Route = createRootRoute({
  head: () => ({
    meta: [
      { charSet: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
    ],
    links: [{ rel: 'stylesheet', href: mantineCoreStyles }],
  }),
  shellComponent: RootDocument,
});

function RootDocument({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en" {...mantineHtmlProps}>
      <head>
        <ColorSchemeScript />
        <HeadContent />
      </head>
      <body>
        <MantineProvider>{children}</MantineProvider>
        <Scripts />
      </body>
    </html>
  );
}
```

All set! Start the development server:

```bash
npm run dev
```
