> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getmonocle.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Integration

> How monocle connects to your AI coding agent via MCP tools, skills, or CLI commands.

Monocle integrates with your agent through one of two modes: **MCP tools** or **skills**. Both expose the same operations — the difference is how the agent invokes them.

* **MCP tools mode** runs a built-in MCP server (`monocle serve-mcp`) that exposes review operations as tools. This is the default for Claude Code. Pi reaches the server through `pi-mcp-adapter` when the adapter is already configured, or when you explicitly request MCP mode.
* **Skills mode** installs `SKILL.md` instruction files ([agentskills.io](https://agentskills.io) format) that tell the agent which `monocle review` CLI commands to run. This is the default for OpenCode, Codex CLI, and Gemini CLI.

You can override the default with `--integration-mode` when registering. See [agent setup](/guides/agent-setup) for details.

## Available operations

These operations are available as both MCP tools and skills:

| Operation                | MCP tool                                               | Skill                | Description                                             |
| ------------------------ | ------------------------------------------------------ | -------------------- | ------------------------------------------------------- |
| Get feedback             | `get_feedback`                                         | `/get-feedback`      | Retrieve pending review feedback                        |
| Get feedback (blocking)  | `get_feedback` with `wait: true`                       | `/get-feedback-wait` | Block until the reviewer submits feedback               |
| Send artifact            | `send_artifact`                                        | `/review-plan`       | Submit content (plans, decisions, summaries) for review |
| Send artifact (blocking) | `send_artifact`, then `get_feedback` with `wait: true` | `/review-plan-wait`  | Submit content and iterate on feedback until approved   |
| Check status             | `review_status`                                        | —                    | Check if feedback is pending or a pause was requested   |
| Add files                | `add_files`                                            | —                    | Add files to the current review session                 |

### Get feedback

Retrieves any feedback you've submitted and delivers it to the agent. If you've submitted multiple reviews since the agent last checked, they're all delivered together in one batch.

With Claude Code and MCP channels, the agent calls this automatically after receiving a push notification. With other agents, feedback is retrieved on demand — either by the agent on its own, or when you ask it to check.

### Get feedback (blocking)

Same as get feedback, but the agent blocks and waits until you submit. Use this when a pause has been requested or when the agent should hold off until you've reviewed its work.

### Send artifact

Tells the agent to send content to monocle for review using `monocle review send-artifact` (skills) or the `send_artifact` tool (MCP). The content appears in your TUI alongside file diffs, and you can leave line-level comments on it.

### Send artifact (blocking)

Same as send artifact, but the agent blocks after submitting and waits for your response. In MCP tools mode, the agent submits with `send_artifact`, then calls `get_feedback` with `wait: true`. If you request changes, the agent updates and resubmits — iterating until you approve (submit with no comments).

This is what enables [review gating](/guides/review-gating): the agent cannot move forward until you sign off.

## Registration

`monocle register` writes the appropriate config for your agent. In MCP tools mode, it configures an MCP server entry and installs slash commands or prompt templates where the agent supports them. In skills mode, it writes skill files to the agent's skill directory.

<CodeGroup>
  ```bash Claude Code theme={"dark"}
  # Default: MCP tools mode — configures .mcp.json and .claude/commands/
  monocle register claude

  # To use skills mode instead:
  monocle register claude --integration-mode skills
  ```

  ```bash OpenCode theme={"dark"}
  # Default: skills mode — installs to .opencode/skills/
  monocle register opencode
  ```

  ```bash Codex CLI theme={"dark"}
  # Default: skills mode — installs to .codex/skills/
  monocle register codex
  ```

  ```bash Gemini CLI theme={"dark"}
  # Default: skills mode — installs to .gemini/skills/
  monocle register gemini
  ```

  ```bash Pi theme={"dark"}
  # Auto: use existing pi-mcp-adapter when configured, otherwise skills/prompts
  monocle register pi

  # Force MCP tools mode and add the pinned pi-mcp-adapter package if needed:
  monocle register pi --integration-mode mcp

  # Force skills/prompts mode:
  monocle register pi --integration-mode skills
  ```

  ```bash All agents theme={"dark"}
  # Register for every supported agent at once
  monocle register all
  ```
</CodeGroup>

Run `monocle register` once per project, or with `--global` to apply across all projects.

## Making operations automatic

Operations are available to your agent, but the agent decides when to use them. If you want the agent to automatically submit plans for review or check for feedback at specific points, add instructions to your agent's project configuration file (`CLAUDE.md`, `AGENTS.md`, etc.):

```markdown theme={"dark"}
## Monocle Integration

When Monocle is running:
- Use the `/review-plan` skill to send content (plans, decisions, summaries) for the reviewer to see
- Use the content's filename as the identifier so updates replace the previous version
- In plan mode, use `/review-plan-wait` instead — it blocks until the reviewer responds.
  If they request changes, update and resubmit until approved.
```

<Tip>
  You can also invoke `/review-plan` and `/review-plan-wait` yourself at any time by asking your agent to run them.
</Tip>
