AI CLI commands

The commands in this section allow you to manage AI-related tools that enhance your development experience with Uniform. This includes:

Project assetCommand
AI Rulesai rules install, ai rules list
MCP Serverai mcp install

AI rules provide LLM tools with up-to-date knowledge about Uniform concepts, SDK usage, and best practices.

Installs and configures AI rules for your project. This command supports both Cursor and Claude Code.

uniform ai rules install
OptionDescriptionDefault
--agent <type>, -aSpecify agent type (cursor, claude, other)Auto-detected
--directory <path>, -dCustom installation directoryAuto-detected based on AI tool
--helpShow help information

Basic installation:

uniform ai rules install

Install for specific agent:

uniform ai rules install --agent cursor

Install to custom directory:

uniform ai rules install --directory .cursor
  1. Detects your AI tool - Automatically identifies whether you're using Cursor, Claude Code, or other MCP-compatible tools
  2. Downloads latest rules - Fetches the most current AI rules from the Uniform AI rules repository
  3. Configures placement - Places rules in the appropriate directory (.cursor, .claude, etc.)
  4. Validates setup - Ensures rules are properly configured and accessible

The installation includes essential rules for:

  • Core Uniform concepts (uniform.mdc) - Fundamental principles and architecture
  • SDK usage (uniform-sdk.mdc) - Uniform SDK capabilities and patterns
  • Framework-specific guidance:
    • Next.js Page Router (uniform-next-page-router.mdc)
    • Next.js App Router (uniform-next-app-router.mdc)
  • Optional personal preferences - Customizable defaults and coding standards

Cursor: After installation, the rules will be available in your .cursor folder. Add them to your chat context when working with Uniform projects.

Claude Code: The rules will be placed in the appropriate location for Claude Code to automatically detect and use them.

Lists all available Uniform AI rules that can be installed.

uniform ai rules list

List all available rules:

uniform ai rules list

This command displays:

  • Rule name - The filename and identifier
  • Description - What the rule covers
  • Status - Whether it's a core rule, framework-specific, or optional

The Model Context Protocol (MCP) Server allows AI tools to directly interact with Uniform APIs to create and manage components, content types, and patterns.

Installs and configures the Uniform MCP Server for your project.

uniform ai mcp install
OptionDescriptionDefault
--agent <type>, -aSpecify agent type (cursor, claude, other)Auto-detected
--directory <path>, -dCustom installation directoryAuto-detected based on agent
--project <id>, -pProject ID to use (skips project selection)Interactive selection
--team <id>, -tTeam ID to use (skips team selection)Interactive selection
--apiKey <key>Uniform API key with write access (skips API key generation)Auto-generated
--apiHost <host>Uniform hosthttps://uniform.app
--aiApiHost <host>Uniform AI API hosthttps://ai.uniform.global
--helpShow help information

Interactive installation (recommended):

uniform ai mcp install

Non-interactive installation:

uniform ai mcp install --project <project-id> --apiKey <api-key>

Install for specific agent:

uniform ai mcp install --agent cursor

Custom directory:

uniform ai mcp install --directory ./my-mcp-config
  1. Interactive/Non-interactive modes - Supports both guided setup and automated installation
  2. Agent detection - Automatically identifies your AI tool (Cursor, Claude, other)
  3. Authentication setup - Generates API keys or uses provided ones
  4. Configuration generation - Creates appropriate config files (.mcp.json for Claude, mcp.json for others)
  5. Directory management - Creates necessary directories and preserves existing MCP servers
  • Uniform account and access to a team/project
  • AI Credits in your Uniform team (required for create and search operations)

info

The command can run in interactive mode (walks you through team/project selection and API key generation) or non-interactive mode (requires --project and --apiKey parameters).

AI Credits Required

Create and search operations performed through the MCP Server require AI Credits in your Uniform Team. If you have already used all your existing credits, please check with your Account Representative from Uniform for a top-up.

The installation creates a configuration file with the following naming convention:

  • Claude Desktop/Code: .mcp.json (hidden file)
  • Cursor and others: mcp.json

The configuration file structure:

{ "mcpServers": { "Uniform": { "type": "stdio", "command": "npx", "args": [ "-y", "@uniformdev/uniform-mcp" ], "env": { "UNIFORM_API_KEY": "your-api-key", "UNIFORM_PROJECT_ID": "your-project-id", "UNIFORM_AI_API_HOST": "https://ai.uniform.global" } } } }

info

If you have existing MCP servers configured, the installer will preserve them and only add/update the Uniform server configuration.

Rules not appearing in AI tool:

  • Ensure the rules are in the correct directory for your AI tool
  • Restart your AI tool after installation
  • Check file permissions and directory structure

Installation fails:

  • Verify you have internet connectivity to download rules
  • Check write permissions in the target directory
  • Try specifying a custom directory with --directory

Interactive mode issues:

  • Verify you have access to at least one team and project
  • Check your network connectivity

Non-interactive mode fails:

  • Verify the project ID exists and you have access
  • Ensure the API key has appropriate permissions

MCP Server not detected in AI tool:

  • Restart your AI tool after installation
  • For Cursor: Check Settings > MCP & Integrations
  • For Claude: Verify the .mcp.json file exists in the correct location
  • Check the configuration file format is valid JSON

AI Credits exhausted:

  • Contact your Uniform Account Representative for credit top-up
  • Monitor your team's AI credit usage in Uniform dashboard

For additional help, see the CLI troubleshooting guide.