Configure Agents to Use mirrord

In this guide, we'll cover how to configure mirrord with Cursor, Claude Code, GitHub Copilot, Codex, and Windsurf. Each tool reads instructions differently, but the setup is the same: a mirrord config, an instructions file, and optionally a helper script.


Tip: You can use mirrordarrow-up-right to test AI-generated code locally with Kubernetes context, without needing to build or deploy each time. If you're new to mirrord, start with the Quick Startarrow-up-right.


Where mirrord fits in the AI Dev Stack

Common setup: mirrord config

Before configuring any AI tool, create a mirrord config at .mirrord/mirrord.json:

For repos with multiple services, create one config per service: .mirrord/mirrord-<service>.json.

Tip: You can auto-generate configs and agent instructions for your entire repo using the mirrord skills packagearrow-up-right for Claude Code, or the meta-prompt in Using mirrord with AI Agentsarrow-up-right for any tool. The sections below show what to set up manually if you prefer.

Claude Code

Claude Code reads instructions from CLAUDE.md at the repo root. It also reads AGENTS.md if present.

Fast path: install mirrord skills

MetalBear publishes a skills packagearrow-up-right that gives Claude Code mirrord capabilities out of the box, config generation, quickstart, CI setup, operator installation, and database branching:

Or with npx:

Once installed, Claude Code can generate mirrord configs, run services against staging, and set up your repo without manual instructions. If you want more control over the instructions, create a CLAUDE.md manually instead.

Manual setup

Create CLAUDE.md:

Usage

Cursor

Cursor reads project-level instructions from .cursor/rules/ directory. Each file in this directory is loaded as a rule.

Setup

Create .cursor/rules/mirrord.mdc:

Using with Cursor Agent

When using Cursor's Agent mode for multi-file changes, Cursor reads rules from .cursor/rules/ automatically. Ask it to test:

Cursor will generate the code, run mirrord exec, and verify the result.

GitHub Copilot

GitHub Copilot and the Copilot Coding Agent read instructions from .github/copilot-instructions.md.

Setup

Create .github/copilot-instructions.md:

Codex

OpenAI Codex reads from AGENTS.md.

Setup

Use the same AGENTS.md format as Claude Code above. Codex follows the same conventions.

Windsurf

Windsurf reads from .windsurfrules.

Setup

Create .windsurfrules:

Using the meta-prompt for any tool

Instead of writing configs manually, you can paste the meta-prompt from Using mirrord with AI Agentsarrow-up-right into any AI tool. It will:

  1. Scan your repo to discover services

  2. Ask you which deployments to target

  3. Generate .mirrord/mirrord-<service>.json configs

  4. Generate an AGENTS.md with instructions for your specific setup

This works with Claude Code, Cursor, Copilot CLI, and Gemini CLI.

IDE plugin integration

If you use mirrord's IDE plugins (VS Code or JetBrains), your AI agent's code runs with mirrord context automatically when you hit Run or Debug, no mirrord exec needed.

VS Code, Cursor, Windsurf, and other forks

The mirrord extension works for VS Code and all its forks like Cursor, Windsurf, etc.

  1. Enable mirrord from the status bar

  2. When your AI agent says "run the service", use the Run/Debug button, mirrord is already active

JetBrains (IntelliJ, GoLand, PyCharm, etc.)

  1. Enable mirrord and select your config

  2. Run/Debug your application, mirrord handles the cluster connection

This is useful when you're pair-programming with an AI agent in the IDE rather than letting it run autonomously via CLI.

Verifying the setup

After configuring any tool, test the integration:

  1. Ask the agent to make a trivial change (e.g., add a log line)

  2. Ask it to test the change using mirrord

  3. Verify the agent runs mirrord exec and checks the output

  4. Confirm the agent reports real responses from staging, not mock data

If the agent skips the mirrord step, strengthen the language in your instructions file, use "MUST", "ALWAYS", "NEVER" instead of "should" or "please".

Next steps

Last updated

Was this helpful?