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

# Claude Code

> Wire the Ntro MCP server into Claude Code so the agent can read tenants, deploy runbooks, and run tests directly from your terminal.

[Claude Code](https://claude.com/claude-code) is Anthropic's terminal-based coding agent. It speaks MCP natively and can run shell commands, which means it can use both the Ntro MCP server *and* the `ntro` CLI — exactly the two surfaces a runbook author needs.

## Prerequisites

* Claude Code installed and signed in

## Add the MCP server

Point Claude Code at the [hosted test instance](/tooling/mcp-server#quick-start--hosted-test-instance):

```bash theme={null}
claude mcp add --transport http ntro https://mcp.test.ntropii.com
```

Verify with `claude mcp list`. The Ntro tools appear in `/mcp` in your next session.

> **Self-hosting?** See [the MCP server reference](/tooling/mcp-server#self-host-advanced) for the local stdio-install path with `~/.claude/mcp.json` config.

## Verify it's working

In Claude Code, ask:

```
Run ntro_whoami and show me the result.
```

You should get back your identity, organisation, and accessible tenants. If you see an authentication error, check that `ntro auth whoami` works at the terminal — the MCP server uses the same config.

## Make the CLI usable too

The MCP tools cover write operations. For reading runs, viewing schedules, and running the local test harness, Claude Code is most effective when it can shell out to the `ntro` CLI:

```bash theme={null}
ntro --help
ntro workflow test ./runbooks/nav-monthly --scenario happy
```

If `ntro` is on `$PATH`, Claude Code can run it directly. With editable installs from a custom venv, either:

* Add the venv's `bin/` to `$PATH` in your shell init, or
* Tell Claude Code to use the absolute path: `/home/you/.ntro-dev/bin/ntro workflow test ...`

## Example: scaffold a runbook

A real session looks roughly like:

```
You:    Read ntro://tenants/acme-fund and the schemas at
        ntro://integrations/<id>/schemas. Then scaffold a new runbook
        at runbooks/document-ingest-acme/ that mirrors the structure
        of runbooks/document-ingest/ — but reading invoices from
        Acme's specific schema layout.

Claude: <reads tenant + schemas via MCP>
        <reads existing template at runbooks/document-ingest/>
        <writes the new files>

You:    Now run ntro workflow test ./runbooks/document-ingest-acme
        --scenario happy and fix anything that fails.

Claude: <runs the test, sees a failure, iterates>
```

That's the design-time loop. Once the test passes, you review the diff, request changes, and merge.

## Shipping it

Two ways to deploy from Claude Code:

<CodeGroup>
  ```bash CLI theme={null}
  ntro workflow create \
    --path ./runbooks/document-ingest-acme/ \
    --tenant acme-fund \
    --entity acme-spv1
  ```

  ```text MCP theme={null}
  "Use ntro_workflow_create to deploy runbooks/document-ingest-acme to
  acme-fund, bound to acme-spv1."
  ```
</CodeGroup>

The MCP path is shorter; the CLI path gives you visible logs. Pick whichever the situation calls for.

## Related

<CardGroup cols={2}>
  <Card title="Copilot Studio" icon="microsoft" href="/tooling/coding-agents/copilot-studio">
    Same MCP server, different client.
  </Card>

  <Card title="Skill definitions" icon="brain" href="/workflows/runbooks/skill-definitions">
    The prompts that teach a coding agent how to author Ntropii runbooks.
  </Card>
</CardGroup>
